cvCalibrateCamera2 assertion

asked 2017-03-06 05:13:41 -0600


after using OpenCV 2.4.4 for long time now i decides to take the step to upgrade to OpenCV 3.2.0 but i have some troubles bringing the distortion correction back to work.

The cvCalibrateCamera2 function tries to convert the points to homogeneous coordinates but always runs into an assertion in convertPointsHomogeneous: CV_Assert( _dst.fixedType() );

As the assertion handles a Mat that is defined in cvCalibrateCamera2 it seems like this is an internal error of OpenCV.

OpenCV Error: Assertion failed (_dst.fixedType()) in cv::convertPointsHomogeneous, file D:\Repositories\OpenCV\modules\calib3d\src\fundam.cpp, line 1029

edit retag flag offensive close merge delete


can you show the code you're using ?

(and let's hope, you're not using those deprecated c-api functions directly..)

berak gravatar imageberak ( 2017-03-06 05:27:14 -0600 )edit

I do use the old c-api, as it would be a lot of work to change it.

bazz-dee gravatar imagebazz-dee ( 2017-03-06 05:34:20 -0600 )edit

then, do that work, now. (as noone will fix bugs related to that, ever)

or , rather throw it away entirely, and start with more recent code

berak gravatar imageberak ( 2017-03-06 05:37:55 -0600 )edit

Hello , I am using Open CV 3.3.0 with visual studio 2012.

Even am also facing the same issue, getting OpenCV Error: Assertion failed (_dst.fixedType()) in cv::convertPointsHomogeneous. Please could u suggest me possible solution !!

Thanks in Advance.

Ajay@velab gravatar imageAjay@velab ( 2017-10-10 01:35:08 -0600 )edit

I am running into the same error. I am using the function as : cvCalibrateCamera2(object_points2,image_points2,point_counts‌​2,cvGetSize( image), intrinsic_matrix, distortion_coeffs, rot_vects, trans_vects,0,cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EP‌​S,30,DBL_EPSILON) );

I run into:

       ~/opencv/modules/calib3d/src/fundam.cpp, line 1029 terminate called after throwing an instance of 'cv::Exception'

     what(): ~/opencv/modules/calib3d/src/fundam.cpp:1029: error: (-215) _dst.fixedType() in function convertPointsHomogeneous

 Aborted (core dumped)

Any thoughts/ solutions?

archr gravatar imagearchr ( 2017-12-01 15:25:34 -0600 )edit