Let's Make Robots!

How to take distance using laser and camera

This is just a very simple way of getting a sense of distance

This may be extremely simple, but then again, some one out there might get inspired by this thing that I just "found", so I decided to share :)

Actually I started way more complicated with all sorts of moving stereo lasers :P 

But I got it down to this: Mount a laser to point in cameras direction and film. If the laser is placed on top, pointing a little down, the dot returned will be higher the closer the object is. I guess it should be fairly easy to be looking for that red dot's place on the axle, using some form of analysing software?

I myself have not gotten into using webcams on my robots yet, but when I do, it would be quite easy to test this method as a simple distance "sensor".

Due to all sorts of issues this may never be very precise (unless you have some really precise setup) - but it should give a very good indication of "close or far", will work on pretty long distances (specially inside, with shiny surroundings), and it will be cool.

And just to make sure you get me; I am talking:

The higher on y axis the red dot is, on the returned video, the closer the object. The power of the red dot is irrelevant.



Update: Oh, just realized; I have a "flat laser" - a normal red point laser that has a filter to it, so it beams out a flat long line. Using that causes you to see a "skyline" across the screen, with the highest point at where the closest object is.

I guess making video analyzing of such a line would be harder, but if possible, you could see everything on the X-axle, and not risk missing something like a wire in the air, that the pointer was not seeing :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Nice one...  I'm guessing your "flat laser" is done with a reflector, but you can also spin the pointer and get the same effect.  I've done video processing before, but found the webcam I have is not very attuned to laser light.  Your's seems pretty bright in the video (happy camera).

Do you have other sensors which would be sensitive to 650nm light?  I've noticed a wiimote does a pretty good job, also an optical mouse is very sensitive - although the resolution is pretty poor, it could still be used as a rough range finder.