Re-project 3D points to 2D, using two stereo-calibrated cameras

asked 2019-10-22 16:18:00 -0600

Hello, I am using two stereo-calibrated cameras to separately track body parts in 2D, and I then triangulate the points from each camera view into 3D. Now I want to re-project the tracked points back onto each camera view, and I'm not sure which parameters from the stereo-calibration/rectification I should feed into cv2.projectPoints().

  1. After finding chessboard corners, I calibrate each camera using cv2.calibrateCamera() to get intrinsic params - camera matrix and distortion vector. This step works fine with ~0.01 pix re-projection error.
  2. I then use cv2.stereoCalibrate(..., flags = cv2.CALIB_FIX_INTRINSIC) to also get R,T,E,F matrices.
  3. I feed the previously obtained params intocv2.stereoRectify()to obtain R1, R2, P1, P2, Q.
  4. After performing tracking and obtaining x1,x2, a tracked point in 2D from camera 1 and camera 2 respectively, I obtain the 3D point X = cv2.triangulatePoints( P1[:3], P2[:3], x1, x2 ).

In other words, given the stereo-rectificaiton parameters, how do I invert the triangulation operation for each camera?

edit retag flag offensive close merge delete