Align cameras facing each other using calibration parameters obtained from cv2.calibratecamera

36 views Asked by At

I have setup as shown in the simplified diagram, where two cameras are facing each other and are 180 degree apart. I have horizontally flipped the image of camera 2. I calibrate both camera simultaneously using chessboard pattern (size=7,7) and extract camera matrix, distortion coefficients, rvecs and tvecs. I imaged the same chessboard pattern simultaneously to ensure that both cameras have identical features for calibration. However, there is a slight misalignment between the two cameras in terms of rotation and translation. I want to correct for this misalignment using the previously obtained calibration parameters. I would like to know how to utilize these calibration parameters to align and undistort the images captured from this camera setup. Although I can calculate the relative rotation angles between the cameras from rvecs, it may not be accurate as each rvec is obtained at a particular position of the calibration target, which might slightly differ from the actual image position. Since the calibration target positions may not coincide with the actual region of interest in the image plane, I am wondering if there is a way to correct for this misalignment.

ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, calib_image_0.shape[::-1], None, None)

enter image description here

image from camera1: camera1

image from camera2: camera2

0

There are 0 answers