Face Detection In MATLAB through its codes...
for face Detection in an image the Following steps will help you how to detect a face in an image...
STEP1; First Open MATLAB program...
STEP2; Go to the Directory where the Image you want to detect face in it... and The Image must have the Name "picture" and its format must be JPG for the following Codes...
STEP3; Go to Home Menu ==> Click On "New Script"
STEP4; Write the Follow Codes in That Script...
FDetect = vision.CascadeObjectDetector;
image = imread('picture.jpg');
subplot(1,2,1),imshow(image);
BB= step(FDetect,image)
subplot(1,2,2),imshow(image);
hold on
for i=1:size(BB,1)
rectangle('position',BB(i,:),'LineWidth',2,'LineStyle','--','EdgeColor','r');
end
title('Face Detector');
hold off;
STEP5; Save the Script with the name "facedetector" in the Folder/ Directory where the image is already saved...
STEP6; now write "facedetector" in matlab program and it will detect the face in the image.
No comments:
Post a Comment