Face detection and blur

5 views (last 30 days)
daniel daniel
daniel daniel on 13 Oct 2015
Edited: daniel daniel on 13 Oct 2015
Hi guys. I am having trouble understanding the code about the Matlab
a = imread('Untitled2.png');
faceDetector = vision.CascadeObjectDetector;
bbox=step(faceDetector,a);
for j=1:size(bbox)
xbox=bbox(j,:);
subImage = imcrop(a, xbox);
H = fspecial('disk',10);
blurred = imfilter(subImage,H);
a(xbox(2):xbox(2)+xbox(4),xbox(1):xbox(1)+xbox(3),1:end) = blurred;
end
imshow(a);
Can anyone please kindly explain me that what is the for loop doing? I tried to use my own method to blur the face that I detected, but I just manage to crop out the face and blur the cropped image but I don't know how to put it back to original image. Then I tried to use the source code above I get from internet and the internet source code is able to blur the face and I can't understand the for loop logic. Kindly please explain to me, T^T.
Thanks.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!