luigifreda / pyslam

pySLAM contains a monocular Visual Odometry (VO) pipeline in Python. It supports many modern local features based on Deep Learning.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is_opencv_version_greater_equal function not working

oscarfossey opened this issue · comments

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

Thanks. Fixed.