Author Topic: distance finder using camera + laser module  (Read 10701 times)

0 Members and 1 Guest are viewing this topic.

paulstreats

  • Guest
distance finder using camera + laser module
« on: October 25, 2007, 05:47:07 PM »
Ive just come across this page:-

http://www.pages.drexel.edu/~twd25/webcam_laser_ranger.html

it shows how using 1 camera (webcam in this case) and a laser module (quite cheap now), you can determine object distance. its not perfect and looks like it needs precalibrating, but im sure it just needs a good trig formula

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: distance finder using camera + laser module
« Reply #1 on: October 25, 2007, 07:00:17 PM »
I made one of my own, a while back

but the ranges given are a little bit messed up, don't rely on it solely for object avoidance.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: distance finder using camera + laser module
« Reply #2 on: October 26, 2007, 05:13:23 AM »
Quote
but the ranges given are a little bit messed up, don't rely on it solely for object avoidance.
i disagree. my own implementation of this method is very reliable.

i have used one of those DIY laser level things to produce a horizontal plane of light in front of my bot so it can detect objects anywhere in front of it rather than just at a single point like with a laser pointer.
it can even detect chair legs...

i'll upload a few pictures taken from the bot's camera later to demonstrate.

dunk.

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
    • Surveyor Robotics Journal
Re: distance finder using camera + laser module
« Reply #3 on: October 26, 2007, 06:01:41 AM »
We use a pair of laser pointers for better resolution plus some immunity to reflection noise.  Only issue is that the camera is a bit too far above the plane of the  lasers, so we don't see reflections of obstacles that are closer than 4".


Surveyor Corporation
  www.surveyor.com

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: distance finder using camera + laser module
« Reply #4 on: October 26, 2007, 08:00:00 AM »
Quote
Only issue is that the camera is a bit too far above the plane of the  lasers, so we don't see reflections of obstacles that are closer than 4".
yea. i'm in the same situation.
i want a fairly large distance between the camera and laser to improve resolution at long ranges.

i have my camera angled slightly downwards so the top of the image is just above the horizon which improves the minimum range issue  but this has the negative effect of limiting the view for remote users viewing the image.

i'm still trying to decide whether to go with a 2nd camera for remote users or mount the existing one on servos.
i have not tested it as yet but i am concerned that going with the servo idea will add error to the whole system.

dunk.

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
    • Surveyor Robotics Journal
Re: distance finder using camera + laser module
« Reply #5 on: October 26, 2007, 09:53:10 AM »
Our robot is only 4" wide, but that's an adequate width to resolved distances in the ballpark of a few inches at 10ft range at 320x256 image resolution (theoretically, we should be able to resolve 0.5" at that range with 1280x1024, but some trick signal processing will probably be required to achieve this. 

We just started to assemble these, and are finding other quirks like loose lens assemblies which can easily shift the path of the laser.  We might have to use plumbers tape to tighten the threading.
Surveyor Corporation
  www.surveyor.com

paulstreats

  • Guest
Re: distance finder using camera + laser module
« Reply #6 on: October 26, 2007, 07:43:31 PM »
are you using a lookup table for the range of the laser dot or are you using an equation?

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
    • Surveyor Robotics Journal
Re: distance finder using camera + laser module
« Reply #7 on: October 26, 2007, 08:33:44 PM »
It's a linear equation.  The distance is the inverse of the pixel distance between the pair of dots with a scaling factor.
Surveyor Corporation
  www.surveyor.com

Offline frank26080115

  • Supreme Robot
  • *****
  • Posts: 322
  • Helpful? 2
Re: distance finder using camera + laser module
« Reply #8 on: October 27, 2007, 12:38:42 AM »
on a similar idea, how about projecting a straight horizontal line in front of the robot, and judging from the location on the y axis and the overall height of the line object, determine range, and surface roughness?
you can use trig to get the range to the line
and if a surface is rocky (for example) then the line will be all bent, and a smooth surface will make a thin line, telling the robot it's ok to go to that area

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
    • Surveyor Robotics Journal
