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

is_opencv_version_greater_equal function not working #82

Closed
oscarfossey opened this issue Sep 22, 2022 · 1 comment
Closed

is_opencv_version_greater_equal function not working #82

oscarfossey opened this issue Sep 22, 2022 · 1 comment

Comments

@oscarfossey
Copy link

oscarfossey commented Sep 22, 2022

Hello, I really liked your repo is really well coded. Just a minor bug when calling is_opencv_version_greater_equal() when wanting to define Keypoints.

When I call is_opencv_version_greater_equal(4,5,3) whith openCV 4.6.0 it returns False. Indeed the code is the following:

def is_opencv_version_greater_equal(a, b, c):
    opencv_version = get_opencv_version()
    return opencv_version[0]>=a and opencv_version[1]>=b and opencv_version[2]>=c

With openCV(4.6.0) :
is_opencv_version_greater_equal(4,5,3) --> 4 >= 4 and 6 >= 5 but 0 <= 3 --> False

I propose the following code:

def is_opencv_version_greater_equal(a, b, c):
    opencv_version = get_opencv_version()
    return opencv_version[0]*1000 + opencv_version[1]*100 + opencv_version[2] >= a*1000 + b*100 + c

Remark : I work on the ubuntu20 branch. And thanks for the clear installation steps with the README.md

@luigifreda
Copy link
Owner

Thanks. Fixed.

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

2 participants