LearnTechWithUs / Stereo-Vision

This program has been developed as part of a project at the University of Karlsruhe in Germany. The final purpose of the algorithm is to measure the distance to an object by combining two webcams and use them as a Stereo Camera.
MIT License
343 stars 114 forks source link

distance calculation #10

Closed sowmiyadharmalingam86 closed 2 years ago

sowmiyadharmalingam86 commented 4 years ago

Distance= -593.97*average*(3) + 1506.8average*(2) - 1373.1average + 522.06

how do you substitute the values in the above...What is the equation you are using to get the distance value.

cpatel245 commented 3 years ago

If you will see this file 'Stereo Vision - Explanation - German.pdf' on page 26-27 you will get a clear idea about it. But it is in German.

Basically, After you get the disparity map. You measure and record the distance of the object and record their respective disparity values experimentally for multiple placements of the object.

with these observations/data po ints, you can create the regression graph (can be done in MS Excel) from which you can get the linear equation 'Distance= -593.97average(3) + 1506.8average(2) - 1373.1*average + 522.06'. It might be different according to your setup. After getting this equation you can directly use it in your code to get the distance.

for clear understanding see the screenshot attached here.

image