[libcamera-devel] [PATCH 23/24] utils: raspberrypi: ctt: Fix pycodestyle E305
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue May 12 02:03:21 CEST 2020
E305 expected 2 blank lines after class or function definition
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
utils/raspberrypi/ctt/ctt.py | 2 ++
utils/raspberrypi/ctt/ctt_alsc.py | 2 ++
utils/raspberrypi/ctt/ctt_awb.py | 1 +
utils/raspberrypi/ctt/ctt_ccm.py | 2 ++
utils/raspberrypi/ctt/ctt_geq.py | 1 +
utils/raspberrypi/ctt/ctt_image_load.py | 1 +
utils/raspberrypi/ctt/ctt_lux.py | 1 +
utils/raspberrypi/ctt/ctt_macbeth_locator.py | 1 +
utils/raspberrypi/ctt/ctt_tools.py | 7 +++++++
9 files changed, 18 insertions(+)
diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py
index 8f8e06f069df..02f1d8531269 100755
--- a/utils/raspberrypi/ctt/ctt.py
+++ b/utils/raspberrypi/ctt/ctt.py
@@ -60,6 +60,7 @@ def get_col_lux(string):
return col, None
return int(col), int(lux)
+
"""
Camera object that is the backbone of the tuning tool.
Input is the desired path of the output json.
@@ -797,6 +798,7 @@ def run_ctt(json_output, directory, config, log_output):
else:
Cam.write_log(log_output)
+
if __name__ == '__main__':
"""
initialise calibration
diff --git a/utils/raspberrypi/ctt/ctt_alsc.py b/utils/raspberrypi/ctt/ctt_alsc.py
index b697ed3e22b4..b988f565f245 100644
--- a/utils/raspberrypi/ctt/ctt_alsc.py
+++ b/utils/raspberrypi/ctt/ctt_alsc.py
@@ -218,6 +218,7 @@ def get_16x12_grid(chan, dx, dy):
"""
return np.array(grid)
+
"""
obtains sigmas for red and blue, effectively a measure of the 'error'
"""
@@ -257,6 +258,7 @@ def get_sigma(Cam, cal_cr_list, cal_cb_list):
# print(sigma_r, sigma_b)
return sigma_r, sigma_b
+
"""
calculate sigma from two adjacent gain tables
"""
diff --git a/utils/raspberrypi/ctt/ctt_awb.py b/utils/raspberrypi/ctt/ctt_awb.py
index c269b67a12c0..834d4dec2742 100644
--- a/utils/raspberrypi/ctt/ctt_awb.py
+++ b/utils/raspberrypi/ctt/ctt_awb.py
@@ -288,6 +288,7 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):
"""
return(ct_curve, np.round(transverse_pos, 5), np.round(transverse_neg, 5))
+
"""
obtain greyscale patches and perform alsc colour correction
"""
diff --git a/utils/raspberrypi/ctt/ctt_ccm.py b/utils/raspberrypi/ctt/ctt_ccm.py
index 0a4eb57a8cdf..dd660e40bb66 100644
--- a/utils/raspberrypi/ctt/ctt_ccm.py
+++ b/utils/raspberrypi/ctt/ctt_ccm.py
@@ -16,6 +16,7 @@ def degamma(x):
x = x * ((2**16)-1)
return x
+
"""
FInds colour correction matrices for list of images
"""
@@ -153,6 +154,7 @@ def ccm(Cam, cal_cr_list, cal_cb_list):
})
return ccms
+
"""
calculates the ccm for an individual image.
ccms are calculate in rgb space, and are fit by hand. Although it is a 3x3
diff --git a/utils/raspberrypi/ctt/ctt_geq.py b/utils/raspberrypi/ctt/ctt_geq.py
index 1ffa4e91b1b7..d24b216389df 100644
--- a/utils/raspberrypi/ctt/ctt_geq.py
+++ b/utils/raspberrypi/ctt/ctt_geq.py
@@ -165,6 +165,7 @@ def geq_fit(Cam, plot):
return round(slope, 5), int(offset)
+
""""
Return green channels of macbeth patches
returns g0, g1 where
diff --git a/utils/raspberrypi/ctt/ctt_image_load.py b/utils/raspberrypi/ctt/ctt_image_load.py
index e373c7c0d2a0..240d68f984a2 100644
--- a/utils/raspberrypi/ctt/ctt_image_load.py
+++ b/utils/raspberrypi/ctt/ctt_image_load.py
@@ -418,6 +418,7 @@ def load_image(Cam, im_str, mac_config=None, show=False, mac=True, show_meta=Fal
# print('\nERROR:\nInvalid file extension')
return 0
+
"""
bytearray splice to number little endian
"""
diff --git a/utils/raspberrypi/ctt/ctt_lux.py b/utils/raspberrypi/ctt/ctt_lux.py
index 55b2aa299ed3..ab367cae37d7 100644
--- a/utils/raspberrypi/ctt/ctt_lux.py
+++ b/utils/raspberrypi/ctt/ctt_lux.py
@@ -19,6 +19,7 @@ def lux(Cam, Img):
channels = [Img.channels[i] for i in Img.order]
return lux_calc(Cam, Img, patches, channels), shutter_speed, gain
+
"""
perform lux calibration on bayer channels
"""
diff --git a/utils/raspberrypi/ctt/ctt_macbeth_locator.py b/utils/raspberrypi/ctt/ctt_macbeth_locator.py
index 4e666b0f1089..6567490c5539 100644
--- a/utils/raspberrypi/ctt/ctt_macbeth_locator.py
+++ b/utils/raspberrypi/ctt/ctt_macbeth_locator.py
@@ -21,6 +21,7 @@ output to the console
def fxn():
warnings.warn("runtime", RuntimeWarning)
+
"""
Define the success message
"""
diff --git a/utils/raspberrypi/ctt/ctt_tools.py b/utils/raspberrypi/ctt/ctt_tools.py
index 3a2fb4af95c5..d5d64d47d25b 100644
--- a/utils/raspberrypi/ctt/ctt_tools.py
+++ b/utils/raspberrypi/ctt/ctt_tools.py
@@ -48,6 +48,8 @@ def get_config(dictt, key, default, ttype):
except (KeyError, ValueError):
val = default
return val
+
+
"""
argument parser
"""
@@ -67,6 +69,8 @@ def parse_input():
if json_output is None:
raise ArgError('\n\nERROR! No output json given.')
return json_output, directory, config, log_path
+
+
"""
custom arg and macbeth error class
"""
@@ -75,6 +79,7 @@ class ArgError(Exception):
class MacbethError(Exception):
pass
+
"""
correlation function to quantify match
"""
@@ -84,6 +89,7 @@ def correlate(im1, im2):
cor = np.corrcoef(f1, f2)
return cor[0][1]
+
"""
get list of files from directory
"""
@@ -94,6 +100,7 @@ def get_photos(directory='photos'):
filename_list.append(filename)
return filename_list
+
"""
display image for debugging... read at your own risk...
"""
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list