5
votes

I need to calculate 3D points from corresponding images points. The algorithm to do this is explained here: http://en.wikipedia.org/wiki/Essential_matrix. It is not working for me, I receive wrong results. 1. Procedure utilize "normalized image coordinates" - how can I calculate them? 2. R and T matrices (calculated from essential matrix) are the same as these which outputs from cv::stereocalibrate procedure?

This is what i am doing now:

  1. Stereo calibrate my setup
  2. Inverse camera matrix for both cameras
  3. Calculate the normalized coordinates of corresponding points for both cameras - by multipication of inversed camera matrix and homogenous pixel point coordinates

Rest operations are based on this article http://en.wikipedia.org/wiki/Essential_matrix in section: 3D points from corresponding image points

  1. Calculating x3 physical/real world coordinate of the point using Rotation and Translation matrices (given by stereo calibration procedure).
  2. Calculating x1 and x2 coordinates as it is written in the article

Thanks for your help.

1
What do you have right now? What aspect of your impplementation is not working for you?jilles de wit
I pasted some more information. Do you want me to paste sample code, or do you think there is something wrong in algorithm?Marcin
What you are doing looks reasonable. What is the output? What makes you decide it doesn't work?jilles de wit
In the mentioned article it is suggested to calculate 3D coordinates starting with an expression for y'2 and for y'1. Result should be approximately the same. In my case it is not, results are completely different. I have also took image of the target with known geometry and tried to calculate distances between marked points - again these distances does not match real values. Later on I will post some exemplary resultant coordinates If that could help.Marcin

1 Answers

3
votes

OpenCV has a function that does just that -- cv::undistortPoints. Given the points, the camera matrix, and the camera's distortion coefficients, the "normalized" points will be output. You can read more on the page describing that function.