用MatLab计算房间里的人数,但用Viola算法做不到。有人能帮帮我吗?
%Detect objects using Viola-Jones Algorithm
%% CODE FOR PEOPLE COUNT BASED ON FACES
%get the input image
I=imread('DCN.jpg')*2;
imshow(I),title('Image:1');
J = rgb2gray(I);
%To detect Face
FDetect = vision.CascadeObjectDetector;
% Returns Bounding Box values based on number of objects
BB = step(FDetect,J);
figure,
%detectedImg = insertObjectAnnotation(J,'rectangle',BB,'stop sign');
%
imshow(J); hold on
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',2,'LineStyle','-','EdgeColor','y');
end
title('Face Detection');
hold off;
numberOfBlobs = length(BB);
message = sprintf('Done by Abhishek.\nThe number of persons = %d', numberOfBlobs);
uiwait(helpdlg(message));发布于 2017-01-15 05:11:32
您可以使用另一种众所周知的算法进行行人检测,使用HOG svm。请看下面的Matlab教程。https://www.mathworks.com/help/vision/ref/vision.peopledetector-class.html
https://stackoverflow.com/questions/41657836
复制相似问题