How do I forward map a point in OpenCV using mapx & mapy?

Posted by Charles on Stack Overflow See other posts from Stack Overflow or by Charles
Published on 2012-05-31T16:36:39Z Indexed on 2012/05/31 16:40 UTC
Read the original article Hit count: 257

Filed under:

Ultimately, I'm trying to determine the 3D location of a point I've identified in two cameras (using OpenCV 2.3.1, Windows 7, C++). I'm having trouble locating the 2D point for each camera from its mapx & mapy. I could not find in Bradski & Kaehler's OpenCV book how to do it.

PROCESS

  1. calibrateCamera for each of the pair

  2. stereoCalibrate

  3. stereoRectify

  4. detect the blob I want to locate in 3D on each camera in 2D

  5. initUndistortRectifyMap for each camera

  6. Eventually, perspectiveTransform

PROBLEM with 5:

I have the x and y location of the point in the distorted and unrectified image for each camera(from #4) but I don't know how to get the undistorted and rectified x and y for each camera from the two maps initUndistortRectifyMap creates for each camera. I don't want to remap the whole image since I only want to learn the 3D location of one object for each frame.

QUESTION:

How do I forward map a point (get the undistorted and rectified x and y) with its two maps?

Thanks for any help.

© Stack Overflow or respective owner

Related posts about opencv