detectMultiScale: Using rejectLevels and levelWeights

asked 2013-02-11 20:37:10 -0600

nessence gravatar image

updated 2013-02-14 14:25:55 -0600

I have multiple classifiers and some objects look similar to others, so I would like to use rejectsLevel/levelWeight values to pick the most confident result.

How can I use the numbers provided by rejectLevels and levelWeights to "reject" results, similar to how the default detectMultiScale performs rejections?

Using detectMultiScale w/rejectLevels and levelWeights isn't documented and is not as greedy with regard to rejects. In other words, when I use detectMultiScale method with rejectLevels/levelWeights, I get back a ton of results which are normally not found.

Update: After digging into the code, these values aren't usable for the objective described above. The current implementation groups pass and fail rectangles and the most pertinent class methods and members are protected and/or private.

edit retag flag offensive close merge delete


Did you finally find a method to pick the most confident result? Did you try to use the overlapp of detections to compute the score/confidence?

vinayverma gravatar imagevinayverma ( 2013-05-08 08:21:06 -0600 )edit

There seems to be a bug in groupRectangles which seems to prevent the detected objects from grouping if you call the undocumented version of detectMultiScale. Unfortunately there doesn't seem to be any way around this, right now. I've filed a bug report here:

achal gravatar imageachal ( 2013-05-31 17:39:00 -0600 )edit

@vinayverma: This is exactly what I did. @achal: I think the comments on the bug are accurate in that this method isn't for detection.

I made some modifications which let me use the reject levels and weights but it's limited in production use until I determine how to properly combine the rejectLevels and weights with training parameters so the values are normalized. I'll eventually get these optimizations into opencv. Sponsors welcome ;)

nessence gravatar imagenessence ( 2013-07-10 09:12:24 -0600 )edit