Skip to content

Commit ca7953a

Browse files
authored
Merge pull request #969 from paroj:boardguess
aruco: let solvePnP allocate rvec and tvec
2 parents 933f53e + 619e197 commit ca7953a

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

modules/aruco/src/aruco.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,13 +1250,6 @@ int estimatePoseBoard(InputArrayOfArrays _corners, InputArray _ids, const Ptr<Bo
12501250
if(objPoints.total() == 0) // 0 of the detected markers in board
12511251
return 0;
12521252

1253-
if (_rvec.empty() || _tvec.empty())
1254-
{
1255-
_rvec.create(3, 1, CV_64FC1);
1256-
_tvec.create(3, 1, CV_64FC1);
1257-
useExtrinsicGuess = false;
1258-
}
1259-
12601253
solvePnP(objPoints, imgPoints, _cameraMatrix, _distCoeffs, _rvec, _tvec, useExtrinsicGuess);
12611254

12621255
// divide by four since all the four corners are concatenated in the array for each marker

modules/aruco/src/charuco.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -674,13 +674,6 @@ bool estimatePoseCharucoBoard(InputArray _charucoCorners, InputArray _charucoIds
674674
// points need to be in different lines, check if detected points are enough
675675
if(!_arePointsEnoughForPoseEstimation(objPoints)) return false;
676676

677-
if (_rvec.empty() || _tvec.empty())
678-
{
679-
_rvec.create(3, 1, CV_64FC1);
680-
_tvec.create(3, 1, CV_64FC1);
681-
useExtrinsicGuess = false;
682-
}
683-
684677
solvePnP(objPoints, _charucoCorners, _cameraMatrix, _distCoeffs, _rvec, _tvec, useExtrinsicGuess);
685678

686679
return true;

0 commit comments

Comments
 (0)