
pixels in the mustache image and create a mask and an inverted
mask.
After capturing the image, you must write it to a file and then
reopen it for editing. The raw image fresh from the capture is
non-editable, even by sudo.
This finds the mouth(s) in the grayscale image, using the Haar
cascade.
This determines a
region of interest
(ROI) above the mouth
where we are going to place the mustache.
This masks the face with the mustache image.
This masks the non-mustache portion of the mustache image
with the portion of the face image that lies within the ROI.
This line literally adds the two images together.
Finally, replace the