Ask Your Question
0

Setting facerecognizer threshold in Python

asked 2017-04-02 17:21:22 -0600

skippy130 gravatar image

Hi,

I'm trying to set the threshold of a facerecognizer object that I've made in Python. Looking online I found that you can use the getDouble('threshold') method to get the threshold and the set('threshold', doubleThresholdValue) to set it.

The first method worked just fine but when I try to use the second one I get an error 'AttributeError: 'cv2.FaceRecognizer' object has no attribute 'set''.

So I was hoping that someone could point me in the right direction in terms of methods available to set the threshold.

And is there any documentation for openCV that exists specifically for Python or other languages like Java? I've been using this (I apparently can't post links, sorry) as my resource but it seems like it's geared towards C++.

That documentation is fine and I haven't had any real trouble translating it to Python but I'm wondering if there might be more problems like this in my future if these methods don't have a one-to-one correspondence between different languages. Thanks in advance!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-04-03 01:34:04 -0600

berak gravatar image

the generic set("some-string") methods are gone in opencv3, you can pass the threshold value either to the create method, or use setThreshold

help(cv2.face.cv::face::createLBPHFaceRecognizer())

will show you the object's methods

edit flag offensive delete link more

Comments

Thanks! Looks like setThreshold() doesn't exist in Python but I found setDouble('threshold', value) using the help(cv2.createEigenFaceRecognizer()) function. I'd give you an upvote but it looks like I can't yet, but thanks a lot for the help!

skippy130 gravatar imageskippy130 ( 2017-04-03 11:51:08 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-04-02 17:21:22 -0600

Seen: 401 times

Last updated: Apr 03 '17