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
'Laughing Mirror' trough video capture (Read 778 times)
'Laughing Mirror' trough video capture
Jun 30th, 2009, 6:39am
 
For an assignment for school I have to make a program that allows you to morph your face with use of a webcam, by using a bright green handshoe.

For now I have a script for recognizing the green handshoe and a script where you can adjust the color the program needs to follow. the program also returns a number of the place of the pixel the program follows.

So far I understand it. But what I don't know is how I can make the program morph the webcamimage it receives. Can anyone get me started, or tell me which command to use for morphing the image, or has a link to a useful tutorial?

This is what the program should do:
platzak.com/portrait.jpg

and this is the code I have so far:
Code:

import processing.video.*;
Capture myCapture;
color trackColor = color(0,255,0);
int plek = 0;

void setup()
{
 size(320 , 240);
 myCapture = new Capture(this, width, height, 30);
}

void captureEvent(Capture myCapture) {
 myCapture.read();
}

void draw() {
 myCapture.loadPixels();
 for (int i = 0; i < myCapture.pixels.length; i++) {
   if(myCapture.pixels[i] == trackColor) {
     plek = i;
   }
 }
 myCapture.updatePixels();
 image(myCapture, 0, 0);
 fill(trackColor);
 rect(10, 10, 10, 10);
 println(plek);
 
}

void mousePressed() {
 trackColor = get(mouseX, mouseY);
}



I'm relative new to processing so I have some difficulty understanding all the commands, though I have some experience in writing in  actionscript 2.0. I searched the web for some tutorials or something like that, but did not found something useful.

I really hope someone can help me, my diploma depends on it.. ;)
Re: 'Laughing Mirror' trough video capture
Reply #1 - Jul 6th, 2009, 9:33pm
 
Hi,
I dont really understand what is what you want to create, the image you sen is not loading
Ill be happy to help
Page Index Toggle Pages: 1