Img. array + faces array
in
Contributed Library Questions
•
2 years ago
hi all masters out there,
I have been successful in doing face tracking using openCV. I know there are lot of people who have already achieved it before even I learnt processing, but its a big thing for me to make it working. now the next step for me is to assign an image to the face detected. I have a set of five images, of which I have made an array as following,
images[0] = loadImage("img1.gif");
images[1] = loadImage("img2.gif");
images[2] = loadImage("img3.gif");
images[3] = loadImage("img4.gif");
images[4] = loadImage("img5.gif");
I will be assigning the images to faces with as following
image (images[index],faces[i].x, faces[i].y, faces[i].width, faces[i].height );
the above piece of code displays all the images sequentially over the face.
The part which I am not able to do :
I want to assign img.1 to the 1st face detected then randomly assign img. 4 to face 4 detected. now when the face 1 goes out of the camera range the img. 1 assigned to the face should fade out. If the same face(or another face) is detected again then a new image(randomly) should be assigned.
sometimes simple things become very complicated, I know exactly what I want to do but simply not able to put it together so that my machine can understand.
I will be very thankful for your help,
Thanks in advance
I have been successful in doing face tracking using openCV. I know there are lot of people who have already achieved it before even I learnt processing, but its a big thing for me to make it working. now the next step for me is to assign an image to the face detected. I have a set of five images, of which I have made an array as following,
images[0] = loadImage("img1.gif");
images[1] = loadImage("img2.gif");
images[2] = loadImage("img3.gif");
images[3] = loadImage("img4.gif");
images[4] = loadImage("img5.gif");
I will be assigning the images to faces with as following
image (images[index],faces[i].x, faces[i].y, faces[i].width, faces[i].height );
the above piece of code displays all the images sequentially over the face.
The part which I am not able to do :
I want to assign img.1 to the 1st face detected then randomly assign img. 4 to face 4 detected. now when the face 1 goes out of the camera range the img. 1 assigned to the face should fade out. If the same face(or another face) is detected again then a new image(randomly) should be assigned.
sometimes simple things become very complicated, I know exactly what I want to do but simply not able to put it together so that my machine can understand.
I will be very thankful for your help,
Thanks in advance
1