Caridorc
Caridorc

Reputation: 6661

Opencv disparity map: confusing units of measure

I was reading the docs at: https://docs.opencv.org/4.x/dd/d53/tutorial_py_depthmap.html and got to the equation:

disparity=x−x′=Bf/Z

x and x′ are the distance between points in image plane corresponding to the scene point 3D and their camera center. B is the distance between two cameras (which we know) and f is the focal length of camera (already known). Z is the distance of the point.

We have that B, f and z must all be meters because they represent a distance in the real world. Meanwhile the disparity is in pixels because it represents a distance of pixels in the image.

So the equation for the unit of measure is:

[pixel] = [m] * [m] / [m] = [m]

but a pixel is not equal to 1 meter! How can I make sense of the units of measure in order to apply this formula to a real world problem?

Upvotes: 1

Views: 29

Answers (0)

Related Questions