Skip to content

Maharshpatel1709/Distance-Calculator

Repository files navigation

Distance Calculator

This project is used to compute the distance of a known object from our camera.

Dependent Packages

Project Workflow

To accomplish this task we use the following principle:

  • Area enclosed by the contours of an object decreases as the object moves farther from the camera.

Step-1

Find the area enclosed by the countour.

cv2.contourArea(contour)

Step-2

  1. Calibrate the readings of area with those of manually measured distance.
  2. Use these readings to plot a graph.

  1. Find the equation of the trendline in excel which fits best with the data.
  2. Now finally, use the equation of trendline to calculate the distance.
Distance = 1134.6*((cv2.contourArea(contour))**(-0.497))

Output

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages