I have a working code. I developed it on my Win10 computer then ported it to a Ubuntu machine. Everything works on my computer but I cannot create any of the trackers on the Ubuntu computer. When I execute
tracker = cv2.TrackerBoosting_create()
I see this error message:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
AttributeError: module ‘cv2.cv2’ has no attribute ‘Tracker_create’
Win10, Python3.8.5, Opencv4.0.1, Opencv-contrib-python18.104.22.168
Ubuntu16.04, Python3.6.9, Opencv-contrib-python 22.214.171.124
I have no idea about why I cannot create the tracker on the Ubuntu machine.
how did you install any of that ?
if it was via pip, make sure to install only opencv-contrib-python (NOT opencv-python) else the latter will “shadow” the former, and you cannot use the contrib extra functionality
I installed them with pip3. I work in a python3 virtual environment. I uninstalled both opencv and opencv contrib and installed again opencv-contrib-python with pip3. now
shows 4.5.1. But when I run
pip3 show opencv
I see this warning:
WARNING: Package(s) not found: opencv
I believe there is something wrong with my virtual environment but I see the correct opencv version when I print it in my python script. This confuses me. I have Opencv-contrib-python126.96.36.199 on my windows machine. But I have this problem on the Ubuntu machine. Everything works on the Windows machine.
EDIT: On my win10 computer I created a new conda environment and installed the latest opencv-contrib-python with pip. I see the same error message when I try to create the tracker in the new environment. There is no problem with opencv-contrib-python ver. 188.8.131.52.
Hi! I think your problems with the latest version of the opencv-contrib-python can be related to changes in tracking API:
I tried to use Win10, Python 3.8.5, opencv-contrib-python==184.108.40.206, and all works fine.
Please, use the 220.127.116.11 version for now and keep watching for changes in tracking API:
and changes of opencv-python:
Also, the pip show open-contrib-python command should work, instead of pip3 show opencv.
indeed, latest changes to the tracking api seem a bit messy.
behave as expected (they were moved into the main opencv repo), we now have:
when using latest 4.5.1, please try:
tracker = cv2.legacy.TrackerBoosting_create()
Working for me with Win10, opencv-contrib-python last version and Python 3.8.5.