Opencv 3.0 Assertion failed in undistort.cpp
Hi! After roslaunch monocular_pose_estimator demo.launch git
OpenCV Error: Assertion failed (CV_IS_MAT(_cameraMatrix) && _cameraMatrix->rows == 3 && _cameraMatrix->cols == 3) in cvUndistortPoints, file /home/tuuzdu/tmp/opencv-3.0.0/modules/imgproc/src/undistort.cpp, line 288
terminate called after throwing an instance of 'cv::Exception'
what(): /home/tuuzdu/tmp/opencv-3.0.0/modules/imgproc/src/undistort.cpp:288: error: (-215) CV_IS_MAT(_cameraMatrix) && _cameraMatrix->rows == 3 && _cameraMatrix->cols == 3 in function cvUndistortPoints
_cameraMatrix
calls like trackable_object_.camera_matrix_K_ = cv::Mat(3, 3, CV_64F);
I rewrite undistort.cpp with CV_Assert( CV_IS_MAT(_cameraMatrix) );
and with CV_Assert( _cameraMatrix->rows == 3 && _cameraMatrix->cols == 3 );
I got "Assertion failed" only with CV_IS_MAT(_cameraMatrix)
What is mean CV_IS_MAT
?
here's CV_IS_MAT . as you can see, it is checking for a
CvMat*
(c-api) not for a cv::Mat (c++ api)again, if you're using cvUndistortPoints , you will have to use
CvMat*
, andcv::Mat
for the c++ undistortPointsThanks for comment! But I use cv::undistortPoints... Why is it may occur?