i have trained the cascade object detector to detect fists. But now I want to count the number of fists and display. Is there any way using vision toolbox ? please suggest me the steps

조회 수: 8 (최근 30일)
Want function names or an algorithm which will count the number of objects detected (i have trained cascade object detector to detect my fist)

채택된 답변

Anand
Anand 2014년 10월 9일
If you have already trained a cascade object classifier, you should already have an output XML file containing the classification model as created by trainCascadeObjectDetector.
Now specify this XML file as the classification model when using the vision.CascadeObjectDetector.
As an example, if the XML file is fist.xml
% associate fist.xml classification model to Cascade Object Detector
fistDetector = vision.CascadeObjectDetector('fist.xml');
% run the classifier on image im and return bounding boxes of fists.
fistBBox = step(fistDetector, im);
% display fists on image
imFist = insertObjectAnnotation(im,'rectangle',fistBBox,'Fist');
figure, imshow(imFist)
  댓글 수: 3
Anand
Anand 2014년 10월 9일
numFists = size(fistBBox,1);
imFistWithNum = insertText( insertObjectAnnotation(im,'rectangle',fistBBox,'Fist'), [5 5], numFists );
figure, imshow(imFistWithNum);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by