import cv2
if __name__ == "__main__":
major_v, minor_v, subminor_v = (cv2.__version__).split('.')
# >>> 4.6.0
tracker = cv2.TrackerKCF_create()
# >>> AttributeError: module 'cv2' has no attribute 'TrackerKCF_create'
As the code above shows, when running this these are the results I get (I have tried this with other trackers in cv2 and other than TrackerMIL_create
all trackers that are supposed to be included are giving me this error. I used
pip install opencv-python
,
pip install opencv-contrib-python
, and
pip install opencv-contrib-python-headless
on my terminal to try and install opencv. I haven't run into any other issues with cv2 attributes (such as imread
, imshow
, resize
) but the trackers are giving me a hard time and I was wondering if there is anything I am doing wrong from the start. Thanks.