Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting distance from a 2D image

Just wondering is it possible to get the distance of an object with a 2D image, my camera is following an infa-red light but it cannot get its distance to focus itself. any ideas? In theory i should be able to do something with pixel intensitys e.g the further away the light is the less intensity and so on. I have tried to use get pixel intensity of a rectangle but it does not seem to work. Am i warm or do i need to look elsewhere? PS, I am using a live feed.
0 Kudos
Message 1 of 4
(3,688 Views)
Did you try finding the histogram of the spot area?
0 Kudos
Message 2 of 4
(3,676 Views)

Hello Pasca21

 

You will not be able to use the intensity to determine the distance as the intensity could also change when the light is rotated unless you use a perfect omnidirectional light source. The other problem you will face with this is that the light intensity will not vary greatly over a large distance. And might only work as long as the camera is not being saturated. To determine distance you need to use some form of triangle. This can be done using two lights like a Wiimote and measuring the apparent distance between them or using two cameras and performing stereo vision calculations like they have done here http://www.cs.cmu.edu/~clz/stereo.html

 

Using two lights is easier as the two camera need to be aligned precisely.

 

With regards

Phil

 

 


Philip
Applications Engineer
National Instruments
UK Branch

===If this fixes your problem, mark as solution!===
0 Kudos
Message 3 of 4
(3,659 Views)

No, im just using a fresnel spot light and the camera is mounted over it, i have been looking and i dont think there is a way to do it with just one camera.

 

0 Kudos
Message 4 of 4
(3,656 Views)