How to get the confidence of HaarDetection in python openCV 2.0 -
the old version of opencv returned number of neighbors detected, , used measure of confidence.
for example:
cv.haardetectobjects(grayscale, cascade, storage, 1.2, 2, cv.cv_haar_do_canny_pruning, (50,50)) [((174, 54, 114, 114), 53)]
the new version of opencv changed signature used, either
detectmultiscale(image[, scalefactor[, minneighbors[, flags[, minsize[, maxsize]]]]]) -> objects
or
detectmultiscale(image, rejectlevels, levelweights[, scalefactor[, minneighbors[, flags[, minsize[, maxsize[, outputrejectlevels]]]]]]) -> objects
the second signature has rejectlevels
, levelweights
which, understanding, can used confidence.
this reflection of c++ version of functions. but, unclear me how pass parameters changed in python. i've tried, example, following, not change r
, w
:
r = list() w = list() res = cascade2.detectmultiscale(image=img, rejectlevels=r, levelweights=w) print res print r, w [[ 82 158 53 53] [175 157 52 52] [103 266 112 112]] [] []
can explain how pass r
, w
updated?
Comments
Post a Comment