Ask Your Question

Revision history [back]

Thin prism model openCV3.1 problem

Hello everyone. I'm struggling with the newest version of OpenCV (3.1) and calibratecamera function with CALIB_THIN_PRISM_MODEL. After update from 3.0 I get ASSERTION ERROR (in C++) or cv2.errror (in python):

cv2.error: C:\builds\master_PackSlaveAddon-win32-vc12-static\opencv\modules\calib3d\src\calibration.cpp:1321:error: (-5) Thin prism model must have 12 parameters in the distortion matrix in function cvCalibrateCamera2

In the previous version everything was working good. Normally, I'm using C++ but I've made simple python script based on official camera calibration tutorial from doc. Here is my code snippet:

ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], None,None,flags=cv2.CALIB_FIX_PRINCIPAL_POINT+cv2.CALIB_THIN_PRISM_MODEL)

I have tried declaring explicitly camera_matrix and dist_coeffs or setting different flags with no effect. Others calibration models (rational or simple) works good.

Does anyone have a similar issue? It quie looks for me like opencv bug...

Best Regards Michal