Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility in Opencv3 and opencv_contrib #24

Closed
ideaRunner opened this issue Dec 13, 2017 · 9 comments
Closed

Incompatibility in Opencv3 and opencv_contrib #24

ideaRunner opened this issue Dec 13, 2017 · 9 comments

Comments

@ideaRunner
Copy link

ideaRunner commented Dec 13, 2017

Hi, ITCoders,
I want to run this proj to watch the demo, but i found some incompatibilities in opencv3
As I have searched in google, I change two line of your code.
But I still have an error with no idea.

At line 16, I changed it to recognizer = cv2.face.LBPHFaceRecognizer_create()
At line 137, I changed it to recognizer.read("model.yaml")

but still have an error:

Traceback (most recent call last):
File "main.py", line 137, in
recognizer.read("model.yaml")

cv2.error: /home/ssss/opencv/opencv/modules/core/src/persistence.cpp:891: error: (-2) The node is neither a map nor an empty collection in function cvGetFileNodeByName

Can you give me some help ? Thanks !

@prsntmaurya
Copy link
Member

Hi there,
Can you please specify which OpenCV version you are using to run this code?

@ideaRunner
Copy link
Author

ideaRunner commented Dec 15, 2017

Hi,
My cv2.__version__ is 3.3.1-dev, build from opencv and opencv_contrib
My python version is Python 3.5.2

@prsntmaurya
Copy link
Member

prsntmaurya commented Dec 25, 2017 via email

@ideaRunner
Copy link
Author

ideaRunner commented Dec 25, 2017

Hi prsntmaurya,

Thank you for your advice.
I am sure have integrated the conrib_modules , because if not, I will get an error:

There is no module named face.

I have fellowed the guide from learnopencv site which I think have same steps as yours.

I think the problem is the opencv3_contrib library have changed, Like some function's name I mentioned before.

emm, I still can not solve this problem. Or do you have time to update it, so that it can be compatible with opencv3?

Thank you again for your patience and time.

@prsntmaurya
Copy link
Member

prsntmaurya commented Dec 29, 2017 via email

@diaodiaozhuye
Copy link

I also encountered this problem. I still can not solve this problem

@prsntmaurya
Copy link
Member

prsntmaurya commented Jan 4, 2018

Hi,
I have seen the difference between the version of OpenCV 3.1 and OpenCV 3.3, it is clear there are several changes from opencv_contrib modules version 3.1 to version 3.3. That's why you are facing such problem.
If you can switch to OpenCV version 3.1 then the error will be resolved or you can provide me the exact error details without changing any line in the code along with the OpenCV version(the above-mentioned error is after the change in code).

@prsntmaurya
Copy link
Member

I am closing the issue now, I hope it is resolved.

@prsntmaurya
Copy link
Member

This issue is solved in issue #25, please refer that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants