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 & HelpVideo Capture,  Movie Playback,  Vision Libraries › save the image of webcam, but not the whole screen
Page Index Toggle Pages: 1
save the image of webcam, but not the whole screen (Read 1411 times)
save the image of webcam, but not the whole screen
Mar 25th, 2010, 9:15pm
 
I would like to know how can I save the image of webcam, but not the whole screen? I have tried to use saveFrame(), but it only works for saving the whole screen and required the image of webcam shown on the screen. What if I want to save the image of webcam into my computer even the image doesn't display on the screen?
Re: save the image of webcam, but not the whole screen
Reply #1 - Mar 25th, 2010, 11:21pm
 
Quote:
how can I save the image of webcam, but not the whole screen


Use get().

Quote:
What if I want to save the image of webcam into my computer even the image doesn't display on the screen


Use save() instead. On your image.

Code:
cam.read();
PImage cp = cam.get(10, 10, 20, 20);
cp.save("capture.png");
Re: save the image of webcam, but not the whole screen
Reply #2 - Mar 26th, 2010, 8:22am
 
can I save more than 1 image by using save() ?
For example, save 1 image of cam every 5 mins.
By using save(); I can save cam image every 5 mins but the file keep being over-write.

Using saveFrame(), then I can save many files, but cannot save the cam image only.

How can I use save() to saving more than 1 image?
Re: save the image of webcam, but not the whole screen
Reply #3 - Mar 26th, 2010, 9:43am
 
Code:
int nb_seconds, nb_images;

void setup() {
// draw() will execute 1 time per second
 framerate(1);
}

void draw() {
nb_seconds++;
 if (nb_seconds%300 == 0) {
   // this will execute every 300 seconds
nb_images++;
   cam.read();
   PImage pg = cam.get(10, 10, 20, 20);
   pg.save("image_" + nb_images + ".png");
 }
}
Re: save the image of webcam, but not the whole screen
Reply #4 - Mar 28th, 2010, 6:48am
 
thanks a lot~~!!
Page Index Toggle Pages: 1