Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i control the mouse using a laser and a webcam?
i want to replace the mouse with the laser pointer....single click,double click n whatever mouse does i want to do almost all with the laser pointer....how can i do it??
Posted

1 solution


  1. A wall with no boards or furniture before it would be ideal.
  2. Point the webcam at the wall at such a distance that ideally all of the wall is covered by the webcam image.
  3. Have a program read the video stream from the camera and do the analytics to recognize clicks, double clicks, positioning and maybe even gestures.


Reading of a video stream and fetching the frames from that would be pretty much straight forward and maybe can be found here: Versatile WebCam C# library[^]. Since laser pointers are rather bright and mostly have a distinctive color fetching the position of the laser dot on the frame should also pose no problem. If your laserpointer has a button with which it can be turned on and off you could easily emulate the mouse with that. Turning the laser off for a certain TBD amount of time would be registered as a click and the same goes for the double click. The click as well as the double click should be triggered when the laser finally comes back on.

This article might also serve you well: Real-Time Object Tracker in C++[^] by Chesnokov Yuriy[^]

Best Regards,

—MRB
 
Share this answer
 
v3
Comments
RaviRanjanKr 9-Aug-11 17:55pm    
Nice Answer, My 5+
Soft009 10-Aug-11 0:01am    
nice one 5+
Member 8148265 11-Sep-11 9:00am    
detecting the laser is over but the problem is to initiate click,double click because i want to use that laser pointer representing the cursor of a computer
Manfred Rudolf Bihy 12-Sep-11 8:08am    
Not clear what you mean! Did you read the paragraph following the ordered list?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900