diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ocv_track.py b/ocv_track.py index 9a774a5..ec93f43 100644 --- a/ocv_track.py +++ b/ocv_track.py @@ -6,6 +6,8 @@ import imutils as im IMG_SCALE_UP = 1 SEARCH_AREA = 0.2 +(major_ver, minor_ver, subminor_ver) = cv2.__version__.split('.') +print(cv2.__version__) def bbox_extend(bbox: cv2.typing.Rect, search_area: float): we2 = int(round(bbox[2]*search_area/2)) @@ -63,15 +65,6 @@ def match(image_bbox, image_template, current_angle): return current_angle, best_maxLoc -(major_ver, minor_ver, subminor_ver) = cv2.__version__.split('.') - -# Set up tracker. -# Instead of MIL, you can also use - -print(cv2.__version__) - -bbox = (100, 100, 100, 100) -bbox = bbox_extend(bbox, 0.5) trackers = { 'KCF': cv2.TrackerKCF, @@ -87,7 +80,7 @@ trackers = { tracker_type = 'KCF' tracker = trackers[tracker_type].create() -video = cv2.VideoCapture("/media/jens/Home/Videos/production_id 4525346 (1080p).mp4") +video = cv2.VideoCapture("./data/production_id 4525346 (1080p).mp4") # Exit if video not open # d.