0

I've calibrated a pair of cameras, I have a loop where markings on a person's legs are being tracked and their positions saved. What now?

Do I have to cv::undistort the images before saving the pixel coordinates? Is there anything else that has to be done before I try to convert these pairs of 2D coordinates to 3D (I don't know how, but that's for later)?

Petersaber
  • 851
  • 1
  • 12
  • 29

1 Answers1

1

Yes, you need to remove lens distortion before doing triangulation. If you are going to apply cv::undistort on the whole images though, you have to apply it prior to detecting/tracking the points of interest.

If you are not going to compute disparity image and you are only interested in few points, it is more efficient to detect/track the points of interest on the raw image and then apply cv::undistortPoints on these selected points.

After you remove distortion from the points, you can compose the projection matrices for the two cameras and carry out triangulation.

Sammy
  • 356
  • 2
  • 7
  • All I need are singular points in space, so I'll try undistort points. Besides that, i should use cv::stereoRectify to get P matrices and just go straight for cv::triangulatePoints? – Petersaber Aug 14 '15 at 14:48
  • 1
    You don't really need to compute rectification transforms (using stereoRectify) unless you want to align epipolar lines and/or do stereo matching. You can just compose the projection matrices from calibration result as (P0 = K [ I | 0 ], P1 = K [ R | T ] ) where K, R, & T are intrinsic camera, rotation and translation matrices respectively. – Sammy Aug 14 '15 at 18:16
  • ok, great. Thanks for your quick help. But what is " I " ? Identity matrix? – Petersaber Aug 14 '15 at 19:27
  • 1
    Yes, I is identity matrix. – Sammy Aug 14 '15 at 19:35