[Calibration] Fix iterator bound while creating object points (#188)

Fixes mismatched iterator bounds while creating object points. This addresses calibration failing for non square boards.
This commit is contained in:
Matt
2020-12-23 09:05:27 -08:00
committed by GitHub
parent f2f32da2f9
commit 7a032cce6e
2 changed files with 6 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ public class FindBoardCornersPipe
if (params.type == UICalibrationData.BoardType.CHESSBOARD) {
// Here we can create an NxN grid since a chessboard is rectangular
for (int heightIdx = 0; heightIdx < patternSize.height; heightIdx++) {
for (int widthIdx = 0; widthIdx < patternSize.height; widthIdx++) {
for (int widthIdx = 0; widthIdx < patternSize.width; widthIdx++) {
double boardYCoord = heightIdx * params.gridSize;
double boardXCoord = widthIdx * params.gridSize;
objectPoints.push_back(new MatOfPoint3f(new Point3(boardXCoord, boardYCoord, 0.0)));