Ask Your Question
0

broken python bindings on opencv3

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

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 ihttps://github.com/Itseez/opencv_contrib/issues/194) 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/cv2.so: undefined symbol: _ZN2cv2ml21NormalBayesClassifier6createEv

Any ideas? Thanks a lot for your help.

edit retag flag offensive close merge delete

Comments

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

berak gravatar imageberak ( 2015-03-25 09:38:41 -0600 )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 -0600 )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 -0600 )edit
2

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
python2

>>> 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 cv2.so.

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

@mshabunin thanks for this, it worked.

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

1 answer

Sort by ยป oldest newest most voted
2

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

berak gravatar image

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

the facerecognizer issue is fixed now, also cv2.ml.NormalBayes 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

Comments

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

techfort gravatar imagetechfort ( 2015-03-28 03:31:50 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 1,913 times

Last updated: Mar 26 '15