Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Return both solutions from solvePnp cv::SOLVEPNP_IPPE_SQUARE?

I have a PnP function that uses solvePnP with the cv::SOLVEPNP_IPPE_SQUARE type.

This should return multiple solutions, as I understand it, but passing a std::vector<cv::Vec3d> rvecs into the rvec output crashes my application.

How can I return all possible solutions from this function?

thanks.

Return both solutions from solvePnp cv::SOLVEPNP_IPPE_SQUARE?

I have a PnP function that uses solvePnP with the cv::SOLVEPNP_IPPE_SQUARE type.

 std::vector<cv::Mat> rvecsVec, tvecsVec;
solvePnP(markerObjPoints, marker.corners2d, K, D, rvecsVec, tvecsVec, false, cv::SOLVEPNP_IPPE_SQUARE);

This should return multiple solutions, as I understand it, but passing a std::vector<cv::Vec3d> rvecsrvecsVec into the rvec output as above crashes my application.

OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.1.1-dev) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in cv::_InputArray::type, file d:\thirdparty\opencv_4.0\opencv_4.1\opencv-master\modules\core\src\matrix_wrap.cpp, line 801

How can I return all possible solutions from this function?

thanks.