How to reverse image rectification

Viewed 182

I have taken a pair of calibrated cameras (rotation,translation,intrinsic camera matrix,distortion). Then I have used the opencv stereoRectify function (https://docs.opencv.org/3.4/d9/d0c/group__calib3d.html#ga617b1685d4059c6040827800e72ad2b6) to compute the rectification parameters followed by initUndistortRectifyMap (https://docs.opencv.org/3.4/da/d54/group__imgproc__transform.html#ga7dfb72c9cf9780a347fbe3d1c47e5d5a) and remap (https://docs.opencv.org/3.4/da/d54/group__imgproc__transform.html#gab75ef31ce5cdfb5c44b6da5f3b908ea4) functions to create the rectified images. Using cv::StereoSGB gives me the disparity map and from this, I have computed my depth map - all appears to work well and the depth map looks good to me.

The problem I have is that the depth map is in the image coordinates of the rectified camera and not my original camera, I would like to remap my rectified depth map back to the original coordinates (including distortion). There doesn't seem to be a function within opencv that does this, could someone advise on how I could achieve this?

Thanks in advance

0 Answers
Related