Ask Your Question
0

TypeError: Incorrect type of self(must be 'face_faceRecognizer' or its derivative)

asked 2018-07-21 10:51:09 -0600

Shunya gravatar image

Hello.I'm on an Opencv Contrib 3.4.1.15 . In the code,The recognizer is as per documentation
""EigenFace = cv2.face_EigenFaceRecognizer()"" which I had got from

help(cv2) #attribute(cv2)

but I'm getting an Error for

print('TRAINING......')

EigenFace.train(FaceList, IDs)

it says""" TypeError: Incorrect type of self(must be 'face_faceRecognizer' or its derivative)""" for the EigenFace.train() I googled a lot and was unable to find a solution. Can anyone help me please? I have Uninstalled opencv standard packages and reinstalled the Contrib packages.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-07-21 11:42:31 -0600

berak gravatar image

you have to use:

EigenFace = cv2.face.EigenFaceRecognizer_create()

and

help(cv2.face)
edit flag offensive delete link more

Comments

@berak Thanks.I resolved the issue by reading the documentation and I updated to 3.4.2.16 But I'm now getting an Error. I can't read the xml files.

cv2.face_EigenFaceRecognizer.read("Recogniser/trainingDataEigan.xml")

It says Type error:: descriptor 'read' requires a 'cv2.face_FaceRecogniser' object but Recieved a str.

Shunya gravatar imageShunya ( 2018-07-22 06:38:44 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-21 10:51:09 -0600

Seen: 178 times

Last updated: Jul 21 '18