This project is used to compute the distance from a known object in an image to our camera.
To accomplish this task we utilized the triangle similarity, which requires us to know two important parameters prior to applying our algorithm:
-
- The width (or height) in some distance measure, such as inches or meters, of the object we are using as a marker.
-
- The distance (in inches or meters) of the camera to the marker in step 1.
-
- Computer vision and image processing algorithms can then be used to automatically determine the perceived width/height of the object in pixels and complete the triangle similarity and give us our focal length.
-
- Then, in subsequent images we simply need to find our marker/object and utilize the computed focal length to determine the distance to the object from the camera.
- initialize the list of images in line 32.
- python computeDistance.py