Ask Your Question

broken python bindings on opencv3

asked 2015-03-25 09:30:54 -0500

techfort gravatar image

I'm trying to work with eigenFaceRecognizer but python bindings seem to broken for the latest version of opencv_contrib. Anybody has any pointers as to a particular commit that works for both opencv / contrib (ref i that makes python bindings work? At the moment, following the advice given by the opencv_contrib people, i checkout a mid-february version and get the following when i try to import cv2 into a python script:

ImportError: /usr/local/lib/python2.7/dist-packages/ undefined symbol: _ZN2cv2ml21NormalBayesClassifier6createEv

Any ideas? Thanks a lot for your help.

edit retag flag offensive close merge delete


mshabunin seems to be at it, give him a day or 2 ;)

berak gravatar imageberak ( 2015-03-25 09:38:41 -0500 )edit

the NormalBayes issue is a seperate one from the facereco, right ? (the ml module classes were temporarily disabled, but that , too seems to be in flux atm.)

berak gravatar imageberak ( 2015-03-25 09:40:12 -0500 )edit

well - my problem is that if i simply do >>> import cv2 i get the above. I am attempting to do facereco but i don't get anywhere after the import statement.

techfort gravatar imagetechfort ( 2015-03-25 15:11:31 -0500 )edit

Here is temporary solution:

Setup folders as follows:

build - <empty>
opencv - <5e92a777ef82af44fdbc1c8431a20da52e2b3dfd>
opencv_contrib - <2b74ca6f120cd08c8b0f5688897b8c048a65c493>

Run the commands:

cd build
cmake ../opencv -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/
make -j8 opencv_python2
export PYTHONPATH=lib

>>> import cv2
>>> f = cv2.face.createEigenFaceRecognizer()

This setup works for me. Note, that there was an issue when python support turned off after second cmake run. Probably, you have just installed an old

mshabunin gravatar imagemshabunin ( 2015-03-25 15:29:41 -0500 )edit

@mshabunin thanks for this, it worked.

techfort gravatar imagetechfort ( 2015-03-28 03:31:30 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-03-26 11:29:06 -0500

berak gravatar image

updated 2015-03-26 11:30:12 -0500

the facerecognizer issue is fixed now, also should be available now (thanks, mshabunin!).

please try to update both opencv and opencv_contrib, and it would be nice, if you report back !

edit flag offensive delete link more


Yeah this worked for me, thanks for your help everybody.

techfort gravatar imagetechfort ( 2015-03-28 03:31:50 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-03-25 09:30:54 -0500

Seen: 1,596 times

Last updated: Mar 26 '15