We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › How to use webcam as mouse
Page Index Toggle Pages: 1
How to use webcam as mouse? (Read 917 times)
How to use webcam as mouse?
Jun 11th, 2009, 9:02am
 
Hi,

I have done something about mouse follow, when the mouse go through the screen the image will be changed and follow the mouse. Now I want to use webcam as the mouse, that means when people move in front of the webcam, the image will be changed and follow the person. I found a library JMyron maybe useful, but  I havn't use any function about the webcam before. Dose anybody know how to translate the mouse follow function to webcam tracking please? Thank you for any help you give  Smiley I'm really new at Processing.
Re: How to use webcam as mouse?
Reply #1 - Jun 11th, 2009, 12:38pm
 
Well the first thing I'd suggest is forget about the mouse: it doesn't sounds like you need to manipulate the actual mouse position with a video feed.  Instead replace the references to mouse position in your code with x and y variables (you can always pass the mouse coordinates to these variables to test it Wink ).

Then get your head round JMyron.  I'd suggest doing this in a separate sketch: that way you can concentrate on figuring it out without having to fit it into your existing code.  Use the reference.  Also make sure you search the forum and exhibitions for uses of JMyron Wink

It looks to me like you'd be interested in differenceImage() and globCenters()...  the only problem being that it's likely you'll be dealing with more than one glob at any given time - so you'll also need to work out how to choose which one to follow...  but once you've done that it should just be a matter of passing the coordinates to your x/y variables in your code Wink
Page Index Toggle Pages: 1