0
votes

I'm trying to estimate depth from a stereo system with two cameras. The simple equation that I use is:
Depth = (Base line * Focal lenght) / (Pixel disparity * Pixel size)

but i can't find Pixel disparity and Pixel size

how to find pixel disparity , pixel size? Thank you.

1

1 Answers

0
votes

You can get pixel size form spec sheet of your camera sensor. Alternatively, pixel size is not required if you have calibrated your camera, so that calibrated focal length will be in pixels.

So you can modify your formula as:

Depth (in cm) = Baseline(in cm) * Focal Length(in pixels) / Disparity (in Pixels)

For getting pixel disparity, you can use OpenCV Block Matching and Semi-Global Block Matching techniques Calib 3D Docs. There are many more accurate disparity estimation algorithms were published.