diff --git a/data/IMG_1728.MP4 b/data/IMG_1728.MP4 deleted file mode 100644 index e7ebeba..0000000 Binary files a/data/IMG_1728.MP4 and /dev/null differ diff --git a/data/IMG_1728.qt b/data/IMG_1728.qt deleted file mode 100644 index 0c14787..0000000 Binary files a/data/IMG_1728.qt and /dev/null differ diff --git a/data/IMG_1730.MP4 b/data/IMG_1730.MP4 new file mode 100644 index 0000000..50087b3 Binary files /dev/null and b/data/IMG_1730.MP4 differ diff --git a/ocv_track.py b/ocv_track.py index 16fcbcd..432a131 100644 --- a/ocv_track.py +++ b/ocv_track.py @@ -4,7 +4,7 @@ import numpy as np import imutils as im IMG_SCALE_UP = 1 -TEMPLATE_MATCH_OVERLAP = 0.5 +TEMPLATE_MATCH_OVERLAP = 0.0 (major_ver, minor_ver, subminor_ver) = cv2.__version__.split('.') print(cv2.__version__) @@ -66,8 +66,8 @@ def template_match_rotation(source, template, angle, center, rot_min=-1.0, rot_m break angle += best_angle - loc_x = best_max_loc[0] + source.shape[0]/2 - 1 - loc_y = best_max_loc[1] + source.shape[0]/2 - 1 + loc_x = best_max_loc[0] + template.shape[0]/2 - 1 + loc_y = best_max_loc[1] + template.shape[1]/2 - 1 return angle, (loc_x, loc_y) @@ -124,7 +124,7 @@ trackers = { tracker_type = 'KCF' tracker = trackers[tracker_type].create() -video = cv2.VideoCapture("./data/IMG_1728.qt") +video = cv2.VideoCapture("./data/IMG_1730.MP4") # Exit if video not open # d.