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

opencv2 compatibility #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

opencv2 compatibility #10

wants to merge 1 commit into from

Conversation

smihael
Copy link

@smihael smihael commented Sep 3, 2018

This should maybe be added as an extra branch to enable compiling on Ubuntu 16.04 (see #1 and #2)

@derzu
Copy link
Owner

derzu commented Sep 3, 2018

Hi Smihael,

I think the problem is the OpenCV version, the versions above 3.0 works with the include:
opencv2/<module>.hpp
The versions below 3.0 uses:
opencv2/<module>/<module>.hpp

Look at these links:
https://docs.opencv.org/3.2.0/db/dfa/tutorial_transition_guide.html
https://stackoverflow.com/a/43701862/1178478

With OpenCV version are you using?

@smihael
Copy link
Author

smihael commented Sep 3, 2018

Exactly, the problem is that in Ubuntu 16.04 repositories only OpenCV2 2.x is available. There is no need to require OpenCV 3.x as the code compiles and runs fine with OpenCV 2.x.

@derzu
Copy link
Owner

derzu commented Sep 3, 2018

I think we can check the OpenCV version on the compilation time.

Look at this link:
https://stackoverflow.com/questions/2422514/how-to-check-for-opencv-on-ubuntu-9-10

So we can do a marco #if like that:

#if CV_VERSION >= 3
#include <opencv2/core.hpp>
#else
#include <opencv2/core/core.hpp>
#endif

I do not tested this code, but I think it works.

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

Successfully merging this pull request may close these issues.

2 participants