How can I remove the excess object detected?

2 views (last 30 days)
I'm working on my face detection, but in some pictures of mine, the nose detect two objects, but in other picture its fine, how can I remove the excess detection in the nose? Here's my code and the pictures I'am working on.
clear all clc %Detect objects using Viola-Jones Algorithm
%To detect Face FDetect = vision.CascadeObjectDetector;
%Read the input image I = imread('sample.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
%To detect Nose NoseDetect = vision.CascadeObjectDetector('Nose','MergeThreshold',16);
BB=step(NoseDetect,I);
for i = 1:size(BB,1) rectangle('Position',BB(i,:),'LineWidth',4,'LineStyle','-','EdgeColor','b'); end title('Nose Detection'); hold off;

Answers (0)

Community Treasure Hunt

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

Start Hunting!