summaryrefslogtreecommitdiff
path: root/utils/raspberrypi
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 17:00:13 +0300
commit33c4221e8700e15db55994e510d86225d6cd9ece (patch)
tree19d611a79ec39e3075b15bf90037f73de6370afa /utils/raspberrypi
parent2b21c6ac861c5844f9e4535a43a514f979bfd133 (diff)
utils: raspberrypi: ctt: Fix pycodestyle E305
E305 expected 2 blank lines after class or function definition 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')
-rwxr-xr-xutils/raspberrypi/ctt/ctt.py2
-rw-r--r--utils/raspberrypi/ctt/ctt_alsc.py2
-rw-r--r--utils/raspberrypi/ctt/ctt_awb.py1
-rw-r--r--utils/raspberrypi/ctt/ctt_ccm.py2
-rw-r--r--utils/raspberrypi/ctt/ctt_geq.py1
-rw-r--r--utils/raspberrypi/ctt/ctt_image_load.py1
-rw-r--r--utils/raspberrypi/ctt/ctt_lux.py1
-rw-r--r--utils/raspberrypi/ctt/ctt_macbeth_locator.py1
-rw-r--r--utils/raspberrypi/ctt/ctt_tools.py7
9 files changed, 18 insertions, 0 deletions
diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py
index dc805ae3..ed34bfaa 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 b697ed3e..b988f565 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 71ad6b0e..96de004c 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 0a4eb57a..dd660e40 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 1ffa4e91..d24b2163 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 e373c7c0..240d68f9 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 55b2aa29..ab367cae 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 4e666b0f..6567490c 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 3a2fb4af..d5d64d47 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...
"""