Ask Your Question

Revision history [back]

Displaying an image (in a specified location) over a video stream

Hi I am having trouble figuring out what function to use to display an image (test_image.jpg) over my webcam stream, sort of like a filter over the users face.

I have already figured out how to implement facial detection and I am able to display a circle over the face and as the face moves the image moves as well, but I want to know how to put an image over the face instead of the circle.

This is what I have to display a circle over the face:

Point center = Point(faces[i].x + faces[i].width0.5, faces[i].y + faces[i].height0.45);

circle(captureFrame, center, faces[i].width / 1.65, cvScalar(255, 0, 0, 0), 50, 8, 0);

imshow("outputFrame", captureFrame);

Thank you so much for the help!!