diff --git a/ocv_track.py b/ocv_track.py index 7d8d1a7..d0e8f57 100644 --- a/ocv_track.py +++ b/ocv_track.py @@ -6,7 +6,7 @@ from template_matcher import template_match_rotation from util import bbox_extend, bbox_round, process_image_bbox, image_crop, bbox_add_position, to_rect IMG_SCALE_UP = 1 -TEMPLATE_MATCH_OVERLAP = 1.0 +TEMPLATE_MATCH_OVERLAP = 0.5 def match(source, template, angle, center): @@ -116,17 +116,17 @@ while True: # Matcher matcher_bbox = (max_loc[0], max_loc[1], image_template.shape[1], image_template.shape[0]) - matcher_bbox_global = bbox_round(bbox_add_position(matcher_bbox, bbox_tracker)) + matcher_bbox_global = bbox_round(bbox_add_position(matcher_bbox, bbox_tracker_ext)) matcher_top_left, matcher_bottom_right = to_rect(matcher_bbox_global) - cv2.rectangle(frame, matcher_top_left, matcher_bottom_right, (255, 0, 0), 3) + cv2.rectangle(frame, matcher_top_left, matcher_bottom_right, (255, 0, 0), 2) # Tracker tracker_top_left, tracker_bottom_right = to_rect(bbox_round(bbox_tracker)) - cv2.rectangle(frame, tracker_top_left, tracker_bottom_right, (0, 0, 255), 3) + cv2.rectangle(frame, tracker_top_left, tracker_bottom_right, (0, 0, 255), 2) # Tracker ext tracker_top_left, tracker_bottom_right = to_rect(bbox_round(bbox_tracker_ext)) - cv2.rectangle(frame, tracker_top_left, tracker_bottom_right, (255, 0, 255), 3) + cv2.rectangle(frame, tracker_top_left, tracker_bottom_right, (255, 0, 255), 2) # Calculate Frames per second (FPS) fps = cv2.getTickFrequency() / (cv2.getTickCount() - timer)