aruco: let solvePnP allocate rvec and tvec

pull/969/head
Pavel Rojtberg 8 years ago
parent 2a0cad7714
commit 619e197c34
  1. 7
      modules/aruco/src/aruco.cpp
  2. 7
      modules/aruco/src/charuco.cpp

@ -1250,13 +1250,6 @@ int estimatePoseBoard(InputArrayOfArrays _corners, InputArray _ids, const Ptr<Bo
if(objPoints.total() == 0) // 0 of the detected markers in board if(objPoints.total() == 0) // 0 of the detected markers in board
return 0; 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); solvePnP(objPoints, imgPoints, _cameraMatrix, _distCoeffs, _rvec, _tvec, useExtrinsicGuess);
// divide by four since all the four corners are concatenated in the array for each marker // 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 // points need to be in different lines, check if detected points are enough
if(!_arePointsEnoughForPoseEstimation(objPoints)) return false; 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); solvePnP(objPoints, _charucoCorners, _cameraMatrix, _distCoeffs, _rvec, _tvec, useExtrinsicGuess);
return true; return true;

Loading…
Cancel
Save