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:
Chris Gerth
2020-12-20 19:39:21 -06:00
committed by GitHub
parent c7d092a775
commit 771f7442c9
31 changed files with 74 additions and 10 deletions

View File

@@ -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")

View File

@@ -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

View File

@@ -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();