Ask Your Question

al897's profile - activity

2017-10-23 16:35:24 -0600 received badge  Student (source)
2016-11-23 13:14:39 -0600 received badge  Famous Question (source)
2016-05-23 04:24:02 -0600 received badge  Notable Question (source)
2016-01-05 10:55:05 -0600 received badge  Popular Question (source)
2015-03-27 10:58:13 -0600 received badge  Enthusiast
2015-03-07 13:52:47 -0600 commented answer OpenCV 3.0.0, FaceRecognizer and Python Bindings

Yes, doing

>>> test = cv2.face.createEigenFaceRecognizer()
>>> help(test)

listed the face_BasicFaceRecognizer class with all the appropriate methods (save, predict, train, update, etc..) inherited from face_FaceRecognizer. Issue solved!

2015-03-07 13:15:48 -0600 commented answer OpenCV 3.0.0, FaceRecognizer and Python Bindings

I think that seemed to fix it! I can successfully call

model.train(np.asarray(X), np.asarray(y))

I haven't tried save() or predict() since I have a couple of errors in my program (passing in an empty training set when calling train(), might be an error on my part), but thank you so much for your help! Hopefully anybody else who has the same problems as me sees this post and can follow your instructions.

One last note - is there a person or a page I can report this bug to so it can get fixed in the future?

2015-03-06 21:50:31 -0600 commented answer OpenCV 3.0.0, FaceRecognizer and Python Bindings

Thank you so much for your help! Everything is set up now. One last question - how can I access the current API available? I am trying to use the train(), save() and predict() functions but can't seem to find a way to use it properly.

model.train(np.asarray(X), np.asarray(y))
AttributeError: 'cv2.face_BasicFaceRecognizer' object has no attribute 'train'

Typing in

$ python
>>> import cv2
>>> help(cv2.face_BasicFaceRecognizer)

doesn't help either.

2015-03-06 11:44:58 -0600 received badge  Supporter (source)
2015-03-06 11:44:55 -0600 commented answer OpenCV 3.0.0, FaceRecognizer and Python Bindings

Awesome!! I don't know if I just plain missed it or if it's not immediately clear that the face module is not within the standard release, but that clears a lot of things up. I will clone and compile from the opencv_contrib repo and see if it works.

2015-03-05 22:12:10 -0600 asked a question OpenCV 3.0.0, FaceRecognizer and Python Bindings

Hi there -

I am very new to OpenCV and am using it for a school project on the Raspberry Pi (Mine is the B+ model). I have followed numerous guides to get the FaceRecognizer to work in Python, but to no avail.

My specific problem is -

model = cv2.createEigenFaceRecognizer()
attributeError: 'module' object has no attribute 'createEigenFaceRecognizer'

I also want to note that I can do

import cv2

with no issues, and run functions such as

cv2.imwrite(), cv2.cvtColor()

with no problems, so there isn't an issue with OpenCV not working in general. My problem is with this specific class (faceRecognizer) which is critical for me.

To elaborate, I am running OpenCV 3.0.0 and Python 2.7.3. To install OpenCV, I basically followed the tutorial at http://mitchtech.net/raspberry-pi-ope..., but instead of getting the file from sourceforge, I cloned from the OpenCV repository for the latest version, and in cMake, I added a flag BUILD_PYTHON_NEW_SUPPORT=ON (per a suggestion found online.)

I googled extensively to find a solution, most notably

http://answers.opencv.org/question/25...

http://answers.opencv.org/question/12...

http://www.raspberrypi.org/forums/vie...

and most sources tell me just to "recompile from the latest source". That's what I thought I did. I'm stuck as where to go now - did I compile the library incorrectly? I am aware that OpenCV is written in C++ and there are python bindings to make functions work in python, but I'm not sure where I'm going wrong here. Any input is much appreciated.