Re-project 3D points to 2D, using two stereo-calibrated cameras
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()
.
- 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. - I then use
cv2.stereoCalibrate(..., flags = cv2.CALIB_FIX_INTRINSIC)
to also getR,T,E,F
matrices. - I feed the previously obtained params into
cv2.stereoRectify()
to obtainR1, R2, P1, P2, Q
. - After performing tracking and obtaining
x1,x2
, a tracked point in 2D from camera 1 and camera 2 respectively, I obtain the 3D pointX = 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?