How to detect an object real time and track it automatically, instead of user having to draw a bounding box around the object to be tracked?
问题 I have the following code where the user can press p to pause the video, draw a bounding box around the object to be tracked, and then press Enter (carriage return) to track that object in the video feed: import cv2 import sys major_ver, minor_ver, subminor_ver = cv2.__version__.split('.') if __name__ == '__main__' : # Set up tracker. tracker_types = ['BOOSTING', 'MIL','KCF', 'TLD', 'MEDIANFLOW', 'GOTURN', 'MOSSE', 'CSRT'] tracker_type = tracker_types[1] if int(minor_ver) < 3: tracker = cv2