フィルターのクリア

Issue about how to detect faces of people in image.

1 回表示 (過去 30 日間)
Sercan Noyan Germiyanoglu
Sercan Noyan Germiyanoglu 2017 年 3 月 29 日
Hi, I want to calculate the number of people in any image. I wrote the code by using face detection to do it.While the code run correctly in some pictures, other pictures were calculated wrongly the number of people in any image. How can I fix it. I share my code here with some pictures.
% Read the image
A = imread('face3.jpg');
% Get FaceDetector Object with no inputs
FaceDetector = vision.CascadeObjectDetector();
% Use FaceDetector on A and get the faces
BBOX = step(FaceDetector, A);
% Annotate these faces on the top of image
B = insertObjectAnnotation(A,'rectangle',BBOX,'Face');
imshow(B),title('Detected Faces');
% Dispaly the number of faces in a string
n=size(BBOX,1); % getting number of faces by the size of bounding box
string_name = num2str(n); % convert number to string
str = strcat('Number of detected faces are ',string_name); % concatenation of two string
disp(str);

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by