How to Get Confidence Value in Haar Cascade?

Hi, I am using CV2 for Custom Model Detection but I can’t get the Confidence Value even after setting rejectOutputLevels =True. Can anyone explain why this is happening?\

detection_result = cascade.detectMultiScale(gray_Image, scaleFactor=1.0485258, minNeighbors=6, minSize=(100,100), rejectOutputLevels = True)

TypeError: ‘outputRejectLevels’ is an invalid keyword argument for CascadeClassifier.detectMultiScale()

there are two C++ signatures. it’s probably not catching the signature you want. mapping C++ to python is tricky. give all arguments in order. then it might work.

Got it. This can be fixed by setting outputRejectLevels = 1 in detectmultiscale3() as below:

detection_result, rejectLevels, levelWeights =cascade.detectMultiScale3(blur, scaleFactor=1.0485258, minNeighbors=6, minSize=(30,30), outputRejectLevels = 1)