Reconstruction of a three-dimensional point from two 2D points?

OpenCV contains a lot of support for 3D reconstruction from stereo cameras. In my case, I have two cameras, and I want to know the 3D coordinates of some point.

What I have:

  • pixel coordinates of the point in both images
  • Known internal and external camera settings

What I want to get: The coordinates of this point in 3D

+6
source share
3 answers

I answered the same question in this other post.

If you have external parameters, you have a camera view. With a camera position and a 2D point, you can program 3D points (for each camera, you should have the same result if your 2D points and external parameters are correct). You just need to convert the pose to homography. I will explain this in the message I linked.

Good luck

+3
source

I don't know if opencv has a construct for this. However, I know that you can use the sine law for Angle-Side-Angle to build a linear distance horizontally parallel to the cameras, using the inside angles of the point-> camera-> another camera as reference points.

Then, as soon as you get the distance, you can calculate the vertical positioning using the same design: where the angle is measured from the dead point to how far above or below the point there is a link to any camera, the distance to the object found in the first stage, and you You can use 90 degrees as your angle between this imaginary point (above the object horizontal to the camera) and the object.

+1
source

If you do not have experience in triangulation points from two representations, you should book the book of Hartley and Sisserman . This book describes a linear triangulation method that is very simple to implement, with the corresponding point-to-point correspondences, camera position, and camera calibration.

An example code for this method is given here . It is based on the book mentioned above.

However, there are very important conditions that must be met. First, the measured correspondences of the points must be correct with respect to the epipolar limitation x*E*x' = 0 . Secondly, the angle between the rays should be more than a few degrees, for example, 2 degrees.

+1
source

Source: https://habr.com/ru/post/916604/