summaryrefslogtreecommitdiff
path: root/utils/raspberrypi/ctt/ctt_macbeth_locator.py
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-05-02 03:32:00 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-05-13 16:58:22 +0300
commit641c6ebe9b278e0b00f0125133eebe9c0037ab88 (patch)
tree977be2b537c540af575f01dd2ada7e5841c48273 /utils/raspberrypi/ctt/ctt_macbeth_locator.py
parent23f9f46c8a42ef63cd55d7b841e6065ba222f870 (diff)
utils: raspberrypi: ctt: Fix pycodestyle E225
E225 missing whitespace around operator Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Diffstat (limited to 'utils/raspberrypi/ctt/ctt_macbeth_locator.py')
-rw-r--r--utils/raspberrypi/ctt/ctt_macbeth_locator.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/raspberrypi/ctt/ctt_macbeth_locator.py b/utils/raspberrypi/ctt/ctt_macbeth_locator.py
index 63dbc4a1..c3016f9a 100644
--- a/utils/raspberrypi/ctt/ctt_macbeth_locator.py
+++ b/utils/raspberrypi/ctt/ctt_macbeth_locator.py
@@ -40,7 +40,7 @@ def find_macbeth(Cam, img, mac_config=(0, 0)):
Reference macbeth chart is created that will be correlated with the located
macbeth chart guess to produce a confidence value for the match.
"""
- ref = cv2.imread(Cam.path +'ctt_ref.pgm', flags=cv2.IMREAD_GRAYSCALE)
+ ref = cv2.imread(Cam.path + 'ctt_ref.pgm', flags=cv2.IMREAD_GRAYSCALE)
ref_w = 120
ref_h = 80
rc1 = (0, 0)
@@ -328,7 +328,7 @@ def get_macbeth_chart(img, ref_data):
"""
src = img
src, factor = reshape(src, 200)
- original=src.copy()
+ original = src.copy()
a = 125/np.average(src)
src_norm = cv2.convertScaleAbs(src, alpha=a, beta=0)
"""
@@ -349,7 +349,7 @@ def get_macbeth_chart(img, ref_data):
"""
obtain image edges
"""
- sigma=2
+ sigma = 2
src_bw = cv2.GaussianBlur(src_bw, (0, 0), sigma)
t1, t2 = 50, 100
edges = cv2.Canny(src_bw, t1, t2)
@@ -490,7 +490,7 @@ def get_macbeth_chart(img, ref_data):
)
mac_mids_list = [x[0] for x in mac_mids]
- if len(mac_mids_list)==1:
+ if len(mac_mids_list) == 1:
"""
special case of only one valid centre found (probably not needed)
"""
@@ -508,7 +508,7 @@ def get_macbeth_chart(img, ref_data):
create list of all clusters
"""
clus_list = []
- if clustering.n_clusters_ >1:
+ if clustering.n_clusters_ > 1:
for i in range(clustering.labels_.max()+1):
indices = [j for j, x in enumerate(clustering.labels_) if x == i]
clus = []
@@ -535,7 +535,7 @@ def get_macbeth_chart(img, ref_data):
keep only clusters with enough votes
"""
clus_len_max = clus_list[0][1]
- clus_tol= 0.7
+ clus_tol = 0.7
for i in range(len(clus_list)):
if clus_list[i][1] < clus_len_max * clus_tol:
clus_list = clus_list[:i]