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.
IndexDiscussionExhibition › building time-image with iSight
Page Index Toggle Pages: 1
building time-image with iSight (Read 2790 times)
building time-image with iSight
Jun 12th, 2007, 3:14pm
 
simple program that builds up an image from your iSight cam through time.

import processing.video.*;
Capture myCapture;
int a=50; //stepsize x
int b=1; //stepsize y
int x=0;
int y=0;
int xres = 480;
int yres = 360;
int s = second();
void setup(){
 size((2*xres+50) , yres);
myCapture = new Capture(this, xres, yres, 25);
}
void captureEvent(Capture myCapture) {
 myCapture.read();
}
void draw(){
image(myCapture, 0, 0);

loadPixels();

   if(true){
        x+=a;
      int dx = xres+50+x;
      int dy =y;
          copy(x,y, a, b, dx,dy, a, b);
           if(x>xres){
             x=0;
             y+=b;
          }
          if(y>=yres) {
            y=0;
            saveFrame("####.jpeg");
          }      
      }
  }
Re: building time-image with iSight
Reply #1 - Jun 13th, 2007, 6:14am
 
Neat.  If i'm reading it right it's a tiled view... similiar to how some digital cameras write lower-res "burst mode" frames to a single image?

I've been wanting to write one that mimics a long film exposure... building up an image over time by "exposing" the pixels.  I'm sure it's easy... but i'm brand new to processing... so much to learn and absorb.

I do love Kyle Mcdonald's AmbientLapse code though, similiar approach to what I want to do... but creates a motion blurred time-lapse instead.

http://www.rpi.edu/~mcdonk/AmbientLapse/
Re: building time-image with iSight
Reply #2 - Jun 15th, 2007, 4:32pm
 
Yeah, you read it right.. I'm playing now with speed and pixelsize to see if something interesting will come out... Thanks for the link, it's helpfull. I am still searching for more references on imaging & video, especially in public space. (I am currently working at the Technical University in Eindhoven at the faculty of design doing a masters project).

regards,

tjerk timan

mail@tjerktiman.nl
Re: building time-image with iSight
Reply #3 - Jun 16th, 2007, 8:09pm
 
Another project that stacks images captured from a webcam is "Timescape" (http://phantasian.com/timescape/timescape.htm). Instead of tiling, it takes a single-pixel-wide slice and builds a sort of time-panorama.
Re: building time-image with iSight
Reply #4 - Jun 17th, 2007, 3:48am
 
Thanks for that link... very cool results from video stream processing.  Reminds me of slit-scanning a bit... and rolling-shutter effects... something else i'm quite into.
Re: building time-image with iSight
Reply #5 - Jun 18th, 2007, 1:34pm
 
A similar project with live- video is called TimeLine... very nice.

http://grouplab.cpsc.ucal
gary.ca/papers/2006/06-TimelinesVideo-Nunes-CSCW/abstract.html

Regards,

Tjerk
Re: building time-image with iSight
Reply #6 - Jun 18th, 2007, 10:29pm
 
Interesting project... that effectiveness at video analysis is a bit scary though.  But still inspiring stuff.

That url again non wrapped:
http://tinyurl.com/2fa8at
Re: building time-image with iSight
Reply #7 - Sep 14th, 2008, 1:37am
 
Hi Tjerk,

This is my version of the code. I guess it coud be optimized but is easy to read in spanish ;)


/*

TimeTwist por Herbert Spencer
Se basa en el concepto la cuarta dimensión por Zbig Rybczynski, 1988

*/

import processing.video.*;

Capture fotograma;
MovieMaker pelc;
PFont px;
PImage[] buffer;
PImage timeTwist;
boolean buffering;
boolean record;
int count;


void setup() {
 size(320, 240);
 //frameRate(60);
 fotograma = new Capture(this, width, height, 24);
 px = createFont("Georgia", 16);
 textFont(px);
 textAlign(CENTER);
 buffering = true;
 buffer = new PImage[height];
 count = 0;

 noStroke();
 fill(255);
}


void draw() {
 if ((fotograma.available() == true) && buffering) {

   fotograma.read();
   buffer[count] = fotograma.get();
   if(count == (height-1)){
     buffering = false;
     timeTwist = fotograma.get();
     //print("done buffering!");
   }
   else{
     //print(count+", ");
     count++;
     background(0);
     rect((width/2)-40, height - count, 80, count);
     text("buffering",(width/2), (height - 8) - count);
   }
 }

 if((fotograma.available() == true) && !buffering){

   // correr todos los valores a la izquierda
   for (int i = 1; i < height; i++){
     buffer[i-1] = buffer[i];
   }

   // poner el nuevo valor al final
   fotograma.read();
   buffer[height-1] = fotograma.get();

   // construir el fotograma "diagonal"
   loadPixels();
   for (int y = 1; y < height; y++){
     for(int x = 0; x < width-1; x++){
       pixels[(width*y) + x] = buffer[y].pixels[(width*y) + x];
     }
   }
   updatePixels();
   //background(timeTwist);
   if(record){
     pelc.addFrame();
   }
 }
}

void keyPressed(){
 if(key == ' '){
   String filename = "movs/"+month()+"-"+day()+"-"+hour()+"-"+minute()+".mov";
   pelc = new MovieMaker(this, width, height, filename, 24, MovieMaker.SORENSON, MovieMaker.HIGH);
   record = true;
   println("GRABANDO");
 }
 if((key == 'q')||(key == 'Q')){
   pelc.finish();
   println("LISTO");
   exit();
 }
}
Re: building time-image with iSight
Reply #8 - Sep 18th, 2008, 12:25pm
 
Hi Herbert,

Muchos Gracias! Here's the wired link, in case you didn't catch it yet: http://blog.wired.com/sterling/2008/09/eye-candy-done.html

regards,

tjerk
Page Index Toggle Pages: 1