Stereo Vision Real Distance Calculation

1.3k views Asked by At

I am new on stereo vision. I am trying to calculate real distance from stereo's disparity map and depth map. But I don't understand how can I do that. I have two output, one of them detect cars and giving x,y,w,h coordinates. The second one is that the stereo output with applied colormap.det_stereo_img

What I am trying to find car's distance from disparity map or depth map like this picture, ss_img

I have an array of depth_map which is 480x640, enter image description here

How can I find car's distance like above picture from depth map? Is there any formula for that or sample example? Thank you.

1

There are 1 answers

0
decadenza On

How someone has already said in the comments, you need the parameters of both cameras. In other words, the calibration information of your system:

  • Intrinsics parameters of each camera (including lens distortion params)
  • Extrinsics parameters i.e. where is one camera with respect to the other one in terms of a rotation matrix and a translation vector.

After that, yes, there is a formula. Please refer to my other answer here.

If you want an example to go from disparity map to 3D points, you can go here and follow the trail in the code.