Commit ca7953ad authored by Alexander Alekhin's avatar Alexander Alekhin Committed by GitHub

Merge pull request #969 from paroj:boardguess

aruco: let solvePnP allocate rvec and tvec
parents 933f53e4 619e197c
......@@ -1250,13 +1250,6 @@ int estimatePoseBoard(InputArrayOfArrays _corners, InputArray _ids, const Ptr<Bo
if(objPoints.total() == 0) // 0 of the detected markers in board
return 0;
if (_rvec.empty() || _tvec.empty())
{
_rvec.create(3, 1, CV_64FC1);
_tvec.create(3, 1, CV_64FC1);
useExtrinsicGuess = false;
}
solvePnP(objPoints, imgPoints, _cameraMatrix, _distCoeffs, _rvec, _tvec, useExtrinsicGuess);
// divide by four since all the four corners are concatenated in the array for each marker
......
......@@ -674,13 +674,6 @@ bool estimatePoseCharucoBoard(InputArray _charucoCorners, InputArray _charucoIds
// points need to be in different lines, check if detected points are enough
if(!_arePointsEnoughForPoseEstimation(objPoints)) return false;
if (_rvec.empty() || _tvec.empty())
{
_rvec.create(3, 1, CV_64FC1);
_tvec.create(3, 1, CV_64FC1);
useExtrinsicGuess = false;
}
solvePnP(objPoints, _charucoCorners, _cameraMatrix, _distCoeffs, _rvec, _tvec, useExtrinsicGuess);
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment