pygame is
Simple DirectMedia Layer is
Site Swing

AirMouse - 0.5

enderskill (enderskill)



To run AirMouse, you must have installed: VideoCapture - PIL - Pygame - 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.


Home Page:


AirMouse - 0.5 - Jan 11, 2009 account Comments

If you wish to leave a comment with your 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.
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.

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Nov 17, 2015

Nov 12, 2015

Nov 11, 2015

Nov 8, 2015

Oct 16, 2015

Oct 9, 2015

Sep 11, 2015

Sep 6, 2015

Aug 26, 2015

Aug 25, 2015

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