opencv_traincascade detection phase: obtain confidence of each detection window
Has anyone created a recall precision curve for traincascade? I am thinking of doing this at the detection stage:
Looking at the docs, opencv provides this method:
Python: cv2.CascadeClassifier.detectMultiScale(image,rejectLevels, levelWeights[,scaleFactor[, minNeighbors[, flags[,minSize[, maxSize[,outputRejectLevels]]]]]]) → objects
My questions are:
- What 'objects' are being returned by this method?
- Assuming rejectLevels refers to the confidence level for each detection window, why do I need to pass it in as a parameter?
- What do I need to pass in for rejectLevels and levelWeights?
- What is outputRejectLevels? Is it related to how certain the cascade should be to accept a detection?
hmm, opencv2.4 ? i 'm having some doubts , if this is useable at all (rejectLevels and levelWeights should be tagged CV_OUT, too here , else it won't return anything useful
in opencv3.0 it is:
objects are the returned rects, and imho it should not be nessecary to pass anything for rejectLevels and levelWeights
outputRejectLevels is a boolean flag, that must be set to true (bug, maybe...) it is only for "fill rejectLevels(or not)"
Help on CascadeClassifier object:
class CascadeClassifier(__builtin__.object) | Methods defined here: |
| __repr__(...) | x.__repr__() <==> repr(x) |
| detectMultiScale(...) | detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects or detectMultiScale(image, rejectLevels, levelWeights[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects |
| empty(...) | empty() -> retval |
| load(...) | load(filename) -> retval |
| ---------------------------------------------------------------------- | Data and other attributes defined here: |
| __new__ = <built-in method="" __new__="" of="" type="" object=""> | T.__new__(S, ...) -> a new object with type S, a subtype of
it was present in the 3.0-beta, as I've mentioned in the answer. There were some numbers, but I couldn't use them at the time I was working on face detection; I think it was linked to the level of the cascade tree that rejected the sample, but not sure.
Thanks for comments. What do you mean by 'there were some numbers' but you 'couldn't use them'? Do you mean that confidence levels were provided but it wasn't clear what they meant so you chose not to use them? Also, so this funcionality was added for 3.0 then, right?
Maybe, I have tried to pick the detections with highest values, but they were totally wrong, and then with the lowest ones, but nothing interesting, they are int values, as you can see here