Methodology and theory behind
Distance Measuring
Algorithm
Using One camera
In this document only theory and mathematics behind algorithm is described, details related
programming is not discussed.
Our Distance Measuring Algorithm (DMA) has three parts
 Track object
 Feed set points
 Measure distance
Track object
A picture is better than thousand words so first see these pictures.
From above images we notice that aspect ratio (width/height) is more or less 1.3 so for tracking
particular object (sign board in our case) we find all objects in image and check aspect ratio of all objects
found in image and discard all object whose aspect ratio is not equal to 1.3 so doing this we can easily
track particular object.
Feeding set points
This method is not plug and play we have to feed some set points let us organize data obtained from
above images in table.
No Aspect ratio
(width/height) no unit
Distance (feet) Area (width x height) in pixels
1 1.37 0.5 280071
2 1.35 2 91520
3 1.313 3 46436
4 1.33 4 26980
5 1.355 5 14664
Measuring Distance
For measuring distance we are using Lagrange’s interpolation formula
Formula for five point’s data
(x- x1) (x- x2)(x- x3)(x- x4) (x- x0)(x- x1) (x- x2)(x- x3)
f(x) = f0+ . . . + f4
(x0 - x1) (x0 - x2)(x0 - x3)(x0 - x4) (x4 - x0)(x4 - x1)(x4 - x2)(x4 - x3)
Follow this link to understand Lagrange’s interpolation
http://mat.iitm.ac.in/home/sryedida/public_html/caimna/interpolation/lagrange.html
Applying langrage’s interpolation to above data to find distance at any point
Distance (D) 0.5 2 3 4 5
Area (A) 280071 91520 46436 26980 14664
Our unknown quantity is distance we know area so we can easily find distance at any value of area.
Limitations
If camera move to close to object then this method does not works

Distance measuring Algrothim

  • 1.
    Methodology and theorybehind Distance Measuring Algorithm Using One camera
  • 2.
    In this documentonly theory and mathematics behind algorithm is described, details related programming is not discussed. Our Distance Measuring Algorithm (DMA) has three parts  Track object  Feed set points  Measure distance Track object A picture is better than thousand words so first see these pictures.
  • 6.
    From above imageswe notice that aspect ratio (width/height) is more or less 1.3 so for tracking particular object (sign board in our case) we find all objects in image and check aspect ratio of all objects found in image and discard all object whose aspect ratio is not equal to 1.3 so doing this we can easily track particular object. Feeding set points This method is not plug and play we have to feed some set points let us organize data obtained from above images in table. No Aspect ratio (width/height) no unit Distance (feet) Area (width x height) in pixels 1 1.37 0.5 280071 2 1.35 2 91520 3 1.313 3 46436
  • 7.
    4 1.33 426980 5 1.355 5 14664 Measuring Distance For measuring distance we are using Lagrange’s interpolation formula Formula for five point’s data (x- x1) (x- x2)(x- x3)(x- x4) (x- x0)(x- x1) (x- x2)(x- x3) f(x) = f0+ . . . + f4 (x0 - x1) (x0 - x2)(x0 - x3)(x0 - x4) (x4 - x0)(x4 - x1)(x4 - x2)(x4 - x3) Follow this link to understand Lagrange’s interpolation http://mat.iitm.ac.in/home/sryedida/public_html/caimna/interpolation/lagrange.html Applying langrage’s interpolation to above data to find distance at any point Distance (D) 0.5 2 3 4 5 Area (A) 280071 91520 46436 26980 14664 Our unknown quantity is distance we know area so we can easily find distance at any value of area. Limitations If camera move to close to object then this method does not works