Reconstruction a 3D point from two 2D points?
Asked Answered
J

3

7

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

What i have:

  1. pixel coordinates of point on both images
  2. Known intrinsic and extrinsic camera parametres

What I want to get: Coordinates this point in 3D

Jenaejenda answered 24/5, 2012 at 20:16 Comment(0)
A
3

I have answered the same question in this other post.

If you have extrinsic parameters, then you have the camera pose. With the camera pose and the the 2D point, you can proyect the 3D points (for each camera should be the same result if your 2D points and extrinsics are correct). You just need to convert pose to homography. I explain it in the post I linked.

Good luck!

Alastair answered 30/5, 2012 at 8:1 Comment(1)
Your answer deals with a different case than this as far as I understood.Argentous
M
2

When you have no experience in triangulating points from two views you should the book of Hartley and Zisserman's book. In this book a linear triangulation method is described that is very easy to implement having the 2D point correspondences, the camera pose and the camera calibration.

Example code of this method is given here. It is based on the book mentioned above.

Nevertheless, there are very important conditions that have to be met. First, the measured point correspondences have to be correct with respect to the epipolar constraint x*E*x' = 0. Second, the angle between the rays should be greater than a few degrees, e.g., 2 degrees.

Maillot answered 15/10, 2013 at 22:17 Comment(0)
P
1

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

Then once you get the distance, you can calculate the vertical positioning by using the same construct: where the angle is counted from dead center to how far above or below the point is in reference to either camera, the distance to the object found in first step, and you can use 90 deg as your angle between that imaginary point (above object horizontal to the camera) and the object.

Ptarmigan answered 24/5, 2012 at 22:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.