pythonpython-3.xopencvvideo-tracking

Unable to run Tracking on Open CV 3.4.1 on Python 3.6.6


I tried running tracking using open CV on python 3.6.6, but it shows:

AttributeError: module 'cv2' has no attribute 'TrackerKCF_create'

I also tried the python 2.7 API, but the same result:

AttributeError: module 'cv2' has no attribute 'Tracker_create'

The Open CV version is 3.4.1.

Any idea how to resolve this?

Thanks in advance.

Edit:

The problem is different to the one asked here. I tried this but it wasn't working for me. However, I solved it and I have given a solution below.


Solution

  • The issue was that I had installed opencv-python first, and then opencv-contrib-python, which led to them clashing. I removed both of them completely, and reinstalled opencv-contrib-python. That solved it!