From 3233b10700004e7fb70c140826d484bdd88ff6aa Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 30 Jun 2024 15:46:01 +0200 Subject: [PATCH] Refactored --- ocv_track.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ocv_track.py b/ocv_track.py index 432a131..aa7f9f6 100644 --- a/ocv_track.py +++ b/ocv_track.py @@ -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] + template.shape[0]/2 - 1 - loc_y = best_max_loc[1] + template.shape[1]/2 - 1 + loc_x = best_max_loc[0] + loc_y = best_max_loc[1] return angle, (loc_x, loc_y) @@ -150,10 +150,8 @@ tracker.create() tracker.init(frame_init, bbox_init) current_angle = 0 -#line_from = (ref_center[0] + bbox_template[0], ref_center[1] + bbox_template[1]) -line_from = None - path = [] +line_from = None while True: # Read a new frame