utils: raspberrypi: ctt: Fix pycodestyle E302

E302 expected 2 blank lines, found 0

Note that issues are still flagged, due to the use of docstrings as
multi-lines comments. This will be addressed separately.

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:
Laurent Pinchart 2020-05-02 03:32:00 +03:00
parent 33c4221e87
commit e8655c2161
12 changed files with 20 additions and 0 deletions

View file

@ -34,6 +34,7 @@ blank json file. This has been done to avoid reproducing the entire json file
in the code here, thereby avoiding unecessary clutter.
"""
"""
Get the colour and lux values from the strings of each inidvidual image
"""
@ -702,6 +703,7 @@ class Camera:
self.log += '\nERROR: Images are from different cameras'
return 0
def run_ctt(json_output, directory, config, log_output):
"""
check input files are jsons

View file

@ -9,6 +9,7 @@ import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
"""
preform alsc calibration on a set of images
"""

View file

@ -9,6 +9,7 @@ import matplotlib.pyplot as plt
from bisect import bisect_left
from scipy.optimize import fmin
"""
obtain piecewise linear approximation for colour curve
"""

View file

@ -7,6 +7,7 @@
from ctt_image_load import *
from ctt_awb import get_alsc_patches
"""
takes 8-bit macbeth chart values, degammas and returns 16 bit
"""

View file

@ -8,6 +8,7 @@ from ctt_tools import *
import matplotlib.pyplot as plt
import scipy.optimize as optimize
"""
Uses green differences in macbeth patches to fit green equalisation threshold
model. Ideally, all macbeth chart centres would fall below the threshold as

View file

@ -210,6 +210,7 @@ class Image:
self.patches = all_patches
return 1
def brcm_load_image(Cam, im_str):
"""
Load image where raw data and metadata is in the BRCM format
@ -290,6 +291,7 @@ def brcm_load_image(Cam, im_str):
return Img
def dng_load_image(Cam, im_str):
try:
Img = Image(None)

View file

@ -5,6 +5,8 @@
# ctt_lux.py - camera tuning tool for lux level
from ctt_tools import *
"""
Find lux values from metadata and calculate Y
"""

View file

@ -13,6 +13,7 @@ NOTE: some custom functions have been used here to make the code more readable.
These are defined in tools.py if they are needed for reference.
"""
"""
Some inconsistencies between packages cause runtime warnings when running
the clustering algorithm. This catches these warnings so they don't flood the
@ -291,6 +292,7 @@ def find_macbeth(Cam, img, mac_config=(0, 0)):
return(coords_fit)
def get_macbeth_chart(img, ref_data):
"""
function returns coordinates of macbeth chart vertices and square centres,

View file

@ -7,6 +7,7 @@
from ctt_image_load import *
import matplotlib.pyplot as plt
"""
Find noise standard deviation and fit to model:

View file

@ -4,6 +4,7 @@
#
# ctt_pretty_print_json.py - camera tuning tool JSON formatter
"""
takes a collapsed json file and makes it more readable
"""
@ -11,10 +12,12 @@ def process_file(string, fout, state):
for c in string:
process_char(c, fout, state)
def print_newline(fout, state):
fout.write('\n')
fout.write(' '*state["indent"]*4)
def process_char(c, fout, state):
if c == '{':
if not state["skipnewline"]:
@ -61,6 +64,7 @@ def process_char(c, fout, state):
fout.write(c)
state["skipnewline"] = (c == '[')
def pretty_print_json(str_in, output_filename):
state = {"indent": 0, "inarray": [False], "arraycount": [], "skipnewline": True}
with open(output_filename, "w") as fout:

View file

@ -8,6 +8,7 @@ import numpy as np
scale = 2
"""
constructs normalised macbeth chart corners for ransac algorithm
"""
@ -57,6 +58,7 @@ def get_square_verts(c_err=0.05, scale=scale):
# print(square_verts)
return np.array(square_verts, np.float32), mac_norm
def get_square_centres(c_err=0.05, scale=scale):
"""
define macbeth square centres

View file

@ -22,6 +22,7 @@ understanding of the code. They ar collated here to attempt to improve code
readability in the main files.
"""
"""
obtain config values, unless it doesnt exist, in which case pick default
Furthermore, it can check if the input is the correct type