I'm trying to blur the faces of all people detected by the webcam. The problem is that when the webcam detect a face the program shows the crop mat with the blur face.
I tried to put the blur face into the original mat but it doesn't work.
for(Rect rect : faces.toArray()){
Imgproc.rectangle(frame, rect.tl(), rect.br(), new Scalar(0,0,255),3);
Rect rectCrop = new Rect(rect.x, rect.y , rect.width, rect.height);
Mat imageROI = grayFrame.submat(rectCrop);
//frame is the original mat with the correct size
Imgproc.GaussianBlur(imageROI, frame, new Size(55, 55), 55);
}
No face detection:
With face detection: