i am using the face detection library's standard example to make a sketch that takes the face of one detected face and puts it in the place of another detected face thereby shifting faces around.
right now i have the standard function of draw faces like this:
Code:void drawFace() {
int [][] res = face.getFaces();
if (res.length>0) {
for (int i=0;i<res.length;i++) {
int x = res[i][0];
int y = res[i][1];
int w = res[i][2];
int h = res[i][3];
rect(x,y,w,h);
}
}
}
and what i think about is to add
Code:faceImage= get( res[i] [0],res[i] [1],res[i] [2],res[i] [3]);
with faceImage being PYImage object.
but that would only let me do one picture so i need a way to make an array of PYImages like faceImage [i]
and in the end i would need a function to detect first if there is an even number or uneven.
pseudo code:
if even switch al faces with the face plus 1 and last face = face 0
or something
if uneven the same as above for the biggest even number and the last one gets his face switched with a pre recorded face video.
if you guys can help me anything of the above i say thanks!
kind regards johannes