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 › Real-Time Chronotopic Anamorphosis
Page Index Toggle Pages: 1
Real-Time Chronotopic Anamorphosis (Read 9610 times)
Real-Time Chronotopic Anamorphosis
Jun 13th, 2008, 8:42pm
 
This project was made more as a programming exercise intenting to transpose the effect accomplished by Zbigniew Rybczynki in his film "The Fourth Dimension" to real-time video.

Roughly explained, the image captured has its frames fragmented into horizontal lines which are then stored into an array. The image displayed is a combination of lines from different frames, distorting objects and people by their own motion in time.

It is kind of heavy (for all the data stored and read at each frame) which creates some bugs in the image, but it's still fun.

A test video is available at http://www.vimeo.com/1163538

This experiment was made within the context of marginalia project (http://marginalia-project.blogspot.com).

Code:

import processing.video.*;
MovieMaker movie;

boolean rec;
int n;
int varZero;
int prevN;
int prevZero;
int numPixels;
int prevPixels;
int[] prevLines;
Capture video;

void setup(){
size(320, 240);
frameRate = 30;
video = new Capture(this, width, height, 72);
numPixels = video.width * video.height;
//Sets the number of pixels to be stored using
//an algebric progression formula related
//to the number of lines to be stored.
prevPixels = ((numPixels*(height+1))/2);
//Sets the array to store these pixels.
prevLines = new int[prevPixels];
movie = new MovieMaker(this, width, height, "rybczynski.mov",
72, MovieMaker.ANIMATION, MovieMaker.LOSSLESS);
//Sets the movie recording function off by default.
rec=false;
loadPixels();
noStroke();
}


void draw(){
if (video.available()){
video.read();
video.loadPixels();
//For each line of the image:
for (int y=1; y<height; y++){
//Declares the value of 'n', which will be used to index
//to which of the "lines" stored for line 'y' shall the software
//access to store current frame's line 'y'.
n=(frameCount%y);
//Indexes to the begining of the "line" in which to store
//the current frame's line 'y' using an algebric progression
//formula based on 'y' var and the indexing gave by 'n' var.
varZero= round((n*width)+(((sq(y)+y)*width)/2));
//Declares the value of 'prevN'. This var will
//index to stored "line" the software shall
//read to display at current frame's line 'y'.
prevN=((frameCount-(y-1))%y);
//Indexes to the begining of the "line" that the software
//shall read to display currently at line 'y'. Uses the
//same process of varZero expression, but with other vars.
prevZero=round((prevN*width) +(((sq(y)+y)*width)/2));
//For each pixel in line 'y':
for (int i=1; i<width; i++){
//Declares a 'ind' var based on 'y' and 'i'
//to index the displayed pixels.
int ind=((y*width)+i);
//Stores each pixel of line 'y' of current frame
//captured from real-time video.
prevLines[varZero+i]= video.pixels[ind];
//Reads and displays the proper line of pixels from
//the data stored.
pixels[ind]=prevLines[prevZero+i];
}
}
updatePixels();
if (rec==true){
movie.addFrame();
}
}
}

void keyPressed (){
//If SPACE key is pressed and recording is off, turn it on.
if (key==' ' && rec==false){
rec=true;
println("REC");
}
//If SPACE key is pressed and recording is on, turn it off.
else if (key==' ' && rec==true){
rec=false;
println("PAUSE");
}
//If ESCAPE key is pressed, finish movie.
else if (key==ESC){
movie.finish();
println("STOP");
}
}
Re: Real-Time Chronotopic Anamorphosis
Reply #1 - Jun 13th, 2008, 8:54pm
 
very nice!
Re: Real-Time Chronotopic Anamorphosis
Reply #2 - Jun 14th, 2008, 12:56am
 
Looks great! I'd developed a similar app in Quartz Composer (with no where near as nice a demonstration Tongue), and a visitor informed me that the technique was called (among other things) slit-scanning, and i was given this link
http://www.flong.com/texts/lists/slit_scan/

which has some amazing examples (including the fourth dimension), if you haven't come across this site I thought you may appreciate it!
Re: Real-Time Chronotopic Anamorphosis
Reply #3 - Jun 14th, 2008, 8:29am
 
Interesting, particularly the part with the door... I recognize well there Zbigniew Rybczynki's style, even if I haven't seen <i>The Fourth Dimension</i>.
Re: Real-Time Chronotopic Anamorphosis
Reply #4 - Jun 14th, 2008, 5:07pm
 
good work.

reminds me of:
http://www.tx-transform.com/Eng/index.html

Re: Real-Time Chronotopic Anamorphosis
Reply #5 - Jul 1st, 2008, 4:11pm
 
Is there a way to compile it and play it??
That test video was really nice!
The code is in C sharp or C++?
Nice work! Smiley
Re: Real-Time Chronotopic Anamorphosis
Reply #6 - Jul 1st, 2008, 4:15pm
 
Umm, it's in processing.. the language this is the discussion forum for.
Re: Real-Time Chronotopic Anamorphosis
Reply #7 - Jul 3rd, 2008, 2:52am
 
when run the Sketch, I get this:

java.lang.NoClassDefFoundError: quicktime/std/StdQTException

at Temporary_2563_3785.setup(Temporary_2563_3785.java:17)

Im realy newbie in this!
Re: Real-Time Chronotopic Anamorphosis
Reply #8 - Jul 4th, 2008, 9:56pm
 
julioacevedo wrote on Jul 3rd, 2008, 2:52am:
java.lang.NoClassDefFoundError: quicktime/std/StdQTException

Have you installed the QuickTime software, per Video library instructions
Re: Real-Time Chronotopic Anamorphosis
Reply #9 - Jul 6th, 2008, 5:41am
 
I have quicktime with itunes....I play a video...and then I run the Scketch...and get that error....

Does someone know how to get this effect!?
http://www.vimeo.com/1163538

because the code is here....but how i gonna to use it

I already have processing 0135.
Re: Real-Time Chronotopic Anamorphosis
Reply #10 - Nov 4th, 2008, 4:58pm
 
Has anyone figured out how to get a bigger video frame?  I suppose it may be limited to my camera, but it would be nice to have a higher rez image.  Also, can someone easily direct me to how one can change cameras?  I'm using a macbook pro and would like to try other cameras besides the one built in.

Re: Real-Time Chronotopic Anamorphosis
Reply #11 - Jun 16th, 2009, 2:22am
 
hey.

if i look through the code, i don't find anything wrong. if i hook up a miniDV cam into it, the slitscan effect is disturbed with 'misplaced' horizontal pixel rows (approx every 30th line is from an earlier grab)

anyone know the reason? (i raised the memory limit, still i have some rows lost in time)
is the DV too heavy for it?

thx

krisztián
Re: Real-Time Chronotopic Anamorphosis
Reply #12 - Jun 16th, 2009, 2:33am
 
this is what i mean. (sorry, forum doesnt allow picture links)

aion.freeblog.hu/files/bike.jpg
Re: Real-Time Chronotopic Anamorphosis
Reply #13 - Jul 6th, 2009, 9:11pm
 
This is great this is a nice effect to use in filml or something where you want to show distortions in time or in perception
Nice.
Page Index Toggle Pages: 1