Finding the distance to the LED

Imagine you have an LED torch on a Christmas tree at distance D from the camera.

Knowing the properties of both LED light (such as shape and intensity) and the camera (such as focal length), is it possible to calculate the distance from the camera to the LED backlight using a snapshot?

If so, how accurate are the measurements?

+1


source to share


1 answer


Bright lights are not very good for this , as bright lights tend to distort the adjacent space with MIE + Rayleight scattering , creating a haze that depends on many things, not just lighting. In addition, there are several issues in the camera itself, such as bright H or V lines caused by a charge jump through scanning lines and / or lens flares (this star or polygonal shape usually rotates and sometimes pleases) , making it very difficult to measure size in an image. in some cases.

problems

In case your image contains problems like this, I would use some other objects of known size, such as Christmas balls (or light holders / sockets if visible / usable) also as for evergreen tree leaves, they usually have the same size. Accuracy can be assessed as follows:

If the camera's FOV is in direction x

60deg

and the resolution 640x480

(assuming square pixels), then one pixel is equal da = 60deg/640pix=0.09375deg

. So for a h=5cm=0.05m

large object d=2.5m

far from the camera, I see it like this:

sketch



tan(ang) = h/d
--------------
ang = atan( h/d) = atan(0.05/2.5) = 1.14 deg
p = ang / da = 1.14/0.09375 = 12.2214 pixel

      

so the image can be 12 or 13px, so calculating the back distance

d = h/tan(p*da)
--------------
d0 = 0.05/tan(12*0.09375) = 2.54615m
d1 = 0.05/tan(13*0.09375) = 2.35024m

acc = 100*max(d-d0,d-d1)/d = 100*max(0.04615,0.25024)/2.5 = ~ 10.0096%

      

Now that you can see the accuracy is affected by the size of the object and the distance from the camera. Also at FOV and resolution of the camera itself.

To improve this, you can use subpixel object measurement ...

+2


source







All Articles