I'm making multicamera-stereo calibration program.
My idea is to rectify each pair of cameras separately.
For example: for given 3 cameras I compute undistortion and rectification maps (using stereoRectify()
and initUndistortRectifyMap()
) separately for {camera[1] and camera[2]}, {camera[2] and camera[3]} and {camera[1] and camera[3]}.
Using remap()
, I can transform any original image (from, lets say, camera[1]) to one of two different rectified images: rectified[1][2] and rectified[1][3].
Now, also using remap()
, for any point from that original image, I can compute its new coordinates separately in rectified[1][2] and rectified[1][3] images.
It works well, but now I need to compute these coordinates in opposite direction: for any point from any of rectified images I need to find its original coordinates in its original image.
How can I do this?