pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
AirMouse

AirMouse - 0.5

enderskill (enderskill)

Tags:

Description

To run AirMouse, you must have installed: VideoCapture - http://videocapture.sourceforge.net/ PIL - http://www.pythonware.com/products/pil/ Pygame - http://www.pygame.com/ Any USB Webcam or Video Input Device To use: Connect the webcam, start the program, then move a white emmisive object (such as a flashlight) in front of the camera. TO STOP THE APPLICATION, PRESS Esc. Procedure: For every frame that the camera records, AirMouse reads every pixel like a book (left to right and up to down). If a pixel is brighter than the threshold variable defined in the script, that pixel relative to the frame defines the cursor on the computer monitor. Bugs: AirMouse is choppy. Reading 76,800 pixels every 15th of a second is hard! When you move slowly down the screen, you eventually get a value error. This is an error in my pixel algorithm. I have not had much time to correct it.

Links

Home Page: http://www.pygame.org/
Source: http://www.mediafire.com/download.php?bfjvzdxb4lo

Releases

AirMouse - 0.5 - Jan 11, 2009

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

July 27, 2009 5:26pm - K.B. Carte - nickname: (techb) - 4/5
I only had it working once, but I too have been wanting to use a webcam for IR mouse control. I thank you for posting because it has helped me, and kept me motivated to create my own program. I don't use pygame but don't see why it can't be interfaced with the script.
Here's a link to the code, its not on pygame yet but will be soon.
http://www.daniweb.com/forums/post931609.html#post931609
January 12, 2009 4:42pm - enderskill - nickname: (enderskill)
That is brilliant! The last idea will make it go at least 8 times faster!
January 12, 2009 4:08pm - Alexander Lupas - nickname: (adisander)
If the accuracy for that isn't good enough, you could also try a checkerboard setup for ~2 times speed.
In addition, if you think you'll only have one light-source pointing at the camera at once (it is only one cursor after all) you can try to use last frame's position and it's last 'momentum' to find an area from which you can then search from in a circular fashion.
January 12, 2009 11:20am - enderskill - nickname: (enderskill) - 5/5
Good idea. I just got a PNY nVidia GeForce 6200. I'll see if AirMouse goes >>>FASTER>>> on that.
January 12, 2009 10:39am - Alexander Lupas - nickname: (adisander)
You said that reading 76800 pixels 15 times a second is slow. However, what you could try is to see how accurately it works if you skip every other pixel, and every other line. That way, it should work about 4 times faster, and the accuracy should still be pretty good. I'm not sure though, any I haven't been able to try it out as I don't have a webcam.
Very neet idea though!
January 11, 2009 5:42pm - enderskill - nickname: (enderskill)
It's not the best resolution. I just wanted to share my project. If anyone wants to make revisions to AirMouse, be my guest.
January 11, 2009 5:38pm - enderskill - nickname: (enderskill)
After I came up with the idea, someone posted the same idea on a tech blog. Coincidence!
January 11, 2009 5:34pm - enderskill - nickname: (enderskill)
Yes, it is.
January 11, 2009 5:32pm - Chandler Armstrong - nickname: (omnirizon)
how interesting. is this a concept totally your own?
January 11, 2009 5:27pm - enderskill - nickname: (enderskill)
I'm sorry for the confusion. This is my first POSTED project.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 28, 2014

Oct 21, 2014

Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)