Face Detection Using Matlab
Face Detection Using Matlab
Face Detection Using Matlab
Matlab
(VOILA-JONES ALGORITHM
Face Detection is the process of distinguishing faces from non
faces of one or more people in images or videos by analysing
and comparing patterns.
Robust
Real time
Adaboost Training
Cascading Classifiers
MATLAB implementation of Viola–
Jones algorithm
%To detect Face
FDetect = vision.CascadeObjectDetector;
%Read the input image
I = imread('ironman.jpg');
%Returns Bounding Box values based on number of objects
BB = step(FDetect,I);
figure,
imshow(I); hold on
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',5,'LineStyle','-','EdgeColor','r');
end
face=imcrop(I,BB);
figure,imshow(face);
title('Face Detection');
hold off;
MATLAB implementation of Viola–
Jones algorithm
%To detect Nose
NoseDetect = vision.CascadeObjectDetector('Nose','MergeThreshold',16);
BB=step(NoseDetect,I);
figure,
imshow(I); hold on
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',4,'LineStyle','-','EdgeColor','b');
end
title('Nose Detection');
hold off;
MATLAB implementation of Viola–
Jones algorithm