FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Topics & Contributions
   Video, Camera
(Moderator: REAS)
   camera kiosk/booth video thingy
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: camera kiosk/booth video thingy  (Read 793 times)
bsr

WWW Email
camera kiosk/booth video thingy
« on: Sep 15th, 2004, 3:14am »

i've got a music gig this friday at a big posh event in a club.
 
while i'm not playing i want to set my computer facing the crowd with a webcam on top so they can come and have a look on screen, the script i've written (adapted from someones example somewhere on the web) takes a snapshot every couple of seconds and displays it to screen... along with a few other visuals.
 
i want to save these shots and upload them onto a website the next day, problem is save() and saveFrame() only save the entire window (in this case 1024x800) - all i want to save to a file is the video capture at 160x120.
 
is there any easy way of doing this like save.video() or something, a quick answer would be much appreciated as this needs to be ready for friday am.  
 
Code:

// fishy fishy video
int cx = 0;
int tmr = 0;
int ex = 0;
int elSize = 10;
int ceSize = 7;
BFont metaBold;
void setup()
{
  framerate(90);
  size(1024, 800);
  background(0);
  noStroke();
  beginVideo( 160, 120, 30 );
  metaBold = loadFont("RotisSanSer.vlw.gz");
  textFont(metaBold, 40);
}
void loop()
{
  //-------------------------------------------------------------
  for( int a = 0; a < 65 ; a++)
  {
    int rowndx = int(random(23));
    int x = int (rowndx * 10);
    int rowndy = int(random(56)+24);
    int y = int (rowndy * 10);
    color c = video.pixels[ (x/8) + ( (y/8) * video.width ) ];
    fill( c );
    rect( x, y, ceSize, ceSize );
  }
  //-------------------------------------------------------------
  for( int a = 0; a < 300 ; a++)
  {
    int rowndx = int(random(50)+23);
    int x = int (rowndx * 10);
    int rowndy = int(random(56)+24);
    int y = int (rowndy * 10);
    color c = video.pixels[ (x/8) + ( (y/8) * video.width ) ];
    fill( c );
    rect( x, y, elSize, elSize );
  }
  //-------------------------------------------------------------
  for( int a = 0; a < 65 ; a++)
  {
    int rowndx = int(random(23)+73);
    int x = int (rowndx * 10);
    int rowndy = int(random(56)+24);
    int y = int (rowndy * 10);
    color c = video.pixels[ (x/8) + ( (y/8) * video.width ) ];
    fill( c );
    rect( x, y, ceSize, ceSize );
  }
  //--------------------------------------------------------------
 
  image(video,ex,0);
 
  ex = ex+1;
  if (ex > width){
    ex=0;
  }
  tmr = tmr +1;
  if (tmr >50){
    noFill();
    stroke(55);
    rect(ex, 0, 160, 119);
    image(video, cx,122);
    saveFrame("sshot-####.tif");
    noStroke();
    delay(320);
    cx = cx +160;
    tmr = 0;
    if (cx > 900){
 cx=0;
    }
  }
  smooth();
  fill (255);
  text("COME AND SAY HELLO, we'll put your picture on hippocamp.net", 150, 270);
}

 
cheers, jon
« Last Edit: Sep 15th, 2004, 3:18am by bsr »  

http://hippocamp.net
bsr

WWW Email
Re: camera kiosk/booth video thingy
« Reply #1 on: Sep 15th, 2004, 12:41pm »

oh, if you run that code be sure to comment out the saveFrame() line... unless you want a directory full of images
 
thinking about it wouldn't saveFrame(x, y, width, height) be a really useful addition to the syntax?
 

http://hippocamp.net
Pages: 1 

« Previous topic | Next topic »