diff --git a/photon-server/src/test/java/org/photonvision/vision/pipeline/Calibrate3dPipeTest.java b/photon-server/src/test/java/org/photonvision/vision/pipeline/Calibrate3dPipeTest.java index afd6aa278..96c4491f6 100644 --- a/photon-server/src/test/java/org/photonvision/vision/pipeline/Calibrate3dPipeTest.java +++ b/photon-server/src/test/java/org/photonvision/vision/pipeline/Calibrate3dPipeTest.java @@ -141,14 +141,26 @@ public class Calibrate3dPipeTest { @Test public void calibrateSquares320x240() { + // Pi3 and V1.3 camera String base = TestUtils.getSquaresBoardImagesPath().toAbsolutePath().toString(); File dir = Path.of(base, "piCam", "320_240_1").toFile(); Size sz = new Size(320, 240); calibrateSquaresCommon(sz, dir); } + @Test + public void calibrateSquares320x240_9x7_board() { + // Gloworm Beta + String base = TestUtils.getSquaresBoardImagesPath().toAbsolutePath().toString(); + File dir = Path.of(base, "piCam", "320_240_2").toFile(); + Size sz = new Size(320, 240); + Size boardDim = new Size(9, 7); + calibrateSquaresCommon(sz, dir, boardDim); + } + @Test public void calibrateSquares640x480() { + // Pi3 and V1.3 camera String base = TestUtils.getSquaresBoardImagesPath().toAbsolutePath().toString(); File dir = Path.of(base, "piCam", "640_480_1").toFile(); Size sz = new Size(640, 480); @@ -157,6 +169,7 @@ public class Calibrate3dPipeTest { @Test public void calibrateSquares960x720() { + // Pi3 and V1.3 camera String base = TestUtils.getSquaresBoardImagesPath().toAbsolutePath().toString(); File dir = Path.of(base, "piCam", "960_720_1").toFile(); Size sz = new Size(960, 720); @@ -165,6 +178,7 @@ public class Calibrate3dPipeTest { @Test public void calibrateSquares1920x1080() { + // Pi3 and V1.3 camera String base = TestUtils.getSquaresBoardImagesPath().toAbsolutePath().toString(); File dir = Path.of(base, "piCam", "1920_1080_1").toFile(); Size sz = new Size(1920, 1080); @@ -172,6 +186,15 @@ public class Calibrate3dPipeTest { } public void calibrateSquaresCommon(Size imgRes, File rootFolder) { + calibrateSquaresCommon(imgRes, rootFolder, new Size(8, 8), Units.inchesToMeters(1)); + } + + public void calibrateSquaresCommon(Size imgRes, File rootFolder, Size boardDim) { + calibrateSquaresCommon(imgRes, rootFolder, boardDim, Units.inchesToMeters(1)); + } + + public void calibrateSquaresCommon( + Size imgRes, File rootFolder, Size boardDim, double boardGridSize_m) { int startMatCount = CVMat.getMatCount(); @@ -182,10 +205,9 @@ public class Calibrate3dPipeTest { Calibrate3dPipeline calibration3dPipeline = new Calibrate3dPipeline(20); calibration3dPipeline.getSettings().boardType = UICalibrationData.BoardType.CHESSBOARD; calibration3dPipeline.getSettings().resolution = imgRes; - - calibration3dPipeline.getSettings().boardWidth = 8; - calibration3dPipeline.getSettings().boardHeight = 8; - calibration3dPipeline.getSettings().gridSize = Units.inchesToMeters(1); + calibration3dPipeline.getSettings().boardHeight = (int) Math.round(boardDim.height); + calibration3dPipeline.getSettings().boardWidth = (int) Math.round(boardDim.width); + calibration3dPipeline.getSettings().gridSize = boardGridSize_m; for (var file : directoryListing) { if (file.isFile()) { diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img1.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img1.jpg new file mode 100644 index 000000000..24b1f945f Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img1.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img10.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img10.jpg new file mode 100644 index 000000000..53f0cb59a Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img10.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img11.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img11.jpg new file mode 100644 index 000000000..5878bb11b Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img11.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img12.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img12.jpg new file mode 100644 index 000000000..45b279e6e Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img12.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img13.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img13.jpg new file mode 100644 index 000000000..65f974c66 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img13.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img14.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img14.jpg new file mode 100644 index 000000000..02e00d42e Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img14.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img15.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img15.jpg new file mode 100644 index 000000000..e875b8e49 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img15.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img16.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img16.jpg new file mode 100644 index 000000000..c19165624 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img16.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img17.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img17.jpg new file mode 100644 index 000000000..d7eb41dde Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img17.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img18.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img18.jpg new file mode 100644 index 000000000..06c0c17a8 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img18.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img19.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img19.jpg new file mode 100644 index 000000000..70ccfb601 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img19.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img2.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img2.jpg new file mode 100644 index 000000000..cf72c39ea Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img2.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img20.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img20.jpg new file mode 100644 index 000000000..5e34f2c1a Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img20.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img21.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img21.jpg new file mode 100644 index 000000000..1cc102498 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img21.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img22.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img22.jpg new file mode 100644 index 000000000..bf0e88f53 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img22.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img23.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img23.jpg new file mode 100644 index 000000000..5f2ca9dc3 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img23.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img24.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img24.jpg new file mode 100644 index 000000000..c36f1103b Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img24.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img25.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img25.jpg new file mode 100644 index 000000000..a530f2289 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img25.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img3.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img3.jpg new file mode 100644 index 000000000..b0cc25241 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img3.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img4.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img4.jpg new file mode 100644 index 000000000..56fa26a9a Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img4.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img5.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img5.jpg new file mode 100644 index 000000000..6a0c6907b Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img5.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img6.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img6.jpg new file mode 100644 index 000000000..26c1e6a2d Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img6.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img7.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img7.jpg new file mode 100644 index 000000000..ac71040db Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img7.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img8.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img8.jpg new file mode 100644 index 000000000..eadc5e466 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img8.jpg differ diff --git a/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img9.jpg b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img9.jpg new file mode 100644 index 000000000..47f42faa2 Binary files /dev/null and b/photon-server/src/test/resources/calibrationSquaresImg/piCam/320_240_2/img9.jpg differ