-3

I am tracking a moving vehicle with a stereo camera system. In both images I use background segmentation to get only the moving parts in the pictures, then put a rectangle around the biggest object.

Now I want to get the 3D coordinates of the center of the rectangle. The identified centers in the two 2D pictures are almost correlating points (I know not exactly). I did a stereo calibration with MATLAB, so I have the intrinsic parameters of both cameras and the extrinsic parameters of the stereo system.

OpenCV doesn't provide any function for doing this as far as I know and to be honest reading Zisserman didn't really help me, but maybe I am just blind to the obvious.

berak
  • 39,159
  • 9
  • 91
  • 89
mpeG
  • 1

1 Answers1

0

This should work: 1. For both camera's, compute a ray from your camera origin through the rectangle's center. 2. Convert the rays to world coordinates. 3. Compute the intersection between the two rays (or the closest point, in case they do not exactly intersect)

user3097732
  • 159
  • 1
  • 2