This has been around for a while, but I thought it deserved some attention. [Todd] used a laser pointer, a webcam, some trig and (sigh) some windows development tools to create his own laser range finder. Given the position of the beam strike and that the camera is located at a right angle to the laser, calculating the distance is pretty simple. This could be handy if you’re building a bot for defcon…
19 thoughts on “Webcam Laser Rangefinder”
Leave a Reply
Please be kind and respectful to help make the comments section excellent. (Comment Policy)
what’s the deal with the (sigh) before windows development tools? is this hack not 1337 enough for you because it’s not written in python on a 286 running a hand compiled install of gentoo? don’t like windows? that cool, don’t use it, but don’t act like everyone who does is missing something.
Or you could look into it and see that it’s probably because VC++ is not a cross platform standard and this is HaD after all which means a significant portion of the user-base will be on OSX, some linux distro, or BSD in addition to windows. VB is far from a good alternative at that. There’s a reason so much stuff here is done in python, nine times out of ten (at least) it will work perfectly on any platform that python and the libraries needed support which usually covers the important ones.
This is a great project. Lasers make everything better :) I wonder how effective this would be if it were spun on the top of a robot to do some simple and cheap object detection/avoidance.
he’s siging bout trig..(sigh)
For those who want to avoid paying then try
http://msdn.microsoft.com/vstudio/express/downloads/
for the free version of Visual studio. Also if you want an alternative to the Video Ocx actice X, try Andrew Kirillovs image processing library.
http://www.codeproject.com/cs/media/Image_Processing_Lab.asp
I thought he was one about sin hyperbolic
Seattle Robotics Society has had a very nice version of this up for some time: http://www.seattlerobotics.org/encoder/200110/vision.htm
It uses a line generating lens for the laser and a narrow filter for the webcam. This results in a system that measures distance at every point on the laser line.
he could get a bigger range if the cam would be turned 90° left or right (if the cam is able to notice the laser point in the resulting bigger range). and also the image from the cam won’t be nice to watch because you see more on the vertical line as on the horizontal one (but it could be easily reverted by turning the complete unit too). maybe building the cam and the laser not in parallel could result in a better accuracy because the lens is more linear in other regions (but it would give the cpu some more calculations to do)? i think it’s worth the trouble and time to try it :).
Ashish did the
same thing, and incorporated it into an obstacle detector for an autonomous RC car.
The Seattle robotics society article was pretty interesting…
Link to Ashish’s project:
http://ashishrd.blogspot.com/2007/03/autonomous-rc-car-ii-with-wireless.html
@matt
“what’s the deal with the (sigh) before windows development tools?” It’s because those tools are not free even if you can get them without paying. you can’t develop something from this and sell it and you can only run it in windows. If it had been developed with gcc (the compiler I use on linux and what the free mac development tools use) it could be used on any type of computer system: windows, mac, linux, bsd or unix. and it wouldn’t be subject to any of the legal restrictions of microsofts licence. for people like me who only have macs and linux (and macs running linux) this would be much preferable.
You make Bill Gates cry. There is nothing wrong if he wants to develope it on a platform he feels comfortable working on. We all have our own preferences so lets respect what eachother likes to work with.
I’ve been looking Everywhere, and hopefully someone here can help me out. (Please forgive me for going a little off-topic)
I spotted a site once that walked you through a Super cheap design for an analog (Not digital!) laser tag gun+vest. Upon being hit, photo-diodes closed a circuit which flipped a “relay” and shut off the entire unit. He didn’t use a relay though (they are somewhat expensive) but instead used a cheaper alternative. I just need to know what that was. If anyone knows the site or what he would have used PLEASE let me know! I can’t tell you how frusterated I am that I lost the site and cannot find it again. (I’m sure you’ve all been there at some time)
This is a sweet setup…
In addition to defcon, anyone still in school might be interested in the Intelligent Ground Vehicle Competition (http://www.igvc.com). A robotic competition between universities all over the world..
guess “dan m” wanted to write http://www.igvc.org/ :)
@matt
“is this hack not 1337 enough for you because it’s not written in python on a 286 running a hand compiled install of gentoo?”
wow, nice attitude. Personally I think the inventor would have come under a lot more flack should he have used python on a 286 with a hand compiled copy of gentoo, since this wouldn’t make a whole lot of sense and sounds like it would be an archaic setup at best, if even remotely possible [which I doubt].
Nobody was acting like windows users are missing something, in fact I got quite the opposite, if microsoft development tools are being used NON-windows users are missing something – and I think that was the point. My guess is if the hackers around here started using linux only development tools and libraries that would bother some windows users, so I think the general consensus is cross platform, whenever possible.
Hacking Win or using Win tools and drivers for a hack is as good as using a Federation starship to wage war against everything the people who invented that socialist nightmare stand for.
I wonder if this can be incorporated into a defconbot program?
Almost forgot: be careful if you use an IR laser. They can damage your eye and you won’t know it when it happens. The damage can be permanent.
I am the original author of the webcam laser range finder website and just wanted to let you know that the page has been moved. Anyone looking for this webcam laser range finder write-up can find it here:
http://sites.google.com/site/todddanko/home/webcam_laser_ranger