Sunday, March 16, 2008

Laser Tracking with webcam for Human-Computer Interaction



This post should have been written two months ago, in January, but with all sorts of things keeping me busy, I just couldn't get enough time to shoot videos and write about the project. Anyway, now that I do have time (and a video), here's what the whole thing's about: While writing an email to Scott Hanselman on January 29th, 2007, I thought - Wouldn't it be cool if I could control my mouse cursor with a laser pointer, and even draw things with it. I had tried doing something similar in 2006, but it had some serious speed issues. This time, after rewriting the code and introducing some neat image processing techniques, the code is much faster than before. I was surprised that I had a working prototype within 3-4 days of coding.

The idea is pretty much similar to Johnny Lee's Wii Whiteboard project, except that I'm using a webcam instead of a Nintendo Wii remote. The program uses the webcam to track a laser dot in its FOV. With a projector, you can select its projected area, and the program would map its coordinates to your screen. Then, for opening a file, you'd just have to point on the file with a laser pointer and your computer would open it for you!

Oh, and by the way, while sending my next email to Scott, I didn't use a mouse for clicking the "Send" button. :)

Source code and details coming soon!

Cheers,
Ashish

49 comments:

JoeCatshoe said...

That is very awesome!
Very accurate movement detection too.

I was just wondering, how do you control mouseclicks with your laser? You just flash it on and off or something?

I'd love to see more of your work.

Joe

Ashish Derhgawen said...

Hey Joe..glad you like this project. :) Turning the laser off simulates a mouse click.

Ashish

Unknown said...

HI,PLEASE send be the detail for thi project

Unknown said...

hi Ashish i am waiting for your reply,hope u'll reply soon,i want to make this for my college project so please help me

Anonymous said...

hi ashish i realy need this for my exam on movement tracking...and i have 1 week to do it...so please help me... diabelous@yahoo.com

Anonymous said...

hey im just wondering, can you substitute the cam you used with a simpler, cheaper generic webcam?

Ashish Derhgawen said...

@anonymous: I'm pretty sure you can use any webcam. :)

Anonymous said...

Ashish,

That's looking good.

Anonymous said...

Can I find the program files somewhere?
I'm also quite interested, but I think my coding skills are not good enough to do that, so would you mind sharing it with me?

BTW. my email consists of florianweb an @ and let's say the domain of an provider (freenet.de)

Anonymous said...

Wow. Its a very cool work. I was thinking of implementing all mouse operations using a web cam. I thought of using matlab for processing the images but even then i am not able to find out how to implement the mouse operations. Then i found your work. Can u please suggest me any books or other references which would help me.
Thanks in advance. Eagerly awaiting your reply. I am Bharat and my mail id is ba5040@yahoo.co.in

dethric said...

ashish can u help me with your project.. im interested to it and plans to propose it on my project for one of my subjects... here is my email add: enrique_baduria@yahoo.com can u help me explain it more clearly how it works?? what did u use programming language? and how 2 interface the webcam in your program. hope to hear from u soon

Anonymous said...

Hi Ashish,

This is really cool and i was wondering which programming language you used. I'm really bad at programming (i dont even understand the text saying you can use html tags under where im posting this comment =])but i kind of understand how it works (i dont know any syntax except extremely basic stuff). Im not sure if you are giving people the source code, but if you are, please can you send it to me? Thank you v much. Your work is great.

Email: matty_boughen@hotmail.co.uk

P.S. Dont worry if you arent giving people the code, i only want it cus im interested in stuff like this. =].

James

Anonymous said...

Hi Ashish,
Its a cool project. I want to learn it but first i need to buy a webcam. Wat is the minimum requirement for the webcam to be used? Will CIF (352*288) format be enough? How about this http://www.zebronics.net/penguin.asp

awaiting ur reply. Thank u.

Ashish Derhgawen said...

That seems like a fine webcam..it should definitely work. :)

Anonymous said...

Hi Ashish,
I bought this webcam http://www.zebronics.net/penguin.asp but if i move the laser torch (i moved it with the same speed as in ur video), instead of a dot a line appears so the mouse pointer stalls for sometime and then suddenly appears at another point. Can u please suggest wat i can do now. Or should i change the webcam, if so wat about this http://www.logitech.com/index.cfm/webcam_communications/webcams/devices/261&cl=SG,EN . Thank u.

Anonymous said...

Very awesome..great job
kindly send me the source codes
thanks
anu_cool88@hotmail.com

Anonymous said...

Can you please sent be the details of this project soon as I was planning to do something like this for my Engineerin mimi project

John


jhon224552@gmail.com

Anonymous said...

nice work..can you please give me the codes... thanks in advance...

davepaf@gmail.com

Anonymous said...

Wow, that's so cool! Where can I find your program? just email, please send to renxn@hotmail.com

Thanks

Edison

Anonymous said...

The is a great video! i am very new in human computer interaction devices and would love to learn more, please share me your application, please!

addtvdo@gmail.com

Rachan Seeba said...
This comment has been removed by the author.
Yani said...

