Project 2d points in camera 1 image to camera 2 image after a stereo calibration

Viewed 3029

I am doing stereo calibration of two cameras (let's name them L and R) with opencv. I use 20 pairs of checkerboard images and compute the transformation of R with respect to L. What I want to do is use a new pair of images, compute the 2d checkerboard corners in image L, transform those points according to my calibration and draw the corresponding transformed points on image R with the hope that they will match the corners of the checkerboard in that image.

I tried the naive way of transforming the 2d points from [x,y] to [x,y,1], multiply by the 3x3 rotation matrix, add the rotation vector and then divide by z, but the result is wrong, so I guess it's not that simple (?)

Edit (to clarify some things):

The reason I want to do this is basically because I want to validate the stereo calibration on a new pair of images. So, I don't actually want to get a new 2d transformation between the two images, I want to check if the 3d transformation I have found is correct.

This is my setup:

setup

I have the rotation and translation relating the two cameras (E), but I don't have rotations and translations of the object in relation to each camera (E_R, E_L).

Ideally what I would like to do:

  1. Choose the 2d corners in image from camera L (in pixels e.g. [100,200] etc).
  2. Do some kind of transformation on the 2d points based on matrix E that I have found.
  3. Get the corresponding 2d points in image from camera R, draw them, and hopefully they match the actual corners!

The more I think about it though, the more I am convinced that this is wrong/can't be done.

What I am probably trying now:

  1. Using the intrinsic parameters of the cameras (let's say I_R and I_L), solve 2 least squares systems to find E_R and E_L
  2. Choose 2d corners in image from camera L.
  3. Project those corners to their corresponding 3d points (3d_points_L).
  4. Do: 3d_points_R = (E_L).inverse * E * E_R * 3d_points_L
  5. Get the 2d_points_R from 3d_points_R and draw them.

I will update when I have something new

1 Answers
Related