Clear Filters
Clear Filters

I am using vision.Cas​cadeObject​Detector to count no. of faces in an image, however it is not counting all the faces. Any help would be appreciated .

2 views (last 30 days)
So, below is my code to count number of faces using vision.CascadeObjectDetector but it isn't counting all the faces in the image. Kindly help.
a=imread ('images.jpg');
imshow (a)
size (a)
face_detector= vision.CascadeObjectDetector();
bbox= step(face_detector, a);
b= insertObjectAnnotation( a,'rectangle', bbox, 'face');
imshow(b), title( 'detected faces' );
n= size(bbox,1);
str_n= num2str(n);
str= strcat( 'Number of faces are ', str_n);
display(str);

Answers (0)

Community Treasure Hunt

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

Start Hunting!