@@ -887,18 +887,13 @@ void estimatePoseSingleMarkers(InputArrayOfArrays _corners, float markerLength,
887
887
888
888
889
889
890
- /* *
891
- * @brief Given a board configuration and a set of detected markers, returns the corresponding
892
- * image points and object points to call solvePnP
893
- */
894
- static void _getBoardObjectAndImagePoints (const Ptr<Board> &_board, InputArray _detectedIds,
895
- InputArrayOfArrays _detectedCorners,
896
- OutputArray _imgPoints, OutputArray _objPoints) {
890
+ void getBoardObjectAndImagePoints (const Ptr<Board> &board, InputArrayOfArrays detectedCorners,
891
+ InputArray detectedIds, OutputArray objPoints, OutputArray imgPoints) {
897
892
898
- CV_Assert (_board ->ids .size () == _board ->objPoints .size ());
899
- CV_Assert (_detectedIds .total () == _detectedCorners .total ());
893
+ CV_Assert (board ->ids .size () == board ->objPoints .size ());
894
+ CV_Assert (detectedIds .total () == detectedCorners .total ());
900
895
901
- size_t nDetectedMarkers = _detectedIds .total ();
896
+ size_t nDetectedMarkers = detectedIds .total ();
902
897
903
898
vector< Point3f > objPnts;
904
899
objPnts.reserve (nDetectedMarkers);
@@ -908,20 +903,20 @@ static void _getBoardObjectAndImagePoints(const Ptr<Board> &_board, InputArray _
908
903
909
904
// look for detected markers that belong to the board and get their information
910
905
for (unsigned int i = 0 ; i < nDetectedMarkers; i++) {
911
- int currentId = _detectedIds .getMat ().ptr < int >(0 )[i];
912
- for (unsigned int j = 0 ; j < _board ->ids .size (); j++) {
913
- if (currentId == _board ->ids [j]) {
906
+ int currentId = detectedIds .getMat ().ptr < int >(0 )[i];
907
+ for (unsigned int j = 0 ; j < board ->ids .size (); j++) {
908
+ if (currentId == board ->ids [j]) {
914
909
for (int p = 0 ; p < 4 ; p++) {
915
- objPnts.push_back (_board ->objPoints [j][p]);
916
- imgPnts.push_back (_detectedCorners .getMat (i).ptr < Point2f >(0 )[p]);
910
+ objPnts.push_back (board ->objPoints [j][p]);
911
+ imgPnts.push_back (detectedCorners .getMat (i).ptr < Point2f >(0 )[p]);
917
912
}
918
913
}
919
914
}
920
915
}
921
916
922
917
// create output
923
- Mat (objPnts).copyTo (_objPoints );
924
- Mat (imgPnts).copyTo (_imgPoints );
918
+ Mat (objPnts).copyTo (objPoints );
919
+ Mat (imgPnts).copyTo (imgPoints );
925
920
}
926
921
927
922
@@ -1243,7 +1238,7 @@ int estimatePoseBoard(InputArrayOfArrays _corners, InputArray _ids, const Ptr<Bo
1243
1238
1244
1239
// get object and image points for the solvePnP function
1245
1240
Mat objPoints, imgPoints;
1246
- _getBoardObjectAndImagePoints (board, _ids, _corners, imgPoints , objPoints);
1241
+ getBoardObjectAndImagePoints (board, _corners, _ids , objPoints, imgPoints );
1247
1242
1248
1243
CV_Assert (imgPoints.total () == objPoints.total ());
1249
1244
@@ -1544,8 +1539,8 @@ double calibrateCameraAruco(InputArrayOfArrays _corners, InputArray _ids, InputA
1544
1539
}
1545
1540
markerCounter += nMarkersInThisFrame;
1546
1541
Mat currentImgPoints, currentObjPoints;
1547
- _getBoardObjectAndImagePoints (board, thisFrameIds, thisFrameCorners, currentImgPoints ,
1548
- currentObjPoints );
1542
+ getBoardObjectAndImagePoints (board, thisFrameCorners, thisFrameIds, currentObjPoints ,
1543
+ currentImgPoints );
1549
1544
if (currentImgPoints.total () > 0 && currentObjPoints.total () > 0 ) {
1550
1545
processedImagePoints.push_back (currentImgPoints);
1551
1546
processedObjectPoints.push_back (currentObjPoints);
0 commit comments