From 18246a99e7f6aafe41888716e3d3aed6f22980f9 Mon Sep 17 00:00:00 2001 From: Tom Selier Date: Sun, 24 Sep 2023 22:08:16 +0200 Subject: [PATCH] Fixed bug where scaling wouldn't adjust --- src/experiments/template_extraction/script.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/experiments/template_extraction/script.py b/src/experiments/template_extraction/script.py index 539aa84..a81ab23 100644 --- a/src/experiments/template_extraction/script.py +++ b/src/experiments/template_extraction/script.py @@ -183,16 +183,10 @@ for file in os.listdir(input_folder): # feature voor ooit, nogal lastig ## Calibratie van afstand met betrekking tot pixels ## - x_min = w_small - x_max = 0 - for corner in warped_corners: - # vind x waarden bovenaan - (x, y) = corner - if y < (h_small // 2): - if x < x_min: - x_min = x - else: - x_max = x + xs = [corner[0] for corner in warped_corners] + ys = [corner[1] for corner in warped_corners] + x_max = np.amax(xs) + x_min = np.amin(xs) x_diff = x_max - x_min calib_scale = x_diff / CALIB_AFSTAND if VERBOSE: