Make detectMultiScale return number of neighbors joined into each object (Feature #3067)
Description
When CascadeClassifier::detectMultiScale is used to detect the location of a specific object, e.g. an eye, there is a problem of false positives: the user has to choose which of the detected objects they will accept as the desired one. Returning some measure of confidence for each object would be of much use here. I suggest adding a vector<int> parameter that will store the number of neighbors that each detected object had.
Associated revisions
Merge pull request #3067 from vpisarev:minor_fixes2
History
Updated by Daniil Osokin almost 12 years ago
Hi, Peter!
Thank you for attention! BTW, could you contribute this feature (http://code.opencv.org/projects/opencv/wiki/How_to_contribute)?
- Category set to objdetect
- Target version set to 2.4.6
- Assignee set to Peter Minin
Updated by Peter Minin almost 12 years ago
OK, I will contribute it, I actually have a patch created already. But it says in "How to contribute" that the branch 2.4 is feature-frozen. Does version 2.4.6 assigned to the issue mean I still should commit to 2.4?
- File cascade_classifier.patch added
Updated by Achal Dave almost 12 years ago
While numNeighbors
is a decent measure of confidence, theoretically, the levelWeights
provided by the undocumented call to detectMultiScale
seems to be a better measure. Assuming issue #3064 is fixed, levelWeights
will return the final calculated "feature value" (as calculated from here) that OpenCV internally compares against the last stage's threshold (see here).
This excerpt , for example, describes the measure of confidence as the sum of the "feature values" minus stage thresholds at each stage. OpenCV could be modified to allow this (and in fact, I've tried it here), but the feature value at the last stage is a decent substitute.
Updated by Achal Dave almost 12 years ago
Do note that this is not to say that the number of neighbors is not useful, but it should be noted (in the documentation) that it is not the main measure of confidence.
Updated by Peter Minin almost 12 years ago
Thanks for the link, it's an interesting research. It would be interesting to try continuous cascade responses rather than binary. Although, currently this isn't supported so I don't think it's worth mentioning in the docs as they describe what the function can already do.
Updated by Peter Minin almost 12 years ago
Here's the pull request: https://github.com/Itseez/opencv/pull/961
Updated by Daniil Osokin almost 12 years ago
- Target version changed from 2.4.6 to 3.0
Updated by Vladislav Vinogradov over 11 years ago
- Pull request set to https://github.com/Itseez/opencv/pull/961
- Target version changed from 3.0 to 2.4.6
Updated by Peter Minin over 11 years ago
The old pull request was reverted (see discussion in its comments), here's a new one: https://github.com/Itseez/opencv/pull/976.
This issue's assigned version should be set to 3.0 again.
Updated by Vladislav Vinogradov over 11 years ago
- Pull request changed from https://github.com/Itseez/opencv/pull/961 to https://github.com/Itseez/opencv/pull/976
- Target version changed from 2.4.6 to 3.0
Updated by Vladislav Vinogradov over 11 years ago
The pull request was merged into master branch.
Thanks for your participation.
- Status changed from Open to Done