Absolutely brilliant!
I was planning the same functionality for my HTPC project.
Unfortunately I'm only a PHP coder, so it's impossible for me to make a similar software from scratch just by myself. That's why I'd be delighted to get my hands on your source code or even binaries if possible.

Updating the blog post would benefit us all but if you like, you can email me. My address is jani.removethispart@janipeltoniemi.removethispart.net. I hope to hear from you soon.

hakan said...

Wow, that's so cool! Where can I find your program? just email, please send to demirkol_@yahoo.com

shethia.tejas said...

hey man this is a cool
i m right now on a project which requires tracking a laser spot
Can u pls help me out
i just wana understand d logic
hats off man!!
can u reply on my mail id shethia.tejas@gmail.com
i know u might b quie busy but if poss pls reply..

Steve said...

Is there a download for this or only the tutorial?

Unknown said...

hi....
i tryd ur project ..controlling a stepper motor win .NET
thrs a prblm...
whr do i enter the porAccess commands..???
can u plz...give details of d steps to enter cmmands. m vry new to .NET..
plz hlp.
thnx.
poornima002@gmail.com

Unknown said...
This comment has been removed by the author.
Unknown said...

Hi,Ashish

I like ur project work. It is great idea to demonstrate the use of laser beam as mouse. Plz,can u provide help to me for creating program of object tracking.

hardiksupekar@gmail.com

Anonymous said...

Hi Ashish
Great program! I would really like to try your code. If you want to share it please send it to robert.lorentsson@hotmail.com

thanks
Robert

Unknown said...
This comment has been removed by the author.
Unknown said...

Ashish, my hero! I know I'm a year late, but if you still read this, would you mind sending the code to me? My skills are somewhat lacking in the "really cool coding" department.

Can anyone say House of the Dead 2 PC with a laser pointer?

If you're cool with that, please send it to:
kurt.bernasch@gmail.com

Thanks!

Anonymous said...

Hello Ashish,

I would like to use your "Laser Tracking with webcam for Human-Computer Interaction" to make a simple game in somthing like powerpoint for the children I work with. Would you be able to help?

Andy

Anant said...

Hey Ashish,

My name's Anant.. and i really liked your work. This idea of yours is spectacular.. i need yor help actually, can you send me the various files concerned with this project please?

email : anantmittal2@gmail.com

MUDALAGIRI MADHUSUDHAN said...

Hi ashish... Laser tracking with webcam for HCI is really cool.I am in need of a clarification. Similar to the project that you have done, Is it possible to trace the eye moment of the person sitting infront of a computer or a laptop using only a web camera and then uing those moments as a input signals to the computer. In other words using only eyes to control the mouse pointer of the computer. Please let me know and also if you know the similar system already developed... please help me in getting the exe file to install in my computer. I will be waiting for your response. My email id is mmudalagiri@yahoo.com. Please do respond.

with regards
Madhusudhan

Anonymous said...

hey man thats really hot,,,,
can u send me more details about the project
www.thanujarockz@gmail.com

c-cheung said...

Wow, that looks very nice. Do you still have the source code to that project by any chance? I would very much like to look into doing something similar for a wiimote whiteboard.

viral said...

hey ashish dis is viral . m in final year engg, n we are doin ur proj based on distance measurement by using lasers. the second phase of ur project is using a webcamera with circuit.we want dat camera should capture images and find out the brightest spots(lasers spots) in the image and send continuous signals to the circuit. and we know only c & c++ language.....so pls tel if there is some code ,how to go about this...

Unknown said...

ur project is grrrr888888:D
tremendous work:D

Tao Ni said...

Hi Ashish, I am very impressed by the accurate tracking in this work. Could you please share the source code? I'd like to integrate such a function into my current project. Thanks! Email: tonial.sands@gmail.com

DenisPoison said...

Hi ya!
Great work! This prog could be made as a small driver for using with flash-games.
Your prog is a main part of laser shooting range. If you join your prog with games... you'll be the king!

Anonymous said...

hi,
I'm very interested about your project.
Can you sent me the details and codes about this project?
Thank you so much!

tsvivid@gmail.com

Unknown said...

hi Ashish,
your project is extremly great ...
i was so interested as my project is similar to yours ..
i'm just asking how did u segment the frames to detect the red laser point to get its position

so please if u could help us & send any helpful information about this AS SOON AS POSSIbLE

alaadiab@live.com

Unknown said...

Hi Ashish,
Can u plz send me some information of how and where to start for this project...
Plz reply on vikashsinghcse@gmail.com

Anonymous said...

Hi asish plz plz send me the code for this software....... Its very much needful for me..... my email-pandey.munni22@gmail.com

Anonymous said...

In Germany, we can't see this video!
Because of sony music content.

Anonymous said...

2,5+ years ago. Where is the software :) ?
There is no alternative software.

This ist good for controlling a media center.

Or make a shooting game ;) .

Unknown said...

Hi Ashish

Just wondering if you actually point the laser pointer at the webcam or would it damage the camera?

Anonymous said...

i just want to know about the type of webcam.. i try with my USB Webcam, but it slow motion with low fps.. could you give me some clues? thx

damar said...

awesome!!!

would you mind to share the code? i wanna learn abaut it...

please @ dear.ananta@gmail.com