How to find the 3D point for 2 images

1.5k views Asked by At

I have two corresponding points (x1,y1) in left image and (x2,y2) in right image. The distance between two cameras is 10 meters. I want to know how do I find the 3D point in the right camera's coordinates? I have following data:

R=[ 1 0 0;
    0 0.9 -0.25;
    0 0.2 0.96]
t=[ 0.5; -10; 2.75];
Kleft= [-1000 0 511;
         0 -1000 383;
         0  0    1];
Kright=[-500 0 319;
         0 -500 119;
         0 0 1];
Essentail Matrix=[0   -5.2445   -8.9475;
                  2.7500   -0.1294   -0.4830;
                  10.0000    0.4830   -0.1294]
2

There are 2 answers

4
Vishu On

You can follow Dima's advice in case you are really looking forward to pursuing vision (Multi View Geometry, ain't no child's play :P). In case you are just looking for the solution of the question here it is,

First, calculate the coordinates of the two pixels in the metric coordinate system, this is done by multiplying the inverse of the corresponding K matrix to the homogeneous pixel coordinates,

X1_metric = (Kleft)^-1 * (x1, y1, 1)

X2_metric = (Kright)^-1 * (x2, y2, 1)

Now, calculate the skew matrix of the vector X2_metric, i.e., if X2_metric = [a,b,c] then,

skew(X2_metric) = [0 -c b ; c 0 -a ;-b a 0 ]

Now, find the scaling factor, lambda = (skew(X2_metric)*t)/(skew(X2_metric) * R * X1_metric)

We are almost done, the 3D coordinate of the point in the frame of left image is,

X1(3D) = (lambda * X1_metric)

To calculate the 3D coordinate in frame of right image, simply do the following transformation,

X2(3D) = (R*X1(3D)) + t

I hope it helped :)

0
Dima On

For the triangulation algorithm see Hartley, Richard, and Andrew Zisserman. Multiple View Geometry in Computer Vision. Second Edition. Cambridge, 2000. p. 312.

Or you can use the triangulate function in the Computer Vision System Toolbox for MATLAB.