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 › Selecting half the window
Page Index Toggle Pages: 1
Selecting half the window (Read 600 times)
Selecting half the window
May 10th, 2010, 11:26am
 
Hello all,

I'm attempting to use frame differencing to have movement trigger some actions.  The problem I am running across is that my video capture image is on the right hand side of the window, while I have a running movie on the left.  Thus, my frame differencing syntax is seeing this running movie as movement.  Is there anyway, via array math or whatever, to select the pixels on just the right side of the screen?  Thank you very much for your help.

Re: Selecting half the window
Reply #1 - May 10th, 2010, 12:12pm
 
Two options I can think of:

The copy() method can be used to copy pixels from one image to another.  So, you could create a PImage the size of the frame-capture area, copy the frame capture images to the PImage each frame, and run the frame-differencing algorithm on that.  Or some other variation, like have your video playback render to a separate image, and run the frame-differencing algorithm on the main window, then paste the video image in at the end of each frame just before you show it to the user.

Or you could use the napplet library to set up two separate "sub sketches" that display side by side in the same window.  (Disclaimer: They say when you have a hammer, every problem looks like a nail, and I happen to be the inventor of this particular hammer.  But this really is exactly the sort of thing I had in mind for napplet.)


Page Index Toggle Pages: 1