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:

  1. 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

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

    Ashish

    ReplyDelete
  3. HI,PLEASE send be the detail for thi project

    ReplyDelete
  4. 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

    ReplyDelete
  5. 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

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

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

    ReplyDelete
  8. Ashish,

    That's looking good.

    ReplyDelete
  9. 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)

    ReplyDelete
  10. 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

    ReplyDelete
  11. 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

    ReplyDelete
  12. 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

    ReplyDelete
  13. 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.

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

    ReplyDelete
  15. 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.

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

    ReplyDelete
  17. 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

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

    davepaf@gmail.com

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

    Thanks

    Edison

    ReplyDelete
  20. 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

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. 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.

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

    ReplyDelete
  24. 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..

    ReplyDelete
  25. Is there a download for this or only the tutorial?

    ReplyDelete
  26. 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

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. 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

    ReplyDelete
  29. 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

    ReplyDelete
  30. This comment has been removed by the author.

    ReplyDelete
  31. 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!

    ReplyDelete
  32. 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

    ReplyDelete
  33. 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

    ReplyDelete
  34. 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

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

    ReplyDelete
  36. 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.

    ReplyDelete
  37. 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...

    ReplyDelete
  38. ur project is grrrr888888:D
    tremendous work:D

    ReplyDelete
  39. 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

    ReplyDelete
  40. 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!

    ReplyDelete
  41. 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

    ReplyDelete
  42. 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

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

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

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

    ReplyDelete
  46. 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 ;) .

    ReplyDelete
  47. Hi Ashish

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

    ReplyDelete
  48. 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

    ReplyDelete
  49. awesome!!!

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

    please @ dear.ananta@gmail.com

    ReplyDelete