From 538c7e3341c4e96a47c55ee674bcc527ad33fb6c Mon Sep 17 00:00:00 2001 From: Tom Selier Date: Mon, 25 Sep 2023 20:31:48 +0200 Subject: [PATCH] Revert "Added statistics to suite" This reverts commit 83d78c9d3f9900b145011d2f0679ddaee9dc0bc5. --- src/helpers/statistics.py | 9 --------- src/suite.py | 10 ---------- 2 files changed, 19 deletions(-) delete mode 100644 src/helpers/statistics.py diff --git a/src/helpers/statistics.py b/src/helpers/statistics.py deleted file mode 100644 index c92e061..0000000 --- a/src/helpers/statistics.py +++ /dev/null @@ -1,9 +0,0 @@ -import numpy as np - -def imgStats(img): - mean = np.zeros(3) - std = np.zeros(3) - for i in range(img.shape[2]): - mean[i] = np.mean(img[:, :, i]) - std[i] = np.std(img[:, :, i]) - return mean, std \ No newline at end of file diff --git a/src/suite.py b/src/suite.py index c04a365..2242a05 100644 --- a/src/suite.py +++ b/src/suite.py @@ -9,7 +9,6 @@ import cv2 import time import matplotlib.pyplot as plt import json -from helpers.statistics import imgStats ## UI config load PROJECT_PATH = pathlib.Path(__file__).parent @@ -193,13 +192,6 @@ class MainApp: self.axs[column, row].imshow(results) self.axs[column, row].xaxis.set_major_formatter(lambda x, pos: str(x*canny_step)) self.axs[column, row].yaxis.set_major_formatter(lambda x, pos: str(x*canny_step)) - - def writeStats(self, img, labels, column, row): - mean, std = imgStats(img) - self.axs[column, row].title.set_text( - "mean: %c:%d %c:%d %c:%d \n std: %c:%d %c:%d %c:%d" - %(labels[0], mean[0], labels[1], mean[1], labels[2], mean[2], - labels[0], std[0], labels[1], std[1], labels[2], std[2])) def update(self, event=None): path = self.img_path.get() @@ -266,7 +258,6 @@ class MainApp: if img is not None: self.drawHist(img, ('B', 'G', 'R'), 0, 0) - self.writeStats(img, ('B', 'G', 'R'), 0, 0) # HSV img_hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) @@ -277,7 +268,6 @@ class MainApp: if img_hsv is not None: self.drawHist(img_hsv, ('H', 'S', 'V'), 0, 1) - self.writeStats(img_hsv, ('H', 'S', 'V'), 0, 1) # Canny Heatmap self.drawCannyHM(img, 1, 1)