When using Python,
the openCV function
cv.HaarDetectObjects()
returns an object found along with a detection score.
If I use the opencv2 function instead,
cv2.CascadeClassifier.detectMultiScale()
I get the detected object, but no score. This makes it difficult to get a good "confidence" measure of the detection.
Is there a way to get that somehow, using CV2?
According the documentation
cv2.CascadeClassifier.detectMultiScale(image, rejectLevels, levelWeights[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) → objects
The list rejectLevels
is kind of scores indicating the confidence of detection result.
The corresponding (however undocumented) C++ API is:
CV_WRAP virtual void detectMultiScale( const Mat& image,
CV_OUT vector<Rect>& objects,
vector<int>& rejectLevels,
vector<double>& levelWeights,
double scaleFactor=1.1,
int minNeighbors=3, int flags=0,
Size minSize=Size(),
Size maxSize=Size(),
bool outputRejectLevels=false );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With