Not only do I want a camera's intrinsic matrix, but I want its translation and rotation vectors with respect to a pattern that I cannot move the camera with respect to -- both camera and pattern are effectively fixed. Since the documentation for calibrateCamera suggests that different patterns can be used in a single calibration, my idea is to calibrate the camera on a set of standard checkerboard object/image point pairs concatenated with the object/image point pairs of my immovable pattern, which should yield the vectors I seek. In Python, where the object and image point sets are lists of numpy arrays -- one array for each image -- I should simply be able to append my immovable pattern's object and image points to the lists for the checkboard. However, this causes an error in line 3415 of calibration.cpp for the assertion nimages > 0.
If objpoints (shape (16, 35, 3))and imgpoints (shape (16, 35, 2)) are lists of numpy arrays containing checkerboard points, and objp_ceil (shape (9, 3)) and imgp_ceil (shape (9,2)) are numpy arrays containing my immovable object points, I simply do this: ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints.append(objp_ceil), imgpoints.append(imgp_ceil), gray.shape[::-1], None, None)
and receive this error: error: /Users/jhelmus/anaconda/conda-bld/work/opencv-2.4.8/modules/calib3d/src/calibration.cpp:3415: error: (-215) nimages > 0 in function calibrateCamera
I'm using OpenCV 2.4.8 for Python. I appreciate any thoughts.