I'm using openCV 2.4.10 and want to calibrate a camera. if I use cv2.calibrateCamera with flag=0 everything is fine. the named error occur if I try to set some flags and provide initial cameraMatrix and distCoeffs as input. below you find part of my code.
# create initial cameraMatrix and distCoeffs
cameraMatrix = np.zeros((3,3), dtype=np.float32)
cameraMatrix[0,0] = 1.0
distCoeffs = np.zeros((8,1), np.float32)
flag = 0
flag = flag | cv2.CALIB_USE_INTRINSIC_GUESS
# Find intrinsic and extrinsic camera parameters
# next line works fine
#rms, cameraMatrix, distCoeffs, rvecs, tvecs = cv2.calibrateCamera(obj_points, img_points, (w,h), 0)
# the following line throw the error
rms,camera_matrix,dist_coefs,rvecs,tvecs = cv2.calibrateCamera(obj_points, img_points, (w, h),cameraMatrix, distCoeffs, flag)
I used different versions for creating cameraMatrix and distCoeffs and also tried various flag settings all without success. I hope anybody has an idea where or what my error is. I would be glad for all help, because I'm stuck on this along time.
Greetings Maori
rvecs, tvecs
beforeflags
– lanpa