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.
Page Index Toggle Pages: 1
quick and simple question (Read 1140 times)
quick and simple question
Sep 19th, 2006, 8:16am
 
what is the simplest way to mirror image a live video feed?
Re: quick and simple question
Reply #1 - Sep 19th, 2006, 2:05pm
 
I dont know if is the easiest way, but i think its the fastes: http://www.codetree.org/artwork/art.php?id=140. Take a look at the image and source.
Re: quick and simple question
Reply #2 - Sep 25th, 2006, 8:14am
 
thanks for the reply. and ive worked it out. quite simple really.
your code there might come in handy as i get further into this project. cheers.

for (int i=0; i < width; i++) {
PImage oneColumn = cameraImage.get(width-i-1,0,1,height);
image(oneColumn,i,0);
}
Re: quick and simple question
Reply #3 - Sep 25th, 2006, 5:04pm
 
Creating new PImage's inside draw(), if the program is animating, is very slow. It's better to make an array of PImage objects and to put the result of get() into the array:

Code:

// Code needed above to set: columns = PImage[width]
for (int i=0; i < width; i++) {
columns[i] = cameraImage.get(width-i-1,0,1,height);
image(columns[i],i,0);
}
Re: quick and simple question
Reply #4 - Sep 26th, 2006, 3:01am
 
awesome. i've got that working nicely. thanks a lot for the advice. very much appreciated.

nathan

Re: quick and simple question
Reply #5 - Oct 25th, 2006, 2:43pm
 
nice share,thxs
Re: quick and simple question
Reply #6 - Aug 21st, 2007, 10:42am
 
Hi, i dig up this topic because i have found a faster solution to mirror a webcam video stream or an image and i couldn't find any similar example on the board.

Hope this will be helpful. Smiley

Quote:
void draw() {
// your data here.

Mirror(); // this replaces image(video,0,0,width,height);

// your data here.
}

void Mirror() {
beginShape(QUADS);
textureMode(IMAGE);
texture(video); // replace "video" by your "Capture" declared name or your PImage name.
vertex(0,0,width,0);
vertex(width,0,0,0);
vertex(width,height,0,height);
vertex(0,height,width,height);
endShape();  
}
Page Index Toggle Pages: 1