Face Detection
We implemented the first four steps of the flowchart:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKK8okk7dTRKFyaxJcJeRAtMZCLEAXaq4zCBlSDoevNminSphtw4tqKjFKMISXV5wBMYuGr6XWpZywS_p_08geMW_YsIcex9bVRo5IY5LBvLjuxvLL-EoTU7aQqYaBilI1hfA5DuYtM5M/s320/img2.JPG)
We used the VideoReader and read functions in matlab to read a video and extract every frame of the video.
We used the inbuilt functions in Matlab for face detection based on the Viola Jones algorithm - https://in.mathworks.com/help/vision/ref/vision.cascadeobjectdetector-class.html
CODE:
clc;
blink = VideoReader('blinky2.mp4');
for img = 290:291;
b = read(blink, img);
FDetect = vision.CascadeObjectDetector;
I = b;
BoundBox = step(FDetect,I);
figure,
imshow(I); hold on
for i = 1:size(BoundBox,1)
rectangle('Position',BoundBox(i,:),'LineWidth',5,'LineStyle','-','EdgeColor','r');
end
for i = 1:size(BoundBox,1)
J= imcrop(I,BoundBox(i,:));
hold off;
imshow(J);hold on
end
end
Comments
Post a Comment