Skip to content

Commit 56d492c

Browse files
author
Alexander Panov
authored
Merge pull request opencv#3174 from AleksandrPanov:fix_gridboard_objPoints
Fix objPoints order in GridBoard and CharucoBoard * fix gridBoard * fix charucoBoard * add rightBottomBorder * add test_aruco_utils and code refactoring/fix tests * fix axes and add charuco dict * add axes test, remove drawAxis(), update tutorial
1 parent 631cefc commit 56d492c

27 files changed

+277
-339
lines changed

modules/aruco/include/opencv2/aruco.hpp

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,9 @@ CV_EXPORTS_W void detectMarkers(InputArray image, const Ptr<Dictionary> &diction
248248
* The marker corrdinate system is centered on the middle of the marker, with the Z axis
249249
* perpendicular to the marker plane.
250250
* The coordinates of the four corners of the marker in its own coordinate system are:
251-
* (-markerLength/2, markerLength/2, 0), (markerLength/2, markerLength/2, 0),
252-
* (markerLength/2, -markerLength/2, 0), (-markerLength/2, -markerLength/2, 0)
251+
* (0, 0, 0), (markerLength, 0, 0),
252+
* (markerLength, markerLength, 0), (0, markerLength, 0)
253+
* @sa use cv::drawFrameAxes to get world coordinate system axis for object points
253254
*/
254255
CV_EXPORTS_W void estimatePoseSingleMarkers(InputArrayOfArrays corners, float markerLength,
255256
InputArray cameraMatrix, InputArray distCoeffs,
@@ -292,7 +293,14 @@ class CV_EXPORTS_W Board {
292293
CV_WRAP void setIds(InputArray ids);
293294

294295
/// array of object points of all the marker corners in the board
295-
/// each marker include its 4 corners in CCW order. For M markers, the size is Mx4.
296+
/// each marker include its 4 corners in this order:
297+
///- objPoints[i][0] - left-top point of i-th marker
298+
///- objPoints[i][1] - right-top point of i-th marker
299+
///- objPoints[i][2] - right-bottom point of i-th marker
300+
///- objPoints[i][3] - left-bottom point of i-th marker
301+
///
302+
/// Markers are placed in a certain order - row by row, left to right in every row.
303+
/// For M markers, the size is Mx4.
296304
CV_PROP std::vector< std::vector< Point3f > > objPoints;
297305

298306
/// the dictionary of markers employed for this board
@@ -301,6 +309,9 @@ class CV_EXPORTS_W Board {
301309
/// vector of the identifiers of the markers in the board (same size than objPoints)
302310
/// The identifiers refers to the board dictionary
303311
CV_PROP_RW std::vector< int > ids;
312+
313+
/// coordinate of the bottom right corner of the board, is set when calling the function create()
314+
CV_PROP Point3f rightBottomBorder;
304315
};
305316

306317

@@ -400,6 +411,7 @@ class CV_EXPORTS_W GridBoard : public Board {
400411
* Input markers that are not included in the board layout are ignored.
401412
* The function returns the number of markers from the input employed for the board pose estimation.
402413
* Note that returning a 0 means the pose has not been estimated.
414+
* @sa use cv::drawFrameAxes to get world coordinate system axis for object points
403415
*/
404416
CV_EXPORTS_W int estimatePoseBoard(InputArrayOfArrays corners, InputArray ids, const Ptr<Board> &board,
405417
InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec,
@@ -464,36 +476,14 @@ CV_EXPORTS_W void refineDetectedMarkers(
464476
* Given an array of detected marker corners and its corresponding ids, this functions draws
465477
* the markers in the image. The marker borders are painted and the markers identifiers if provided.
466478
* Useful for debugging purposes.
479+
*
467480
*/
468481
CV_EXPORTS_W void drawDetectedMarkers(InputOutputArray image, InputArrayOfArrays corners,
469482
InputArray ids = noArray(),
470483
Scalar borderColor = Scalar(0, 255, 0));
471484

472485

473486

474-
/**
475-
* @brief Draw coordinate system axis from pose estimation
476-
*
477-
* @param image input/output image. It must have 1 or 3 channels. The number of channels is not
478-
* altered.
479-
* @param cameraMatrix input 3x3 floating-point camera matrix
480-
* \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$
481-
* @param distCoeffs vector of distortion coefficients
482-
* \f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\f$ of 4, 5, 8 or 12 elements
483-
* @param rvec rotation vector of the coordinate system that will be drawn. (@sa Rodrigues).
484-
* @param tvec translation vector of the coordinate system that will be drawn.
485-
* @param length length of the painted axis in the same unit than tvec (usually in meters)
486-
*
487-
* Given the pose estimation of a marker or board, this function draws the axis of the world
488-
* coordinate system, i.e. the system centered on the marker/board. Useful for debugging purposes.
489-
*
490-
* @deprecated use cv::drawFrameAxes
491-
*/
492-
CV_EXPORTS_W void drawAxis(InputOutputArray image, InputArray cameraMatrix, InputArray distCoeffs,
493-
InputArray rvec, InputArray tvec, float length);
494-
495-
496-
497487
/**
498488
* @brief Draw a canonical marker image
499489
*

modules/aruco/include/opencv2/aruco/charuco.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ CV_EXPORTS_W int interpolateCornersCharuco(InputArrayOfArrays markerCorners, Inp
181181
* This function estimates a Charuco board pose from some detected corners.
182182
* The function checks if the input corners are enough and valid to perform pose estimation.
183183
* If pose estimation is valid, returns true, else returns false.
184+
* @sa use cv::drawFrameAxes to get world coordinate system axis for object points
184185
*/
185186
CV_EXPORTS_W bool estimatePoseCharucoBoard(InputArray charucoCorners, InputArray charucoIds,
186187
const Ptr<CharucoBoard> &board, InputArray cameraMatrix,
@@ -275,6 +276,7 @@ CV_EXPORTS_W double calibrateCameraCharuco(
275276
* diamond.
276277
* @param cameraMatrix Optional camera calibration matrix.
277278
* @param distCoeffs Optional camera distortion coefficients.
279+
* @param dictionary dictionary of markers indicating the type of markers.
278280
*
279281
* This function detects Diamond markers from the previous detected ArUco markers. The diamonds
280282
* are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters
@@ -285,7 +287,8 @@ CV_EXPORTS_W void detectCharucoDiamond(InputArray image, InputArrayOfArrays mark
285287
InputArray markerIds, float squareMarkerLengthRate,
286288
OutputArrayOfArrays diamondCorners, OutputArray diamondIds,
287289
InputArray cameraMatrix = noArray(),
288-
InputArray distCoeffs = noArray());
290+
InputArray distCoeffs = noArray(),
291+
Ptr<Dictionary> dictionary = getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME(0)));
289292

290293

291294

modules/aruco/samples/calibrate_camera.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int main(int argc, char *argv[]) {
101101
if(parser.get<bool>("zt")) calibrationFlags |= CALIB_ZERO_TANGENT_DIST;
102102
if(parser.get<bool>("pc")) calibrationFlags |= CALIB_FIX_PRINCIPAL_POINT;
103103

104-
Ptr<aruco::DetectorParameters> detectorParams;
104+
Ptr<aruco::DetectorParameters> detectorParams = aruco::DetectorParameters::create();
105105
if(parser.has("dp")) {
106106
FileStorage fs(parser.get<string>("dp"), FileStorage::READ);
107107
bool readOk = aruco::DetectorParameters::readDetectorParameters(fs.root(), detectorParams);

modules/aruco/samples/calibrate_camera_charuco.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ int main(int argc, char *argv[]) {
102102
if(parser.get<bool>("zt")) calibrationFlags |= CALIB_ZERO_TANGENT_DIST;
103103
if(parser.get<bool>("pc")) calibrationFlags |= CALIB_FIX_PRINCIPAL_POINT;
104104

105-
Ptr<aruco::DetectorParameters> detectorParams;
105+
Ptr<aruco::DetectorParameters> detectorParams = aruco::DetectorParameters::create();
106106
if(parser.has("dp")) {
107107
FileStorage fs(parser.get<string>("dp"), FileStorage::READ);
108108
bool readOk = aruco::DetectorParameters::readDetectorParameters(fs.root(), detectorParams);

modules/aruco/samples/detect_board.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int main(int argc, char *argv[]) {
9797
}
9898
}
9999

100-
Ptr<aruco::DetectorParameters> detectorParams;
100+
Ptr<aruco::DetectorParameters> detectorParams = aruco::DetectorParameters::create();
101101
if(parser.has("dp")) {
102102
FileStorage fs(parser.get<string>("dp"), FileStorage::READ);
103103
bool readOk = aruco::DetectorParameters::readDetectorParameters(fs.root(), detectorParams);
@@ -199,7 +199,7 @@ int main(int argc, char *argv[]) {
199199
aruco::drawDetectedMarkers(imageCopy, rejected, noArray(), Scalar(100, 0, 255));
200200

201201
if(markersOfBoardDetected > 0)
202-
aruco::drawAxis(imageCopy, camMatrix, distCoeffs, rvec, tvec, axisLength);
202+
cv::drawFrameAxes(imageCopy, camMatrix, distCoeffs, rvec, tvec, axisLength);
203203

204204
imshow("out", imageCopy);
205205
char key = (char)waitKey(waitTime);

modules/aruco/samples/detect_board_charuco.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ int main(int argc, char *argv[]) {
9999
}
100100
}
101101

102-
Ptr<aruco::DetectorParameters> detectorParams;
102+
Ptr<aruco::DetectorParameters> detectorParams = aruco::DetectorParameters::create();
103103
if(parser.has("dp")) {
104104
FileStorage fs(parser.get<string>("dp"), FileStorage::READ);
105105
bool readOk = aruco::DetectorParameters::readDetectorParameters(fs.root(), detectorParams);
@@ -213,7 +213,7 @@ int main(int argc, char *argv[]) {
213213
}
214214

215215
if(validPose)
216-
aruco::drawAxis(imageCopy, camMatrix, distCoeffs, rvec, tvec, axisLength);
216+
cv::drawFrameAxes(imageCopy, camMatrix, distCoeffs, rvec, tvec, axisLength);
217217

218218
imshow("out", imageCopy);
219219
char key = (char)waitKey(waitTime);

modules/aruco/samples/detect_diamonds.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int main(int argc, char *argv[]) {
8787
bool autoScale = parser.has("as");
8888
float autoScaleFactor = autoScale ? parser.get<float>("as") : 1.f;
8989

90-
Ptr<aruco::DetectorParameters> detectorParams;
90+
Ptr<aruco::DetectorParameters> detectorParams = aruco::DetectorParameters::create();
9191
if(parser.has("dp")) {
9292
FileStorage fs(parser.get<string>("dp"), FileStorage::READ);
9393
bool readOk = aruco::DetectorParameters::readDetectorParameters(fs.root(), detectorParams);
@@ -219,8 +219,8 @@ int main(int argc, char *argv[]) {
219219

220220
if(estimatePose) {
221221
for(unsigned int i = 0; i < diamondIds.size(); i++)
222-
aruco::drawAxis(imageCopy, camMatrix, distCoeffs, rvecs[i], tvecs[i],
223-
squareLength * 0.5f);
222+
cv::drawFrameAxes(imageCopy, camMatrix, distCoeffs, rvecs[i], tvecs[i],
223+
squareLength * 1.1f);
224224
}
225225
}
226226

modules/aruco/samples/detect_markers.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) {
8080
bool estimatePose = parser.has("c");
8181
float markerLength = parser.get<float>("l");
8282

83-
Ptr<aruco::DetectorParameters> detectorParams;
83+
Ptr<aruco::DetectorParameters> detectorParams = aruco::DetectorParameters::create();
8484
if(parser.has("dp")) {
8585
FileStorage fs(parser.get<string>("dp"), FileStorage::READ);
8686
bool readOk = aruco::DetectorParameters::readDetectorParameters(fs.root(), detectorParams);
@@ -179,8 +179,7 @@ int main(int argc, char *argv[]) {
179179

180180
if(estimatePose) {
181181
for(unsigned int i = 0; i < ids.size(); i++)
182-
aruco::drawAxis(imageCopy, camMatrix, distCoeffs, rvecs[i], tvecs[i],
183-
markerLength * 0.5f);
182+
cv::drawFrameAxes(imageCopy, camMatrix, distCoeffs, rvecs[i], tvecs[i], markerLength * 1.5f, 2);
184183
}
185184
}
186185

modules/aruco/samples/tutorial_charuco_create_detect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static inline void detectCharucoBoardWithCalibrationPose()
7272
//! [pose]
7373
// if charuco pose is valid
7474
if (valid)
75-
cv::aruco::drawAxis(imageCopy, cameraMatrix, distCoeffs, rvec, tvec, 0.1f);
75+
cv::drawFrameAxes(imageCopy, cameraMatrix, distCoeffs, rvec, tvec, 0.1f);
7676
}
7777
}
7878
cv::imshow("out", imageCopy);

modules/aruco/src/aruco.cpp

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,11 @@ static void _getSingleMarkerObjectPoints(float markerLength, OutputArray _objPoi
811811

812812
_objPoints.create(4, 1, CV_32FC3);
813813
Mat objPoints = _objPoints.getMat();
814-
// set coordinate system in the middle of the marker, with Z pointing out
815-
objPoints.ptr< Vec3f >(0)[0] = Vec3f(-markerLength / 2.f, markerLength / 2.f, 0);
816-
objPoints.ptr< Vec3f >(0)[1] = Vec3f(markerLength / 2.f, markerLength / 2.f, 0);
817-
objPoints.ptr< Vec3f >(0)[2] = Vec3f(markerLength / 2.f, -markerLength / 2.f, 0);
818-
objPoints.ptr< Vec3f >(0)[3] = Vec3f(-markerLength / 2.f, -markerLength / 2.f, 0);
814+
// set coordinate system in the top-left corner of the marker, with Z pointing out
815+
objPoints.ptr< Vec3f >(0)[0] = Vec3f(0.f, 0.f, 0);
816+
objPoints.ptr< Vec3f >(0)[1] = Vec3f(markerLength, 0.f, 0);
817+
objPoints.ptr< Vec3f >(0)[2] = Vec3f(markerLength, markerLength, 0);
818+
objPoints.ptr< Vec3f >(0)[3] = Vec3f(0.f, markerLength, 0);
819819
}
820820

821821

@@ -1635,6 +1635,7 @@ Ptr<Board> Board::create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &di
16351635
CV_Assert(objPoints.type() == CV_32FC3 || objPoints.type() == CV_32FC1);
16361636

16371637
std::vector< std::vector< Point3f > > obj_points_vector;
1638+
Point3f rightBottomBorder = Point3f(0.f, 0.f, 0.f);
16381639
for (unsigned int i = 0; i < objPoints.total(); i++) {
16391640
std::vector<Point3f> corners;
16401641
Mat corners_mat = objPoints.getMat(i);
@@ -1644,7 +1645,11 @@ Ptr<Board> Board::create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &di
16441645
CV_Assert(corners_mat.total() == 4);
16451646

16461647
for (int j = 0; j < 4; j++) {
1647-
corners.push_back(corners_mat.at<Point3f>(j));
1648+
const Point3f& corner = corners_mat.at<Point3f>(j);
1649+
corners.push_back(corner);
1650+
rightBottomBorder.x = std::max(rightBottomBorder.x, corner.x);
1651+
rightBottomBorder.y = std::max(rightBottomBorder.y, corner.y);
1652+
rightBottomBorder.z = std::max(rightBottomBorder.z, corner.z);
16481653
}
16491654
obj_points_vector.push_back(corners);
16501655
}
@@ -1653,6 +1658,7 @@ Ptr<Board> Board::create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &di
16531658
ids.copyTo(res->ids);
16541659
res->objPoints = obj_points_vector;
16551660
res->dictionary = cv::makePtr<Dictionary>(dictionary);
1661+
res->rightBottomBorder = rightBottomBorder;
16561662
return res;
16571663
}
16581664

@@ -1688,20 +1694,19 @@ Ptr<GridBoard> GridBoard::create(int markersX, int markersY, float markerLength,
16881694
}
16891695

16901696
// calculate Board objPoints
1691-
float maxY = (float)markersY * markerLength + (markersY - 1) * markerSeparation;
16921697
for(int y = 0; y < markersY; y++) {
16931698
for(int x = 0; x < markersX; x++) {
1694-
vector< Point3f > corners;
1695-
corners.resize(4);
1699+
vector<Point3f> corners(4);
16961700
corners[0] = Point3f(x * (markerLength + markerSeparation),
1697-
maxY - y * (markerLength + markerSeparation), 0);
1701+
y * (markerLength + markerSeparation), 0);
16981702
corners[1] = corners[0] + Point3f(markerLength, 0, 0);
1699-
corners[2] = corners[0] + Point3f(markerLength, -markerLength, 0);
1700-
corners[3] = corners[0] + Point3f(0, -markerLength, 0);
1703+
corners[2] = corners[0] + Point3f(markerLength, markerLength, 0);
1704+
corners[3] = corners[0] + Point3f(0, markerLength, 0);
17011705
res->objPoints.push_back(corners);
17021706
}
17031707
}
1704-
1708+
res->rightBottomBorder = Point3f(markersX * markerLength + markerSeparation * (markersX - 1),
1709+
markersY * markerLength + markerSeparation * (markersY - 1), 0.f);
17051710
return res;
17061711
}
17071712

@@ -1753,15 +1758,6 @@ void drawDetectedMarkers(InputOutputArray _image, InputArrayOfArrays _corners,
17531758
}
17541759

17551760

1756-
1757-
/**
1758-
*/
1759-
void drawAxis(InputOutputArray _image, InputArray _cameraMatrix, InputArray _distCoeffs, InputArray _rvec,
1760-
InputArray _tvec, float length)
1761-
{
1762-
drawFrameAxes(_image, _cameraMatrix, _distCoeffs, _rvec, _tvec, length, 3);
1763-
}
1764-
17651761
/**
17661762
*/
17671763
void drawMarker(const Ptr<Dictionary> &dictionary, int id, int sidePixels, OutputArray _img, int borderBits) {
@@ -1826,7 +1822,7 @@ void _drawPlanarBoardImpl(Board *_board, Size outSize, OutputArray _img, int mar
18261822
// move top left to 0, 0
18271823
pf -= Point2f(minX, minY);
18281824
pf.x = pf.x / sizeX * float(out.cols);
1829-
pf.y = (1.0f - pf.y / sizeY) * float(out.rows);
1825+
pf.y = pf.y / sizeY * float(out.rows);
18301826
outCorners[j] = pf;
18311827
}
18321828

modules/aruco/src/charuco.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ the use of this software, even if advised of the possibility of such damage.
4141
#include <opencv2/core.hpp>
4242
#include <opencv2/imgproc.hpp>
4343

44-
4544
namespace cv {
4645
namespace aruco {
4746

@@ -106,7 +105,7 @@ void CharucoBoard::draw(Size outSize, OutputArray _img, int marginSize, int bord
106105

107106
double startX, startY;
108107
startX = squareSizePixels * double(x);
109-
startY = double(chessboardZoneImg.rows) - squareSizePixels * double(y + 1);
108+
startY = squareSizePixels * double(y);
110109

111110
Mat squareZone = chessboardZoneImg.rowRange(int(startY), int(startY + squareSizePixels))
112111
.colRange(int(startX), int(startX + squareSizePixels));
@@ -135,18 +134,17 @@ Ptr<CharucoBoard> CharucoBoard::create(int squaresX, int squaresY, float squareL
135134
float diffSquareMarkerLength = (squareLength - markerLength) / 2;
136135

137136
// calculate Board objPoints
138-
for(int y = squaresY - 1; y >= 0; y--) {
137+
for(int y = 0; y < squaresY; y++) {
139138
for(int x = 0; x < squaresX; x++) {
140139

141140
if(y % 2 == x % 2) continue; // black corner, no marker here
142141

143-
vector< Point3f > corners;
144-
corners.resize(4);
142+
vector<Point3f> corners(4);
145143
corners[0] = Point3f(x * squareLength + diffSquareMarkerLength,
146-
y * squareLength + diffSquareMarkerLength + markerLength, 0);
144+
y * squareLength + diffSquareMarkerLength, 0);
147145
corners[1] = corners[0] + Point3f(markerLength, 0, 0);
148-
corners[2] = corners[0] + Point3f(markerLength, -markerLength, 0);
149-
corners[3] = corners[0] + Point3f(0, -markerLength, 0);
146+
corners[2] = corners[0] + Point3f(markerLength, markerLength, 0);
147+
corners[3] = corners[0] + Point3f(0, markerLength, 0);
150148
res->objPoints.push_back(corners);
151149
// first ids in dictionary
152150
int nextId = (int)res->ids.size();
@@ -164,7 +162,8 @@ Ptr<CharucoBoard> CharucoBoard::create(int squaresX, int squaresY, float squareL
164162
res->chessboardCorners.push_back(corner);
165163
}
166164
}
167-
165+
res->rightBottomBorder = Point3f(squaresX * squareLength,
166+
squaresY * squareLength, 0.f);
168167
res->_getNearestMarkerCorners();
169168

170169
return res;
@@ -743,15 +742,14 @@ double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfAr
743742
void detectCharucoDiamond(InputArray _image, InputArrayOfArrays _markerCorners,
744743
InputArray _markerIds, float squareMarkerLengthRate,
745744
OutputArrayOfArrays _diamondCorners, OutputArray _diamondIds,
746-
InputArray _cameraMatrix, InputArray _distCoeffs) {
745+
InputArray _cameraMatrix, InputArray _distCoeffs, Ptr<Dictionary> dictionary) {
747746

748747
CV_Assert(_markerIds.total() > 0 && _markerIds.total() == _markerCorners.total());
749748

750749
const float minRepDistanceRate = 1.302455f;
751750

752751
// create Charuco board layout for diamond (3x3 layout)
753-
Ptr<Dictionary> dict = getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME(0));
754-
Ptr<CharucoBoard> _charucoDiamondLayout = CharucoBoard::create(3, 3, squareMarkerLengthRate, 1., dict);
752+
Ptr<CharucoBoard> _charucoDiamondLayout = CharucoBoard::create(3, 3, squareMarkerLengthRate, 1., dictionary);
755753

756754

757755
vector< vector< Point2f > > diamondCorners;
@@ -843,10 +841,10 @@ void detectCharucoDiamond(InputArray _image, InputArrayOfArrays _markerCorners,
843841
// reorder corners
844842
vector< Point2f > currentMarkerCornersReorder;
845843
currentMarkerCornersReorder.resize(4);
846-
currentMarkerCornersReorder[0] = currentMarkerCorners[2];
847-
currentMarkerCornersReorder[1] = currentMarkerCorners[3];
848-
currentMarkerCornersReorder[2] = currentMarkerCorners[1];
849-
currentMarkerCornersReorder[3] = currentMarkerCorners[0];
844+
currentMarkerCornersReorder[0] = currentMarkerCorners[0];
845+
currentMarkerCornersReorder[1] = currentMarkerCorners[1];
846+
currentMarkerCornersReorder[2] = currentMarkerCorners[3];
847+
currentMarkerCornersReorder[3] = currentMarkerCorners[2];
850848

851849
diamondCorners.push_back(currentMarkerCornersReorder);
852850
diamondIds.push_back(markerId);

0 commit comments

Comments
 (0)