5
votes

I am currently detecting heads in a CCTV image. I am using a HOG detector + SVM and I am using the sliding window technique to detect the heads. Of course, when I am scaling the image, I am having multiple detection/bounding boxes of the same head. I know that I have to use non-maxima suppression to choose the best one of them, and I have tried to follow the following link: http://quantombone.blogspot.com/2011/08/blazing-fast-nmsm-from-exemplar-svm.html

However, I cannot understand how to get the score for each sliding window. Can someone explain to me please? In other words, I have the bounding boxes pts and I know that I have to set an overlap of 0.5, but I do not have the score for each bounding box.

2
Its the score of prediction given by the classifier, I suppose. For SVM, if you use LibSVM, that score could be the probability estimate which it outputs. The score is the probability that the object (say car) is contained in that box.Autonomous
Who is detecting Windows MATLAB, why is it being suppressed, and how is that different from Linux MATLAB or Mac MATLAB? (It seems like the word "MATLAB" is very out of place in your title)Ben Voigt
@ParagS.Chandakkar yes after doing some good research I agree with you, infact I used the parameter 'b 1' to output the probabilities. However when outputting the probabilities on the console, I noticed that for each prediction 2 probabilities were given instead of 1. Can I clear this out with you please? Thanks a lotuser2541516
There are two probabilities. One is for class 0 and other is for class 1. Both will sum to one. You can check.Autonomous
Brilliant, I have 2 classes +1 and -1 which represent a head and a non-head respctively. So regarding the score for the NMS, which probability should I choose please? Thanks for your assistance @ParagS.Chandakkaruser2541516

2 Answers

5
votes

Actually for non-maximum suppression you don't need the score associated to each bounding box. You can use the well-known NMS method of Viola and Jones (Boosted cascade of simple features):

  • cluster all bounding box that have overlap with each other greater than 0.5
  • for each cluster calculate the mean bounding box and output it (that is calculate the mean point between all top right corners and all bottom-right corners)

And you have non-maximum suppression.

If you still want to use other routines that require output scores, then just assign to each bounding box the same score.

2
votes

You should be able to get a score out of the SVM. For example, if you train the SVM using ClassificationECOC class in the Statistics Toolbox, its predict method can return the score.

Then you can use the selectStrongestBbox function in the Computer Vision System Toolbox to do non-maxima suppression.