I´m trying to implement a CV2 tracker, following some examples and documentation, but I´ve encountered the following error:
self.tracker = cv2.TrackerMOSSE_create()
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module ‘cv2’ has no attribute ‘TrackerMOSSE_create
From my method:
import cv2
def create_tracker(self, tracker_type):
if tracker_type == 'BOOSTING':
self.tracker = cv2.TrackerBoosting_create()
elif tracker_type == 'MIL':
self.tracker = cv2.TrackerMIL_create()
elif tracker_type == 'KCF':
self.tracker = cv2.TrackerKCF_create()
elif tracker_type == 'TLD':
self.tracker = cv2.TrackerTLD_create()
elif tracker_type == 'MEDIANFLOW':
self.tracker = cv2.TrackerMedianFlow_create()
elif tracker_type == 'GOTURN':
self.tracker = cv2.TrackerGOTURN_create()
elif tracker_type == 'MOSSE':
self.tracker = cv2.TrackerMOSSE_create()
elif tracker_type == "CSRT":
self.tracker = cv2.TrackerCSRT_create()
I´m using CV2 version 4.10.0 and tried all tracker types, all reurning the same error.
New contributor
MARTIN PINCHEIRA MORALES is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.