mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Cal checkerboard object coords update (#181)
* WIP monkeying around with adding new targets. * Added testcase to replicate large extrinsics result from calibration. * Tweaked calibration pipline to return image with chessboard corner detection overlaid. * Removed "bad" images from the cal, but that didn't seem to help... * Added test logic to output the undistorted Mat for evaluating the quality of the calibration. * Tweaked generation of chessboard points to be in a square pattern, not parallelogram. * Spotless and removed bespoke test target in prep for PR. * Revised to a double-for loop for less complex-looking logic * #thanks spotless al;ksgfjh akljghf ;lakdfdhg ksadfgh klasdfjhg kasdfjghj aklsjg two spaces * Boop * Reverting my changes in Calibrate3dPipeline.java to make this merge better with other PR's * Derp changed the wrong one
This commit is contained in:
@@ -182,6 +182,10 @@ public class TestUtils {
|
||||
return getResourcesFolderPath(false).resolve("calibrationBoardImages");
|
||||
}
|
||||
|
||||
public static Path getSquaresBoardImagesPath() {
|
||||
return getResourcesFolderPath(false).resolve("calibrationSquaresImg");
|
||||
}
|
||||
|
||||
public static File getHardwareConfigJson() {
|
||||
return getResourcesFolderPath(false)
|
||||
.resolve("hardware")
|
||||
|
||||
@@ -71,13 +71,12 @@ public class FindBoardCornersPipe
|
||||
// dots per column
|
||||
if (params.type == UICalibrationData.BoardType.CHESSBOARD) {
|
||||
// Here we can create an NxN grid since a chessboard is rectangular
|
||||
for (int i = 0; i < patternSize.height * patternSize.width; i++) {
|
||||
objectPoints.push_back(
|
||||
new MatOfPoint3f(
|
||||
new Point3(
|
||||
(double) i / patternSize.width * params.gridSize,
|
||||
i % patternSize.width * params.gridSize,
|
||||
0.0f)));
|
||||
for (int heightIdx = 0; heightIdx < patternSize.height; heightIdx++) {
|
||||
for (int widthIdx = 0; widthIdx < patternSize.height; widthIdx++) {
|
||||
double boardYCoord = heightIdx * params.gridSize;
|
||||
double boardXCoord = widthIdx * params.gridSize;
|
||||
objectPoints.push_back(new MatOfPoint3f(new Point3(boardXCoord, boardYCoord, 0.0)));
|
||||
}
|
||||
}
|
||||
} else if (params.type == UICalibrationData.BoardType.DOTBOARD) {
|
||||
// Here we need to alternate the amount of dots per column since a dot board is not
|
||||
|
||||
@@ -73,7 +73,15 @@ public enum TargetModel implements Releasable {
|
||||
Units.inchesToMeters(7) / 2,
|
||||
-Units.inchesToMeters(7) / 2,
|
||||
-Units.inchesToMeters(7) / 2)),
|
||||
0);
|
||||
0),
|
||||
k2016HighGoal(
|
||||
List.of(
|
||||
new Point3(Units.inchesToMeters(-10), Units.inchesToMeters(12), 0),
|
||||
new Point3(Units.inchesToMeters(-10), Units.inchesToMeters(0), 0),
|
||||
new Point3(Units.inchesToMeters(10), Units.inchesToMeters(0), 0),
|
||||
new Point3(Units.inchesToMeters(10), Units.inchesToMeters(12), 0)),
|
||||
Units.inchesToMeters(6)),
|
||||
;
|
||||
|
||||
@JsonIgnore private MatOfPoint3f realWorldTargetCoordinates;
|
||||
@JsonIgnore private MatOfPoint3f visualizationBoxBottom = new MatOfPoint3f();
|
||||
|
||||
Reference in New Issue
Block a user