Refactored
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4
-4
@@ -4,7 +4,7 @@ import numpy as np
|
|||||||
import imutils as im
|
import imutils as im
|
||||||
|
|
||||||
IMG_SCALE_UP = 1
|
IMG_SCALE_UP = 1
|
||||||
TEMPLATE_MATCH_OVERLAP = 0.5
|
TEMPLATE_MATCH_OVERLAP = 0.0
|
||||||
|
|
||||||
(major_ver, minor_ver, subminor_ver) = cv2.__version__.split('.')
|
(major_ver, minor_ver, subminor_ver) = cv2.__version__.split('.')
|
||||||
print(cv2.__version__)
|
print(cv2.__version__)
|
||||||
@@ -66,8 +66,8 @@ def template_match_rotation(source, template, angle, center, rot_min=-1.0, rot_m
|
|||||||
break
|
break
|
||||||
|
|
||||||
angle += best_angle
|
angle += best_angle
|
||||||
loc_x = best_max_loc[0] + source.shape[0]/2 - 1
|
loc_x = best_max_loc[0] + template.shape[0]/2 - 1
|
||||||
loc_y = best_max_loc[1] + source.shape[0]/2 - 1
|
loc_y = best_max_loc[1] + template.shape[1]/2 - 1
|
||||||
|
|
||||||
return angle, (loc_x, loc_y)
|
return angle, (loc_x, loc_y)
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ trackers = {
|
|||||||
tracker_type = 'KCF'
|
tracker_type = 'KCF'
|
||||||
tracker = trackers[tracker_type].create()
|
tracker = trackers[tracker_type].create()
|
||||||
|
|
||||||
video = cv2.VideoCapture("./data/IMG_1728.qt")
|
video = cv2.VideoCapture("./data/IMG_1730.MP4")
|
||||||
|
|
||||||
# Exit if video not open
|
# Exit if video not open
|
||||||
# d.
|
# d.
|
||||||
|
|||||||
Reference in New Issue
Block a user