Opencv 3.0 Assertion failed in undistort.cpp

asked 2015-07-31 12:04:59 -0500

tuuzdu gravatar image

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?

edit retag flag offensive close merge delete

Comments

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* , and cv::Mat for the c++ undistortPoints

berak gravatar imageberak ( 2015-08-01 02:05:55 -0500 )edit

Thanks for comment! But I use cv::undistortPoints... Why is it may occur?

tuuzdu gravatar imagetuuzdu ( 2015-08-01 11:14:25 -0500 )edit