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>
This commit is contained in:
parent
2b21c6ac86
commit
33c4221e87
9 changed files with 18 additions and 0 deletions
|
@ -60,6 +60,7 @@ def get_col_lux(string):
|
||||||
return col, None
|
return col, None
|
||||||
return int(col), int(lux)
|
return int(col), int(lux)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Camera object that is the backbone of the tuning tool.
|
Camera object that is the backbone of the tuning tool.
|
||||||
Input is the desired path of the output json.
|
Input is the desired path of the output json.
|
||||||
|
@ -797,6 +798,7 @@ def run_ctt(json_output, directory, config, log_output):
|
||||||
else:
|
else:
|
||||||
Cam.write_log(log_output)
|
Cam.write_log(log_output)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
"""
|
"""
|
||||||
initialise calibration
|
initialise calibration
|
||||||
|
|
|
@ -218,6 +218,7 @@ def get_16x12_grid(chan, dx, dy):
|
||||||
"""
|
"""
|
||||||
return np.array(grid)
|
return np.array(grid)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
obtains sigmas for red and blue, effectively a measure of the 'error'
|
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)
|
# print(sigma_r, sigma_b)
|
||||||
return sigma_r, sigma_b
|
return sigma_r, sigma_b
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
calculate sigma from two adjacent gain tables
|
calculate sigma from two adjacent gain tables
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -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))
|
return(ct_curve, np.round(transverse_pos, 5), np.round(transverse_neg, 5))
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
obtain greyscale patches and perform alsc colour correction
|
obtain greyscale patches and perform alsc colour correction
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -16,6 +16,7 @@ def degamma(x):
|
||||||
x = x * ((2**16)-1)
|
x = x * ((2**16)-1)
|
||||||
return x
|
return x
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
FInds colour correction matrices for list of images
|
FInds colour correction matrices for list of images
|
||||||
"""
|
"""
|
||||||
|
@ -153,6 +154,7 @@ def ccm(Cam, cal_cr_list, cal_cb_list):
|
||||||
})
|
})
|
||||||
return ccms
|
return ccms
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
calculates the ccm for an individual image.
|
calculates the ccm for an individual image.
|
||||||
ccms are calculate in rgb space, and are fit by hand. Although it is a 3x3
|
ccms are calculate in rgb space, and are fit by hand. Although it is a 3x3
|
||||||
|
|
|
@ -165,6 +165,7 @@ def geq_fit(Cam, plot):
|
||||||
|
|
||||||
return round(slope, 5), int(offset)
|
return round(slope, 5), int(offset)
|
||||||
|
|
||||||
|
|
||||||
""""
|
""""
|
||||||
Return green channels of macbeth patches
|
Return green channels of macbeth patches
|
||||||
returns g0, g1 where
|
returns g0, g1 where
|
||||||
|
|
|
@ -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')
|
# print('\nERROR:\nInvalid file extension')
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
bytearray splice to number little endian
|
bytearray splice to number little endian
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -19,6 +19,7 @@ def lux(Cam, Img):
|
||||||
channels = [Img.channels[i] for i in Img.order]
|
channels = [Img.channels[i] for i in Img.order]
|
||||||
return lux_calc(Cam, Img, patches, channels), shutter_speed, gain
|
return lux_calc(Cam, Img, patches, channels), shutter_speed, gain
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
perform lux calibration on bayer channels
|
perform lux calibration on bayer channels
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -21,6 +21,7 @@ output to the console
|
||||||
def fxn():
|
def fxn():
|
||||||
warnings.warn("runtime", RuntimeWarning)
|
warnings.warn("runtime", RuntimeWarning)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Define the success message
|
Define the success message
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -48,6 +48,8 @@ def get_config(dictt, key, default, ttype):
|
||||||
except (KeyError, ValueError):
|
except (KeyError, ValueError):
|
||||||
val = default
|
val = default
|
||||||
return val
|
return val
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
argument parser
|
argument parser
|
||||||
"""
|
"""
|
||||||
|
@ -67,6 +69,8 @@ def parse_input():
|
||||||
if json_output is None:
|
if json_output is None:
|
||||||
raise ArgError('\n\nERROR! No output json given.')
|
raise ArgError('\n\nERROR! No output json given.')
|
||||||
return json_output, directory, config, log_path
|
return json_output, directory, config, log_path
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
custom arg and macbeth error class
|
custom arg and macbeth error class
|
||||||
"""
|
"""
|
||||||
|
@ -75,6 +79,7 @@ class ArgError(Exception):
|
||||||
class MacbethError(Exception):
|
class MacbethError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
correlation function to quantify match
|
correlation function to quantify match
|
||||||
"""
|
"""
|
||||||
|
@ -84,6 +89,7 @@ def correlate(im1, im2):
|
||||||
cor = np.corrcoef(f1, f2)
|
cor = np.corrcoef(f1, f2)
|
||||||
return cor[0][1]
|
return cor[0][1]
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
get list of files from directory
|
get list of files from directory
|
||||||
"""
|
"""
|
||||||
|
@ -94,6 +100,7 @@ def get_photos(directory='photos'):
|
||||||
filename_list.append(filename)
|
filename_list.append(filename)
|
||||||
return filename_list
|
return filename_list
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
display image for debugging... read at your own risk...
|
display image for debugging... read at your own risk...
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue