Ask Your Question
1

Retrieve HOG Detector scores

asked 2014-05-26 15:42:30 -0600

Yamaneko gravatar image

updated 2018-01-30 03:49:42 -0600

I'm using the default HOG Detector to detect pedestrians, such as in the code below.

HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
vector<Rect> found, found_filtered;
hog.detectMultiScale(data, found, 0, Size(strideX,strideY), Size(32,32), scale, 2);

I want to retrieve the score that the classifier assigned to each sample. For instance, found[0] has 0.9 confidence to be a pedestrian; found[1] has 1.3 confidence score; and so on. I want these because I will use them to make a plot missrate vs false positives per image (FPPI).

Is there any way to retrieve the classifier responses for each sample?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2014-05-27 04:02:36 -0600

Siegfried gravatar image

Hi Yamaneko, you use

void HOGDescriptor::detectMultiScale(const Mat& img, vector<Rect>& foundLocations,double hitThreshold, Size winStride, Size padding, double scale0, double finalThreshold, bool useMeanshiftGrouping)

But there is another function with the same parameters and an additional vector containing the weight for each detected rectangle (see HOGDescriptor source file))

void HOGDescriptor::detectMultiScale(const Mat& img, vector<Rect>& foundLocations, vector<double>& foundWeights, double hitThreshold, Size winStride, Size padding, double scale0, double finalThreshold, bool useMeanshiftGrouping)
edit flag offensive delete link more

Comments

Thank you, Siegfried! I totally missed that. It is not a documented feature, though :)

Yamaneko gravatar imageYamaneko ( 2014-05-27 19:26:48 -0600 )edit
1

Thanks! Been looking for this one for a while now. HOG documentation needs to be adapted better soon than later!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-16 03:05:17 -0600 )edit

Question Tools

Stats

Asked: 2014-05-26 15:42:30 -0600

Seen: 1,192 times

Last updated: May 27 '14