Skip to content

Commit 21c9dd0

Browse files
committed
Code review fixes.
1 parent 46e94a2 commit 21c9dd0

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

modules/aruco/samples/calibrate_camera.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This file is part of OpenCV project.
2+
// It is subject to the license terms in the LICENSE file found in the top-level directory
3+
// of this distribution and at http://opencv.org/license.html
4+
15
#include <ctime>
26
#include <iostream>
37
#include <vector>
@@ -116,10 +120,7 @@ int main(int argc, char *argv[]) {
116120
}
117121

118122
// Create board object
119-
Ptr<aruco::GridBoard> gridboard = new aruco::GridBoard(
120-
Size(markersX, markersY), markerLength, markerSeparation, dictionary
121-
);
122-
Ptr<aruco::Board> board = gridboard.staticCast<aruco::Board>();
123+
aruco::GridBoard gridboard(Size(markersX, markersY), markerLength, markerSeparation, dictionary);
123124

124125
// Collected frames for calibration
125126
vector<vector<vector<Point2f>>> allMarkerCorners;
@@ -141,7 +142,7 @@ int main(int argc, char *argv[]) {
141142
// Refind strategy to detect more markers
142143
if(refindStrategy) {
143144
detector.refineDetectedMarkers(
144-
image, *board, markerCorners, markerIds, rejectedMarkers
145+
image, gridboard, markerCorners, markerIds, rejectedMarkers
145146
);
146147
}
147148

@@ -194,7 +195,7 @@ int main(int argc, char *argv[]) {
194195
for(size_t frame = 0; frame < nFrames; frame++) {
195196
Mat currentImgPoints, currentObjPoints;
196197

197-
board->matchImagePoints(
198+
gridboard.matchImagePoints(
198199
allMarkerCorners[frame], allMarkerIds[frame],
199200
currentObjPoints, currentImgPoints
200201
);

modules/aruco/samples/calibrate_camera_charuco.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This file is part of OpenCV project.
2+
// It is subject to the license terms in the LICENSE file found in the top-level directory
3+
// of this distribution and at http://opencv.org/license.html
4+
15
#include <iostream>
26
#include <vector>
37
#include <opencv2/calib3d.hpp>

0 commit comments

Comments
 (0)