display of the faces :
http://393heq.bay.livefilestore.com/y1pcXHbmb9vNturyZDVPU0XF7nRvnfnKw7LA8L4lDyFmnoteUM6B5NPTFBpeizUP-Il_99bf7bkNXRPRWSFglfdwg/Face_Living_Form.rar?download
/**
*** Face Living Form
*** By Julien Odeur
*** 2008
**/
Photo[] photos = new Photo[0];
int count = 0; // Total # of images
void setup () {
size (640,480);
smooth();
}
void draw (){
background (0);
// test if new capture##.gif and if new one add it to the photos
if (loadImage("Capture"+count+".tiff")==null) {
}else {
Photo b = new Photo ("Capture"+count+".tiff",random(50,590),random(50,430));
photos = (Photo[]) append (photos,b);
count++;
}
for (int i = 0 ; i<count; i++) {
photos[i].move();
photos[i].display();
}
}
class Photo {
PImage head; // A variable for the image file
float x,y; // Variables for image location
float w,h;
float rot; // A variable for image rotation
Photo(String filename,float tempX,float tempY) {
head = loadImage(filename);
x = tempX;
y = tempY;
}
void display(){
imageMode(CENTER);
image(head,x,y);
rect(x,y,20,20);
}
void move() {
// Adjust variables for animation
x = x + random(-1,1);
y = y + random(-1,1);
// Constrain to window
x = constrain(x,0,width-50);
y = constrain(y,0,height-50);
}
}
and you need also the OpenCv library from here : http://ubaa.net/shared/processing/opencv/
how to use thoses program :
1.launch the Face_living_Form.pde
2.launch the NoFace.pde (or .exe but not fully tested yet)
3.it will ask for directory to save ,so you have to find the "Capture" folder that you can find in the Face_living_Form directory (or if you have paste the code from here you have to create in the Face_living_Form folder , a folder called Capture )
4.In the Noface program , i you press a key while running , it will save the background so the square appearing on your face will show this background and make your face disparear
5.show your face to the webcam and after having a black rectangle(or the "background") on it for 2-4 sec it will take a snapshot and normaly this snapshot will display in the Face_living_Form windows
I know there is alot of good programmer here and i really need help because i need to show thoses programs running next week for my study and i tryed everything i could think and i start going mad ...
also if you see others improvements don't hesitate to show me because i'm a noob