Re: distance finder using camera + laser module
« Reply #9 on: October 27, 2007, 09:16:54 AM »
I think there are a lot of possibilities to explore with this approach.  The lasers cost less than $2 each (I don't have the link handy, but just do an ebay search on 5mW laser pointers), and you can shape the beam as a point or spread it somewhat of a rectangular pattern with the lens.  You could add a 3rd laser pointing at a downward angle as a drop-off detector.

Let me note that some image processing is required to extract useful information from the video capture, as the lasers are quite bright and the reflected patterns are not always clean.  Reflections off white surfaces and glass are difficult to see.  Also, you must have a mechanism to turn the lasers on and off under software control as a way to most easily extract the reflective patterns.  However, if you can work through the challenges, this approach has a lot of potential for area mapping and general navigation.
Surveyor Corporation
  www.surveyor.com

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: distance finder using camera + laser module
« Reply #10 on: October 28, 2007, 07:35:08 AM »
so here's some pictures from my current setup as promised.

the first picture is with the laser switched on.
the 2nd is with the laser off.
and the 3rd picture is just a diff of the 2 images with some filtering applied to get rid of noise.

i'm afraid the laser line module i'm using at present doesn't produce a very even line.
i'm waiting on some better modules to arrive from ebay. (any day now...) having a line of even brightness will make filtering far easier.

i haven't done much work on calibrating the system yet.
it appears my camera doesn't distort the image too much so i'm hoping calibration will be fairly simple.

even with the crap laser line module i'm using maximum range is quite good.
the back door to my house (top left of the pictures) is in range here about 7 meters (20 something feet) away.
as already discussed in this thread, the minimum range the way i have set things up is around 30cm. under that distance and the laser illuminated object is outside the camera's field of vision.

so obviously there are a few issues with this system.
for example, there is an obvious shadow cast by near objects, preventing it from seeing objects behind nearer objects, even if the camera can see them.
an example of this is the shadow cast by the drink can on the counter behind it.
this could be solved with multiple lasers but i'm going to keep the physical aspect simple and allow for this uncertainty in software.

as i'm using a red laser, dark red and brown objects are hard to see.
for example the light brown chair legs are visible but the dark brown table leg is not.
this will improve when i get the better laser but again, it will always be an issue without using multiple lasers of different colours.

dunk.
« Last Edit: October 28, 2007, 07:40:56 AM by dunk »

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
    • Surveyor Robotics Journal
Re: distance finder using camera + laser module
« Reply #11 on: October 28, 2007, 11:32:30 AM »
Dunk -   

I like your approach.  I am only using the lasers as point sources and rotating the robot to sweep an area.  How are you generating the line ?

I likewise have noticed that small camera lenses with less than 60-degree field of view tend to be fairly linear.
Surveyor Corporation
  www.surveyor.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: distance finder using camera + laser module
« Reply #12 on: October 28, 2007, 11:44:17 AM »
feel free to continue to report your results on this . . . one of the robots im working on has a laser, a sharp IR, and a cmu cam mounted together on a servo. its built already, but at the moment im working on other stuff so havent had time to program it up . . . the laser will be mosfet controlled for on/off . . .

what if you also mounted a bright headlight on your robot to eliminate shadows and poor/dark lightning?

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: distance finder using camera + laser module
« Reply #13 on: October 28, 2007, 11:59:32 AM »
Quote
How are you generating the line ?
currently using a little device you can buy in hardware stores for projecting a straight edge on walls for DIY jobs.
it's a low power laser going through a piece of curved glass. (like a lens but i one dimension rather than 2.)
unfortunately the one i have is quite low quality, hence the uneven brightness.

there are far better quality modules out there, used in industrial automation among other things.

i just ordered these:
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=150174323403
which i have high hopes for and with a pack of 8 i can afford to experiment a bit...


dunk.
(with frikin lasers....)

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
    • Surveyor Robotics Journal
Re: distance finder using camera + laser module
« Reply #14 on: October 28, 2007, 01:59:07 PM »
That's the same guy that I buy the lasers from.  The line generator looks like the same laser body and electronics I'm using but with a different lens.  These are very bright lasers.

Quote
what if you also mounted a bright headlight on your robot to eliminate shadows and poor/dark lightning?
Some of our users have mounted bright LED's to drive around in the dark.  We're just switching these signals with basic NPN switching transistors.
« Last Edit: October 28, 2007, 02:04:37 PM by hgordon »
Surveyor Corporation
  www.surveyor.com

paulstreats

  • Guest
Re: distance finder using camera + laser module
« Reply #15 on: October 28, 2007, 02:28:46 PM »
what are the chances of using a laser diode like out of a dvd/ cd player. Some of them contain a red laser and also an IR laser, would the infrared version work? if a camera can see ir light.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: distance finder using camera + laser module
« Reply #16 on: October 28, 2007, 02:37:46 PM »
Quote
would the infrared version work? if a camera can see ir light.
i'd be careful of shining IR lasers around as people can't see them, therefore there is no blink reflex if it gets shone in some one's eye.
as a result you can use a far brighter visible light laser than an equivalent IR one.

but in theory yes, i've used ultra bright IR LEDs on a teleoperated bot before enabling users to drive round in the dark.

dunk.

paulstreats

  • Guest
Re: distance finder using camera + laser module
« Reply #17 on: October 28, 2007, 03:05:57 PM »
I probably wouldnt want people to see a scanning laser line, but then id rather not blind anyone either. maybe i can get hold of a ps3 replacement part (these contain violet(blu-ray),red and ir lasers), for different circumstances, and ive heard that the violet laser is a very attractive colour

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: distance finder using camera + laser module
« Reply #18 on: October 28, 2007, 04:46:46 PM »
Im using a hacked laser from those cheap pens they sell now . . . like $5 . . . (but I bought mine in asia for like $2 hehe)

 


Get Your Ad Here