utils: raspberrypi: ctt: Fix pycodestyle E251
E251 unexpected spaces around keyword / parameter equals 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
6eb1bce9c7
commit
965cae72a7
6 changed files with 9 additions and 9 deletions
|
@ -474,7 +474,7 @@ class Camera:
|
|||
run calibration on all images and sort by slope.
|
||||
"""
|
||||
plot = "rpi.noise" in self.plot
|
||||
noise_out = sorted([noise(self, Img, plot) for Img in self.imgs], key = lambda x: x[0])
|
||||
noise_out = sorted([noise(self, Img, plot) for Img in self.imgs], key=lambda x: x[0])
|
||||
self.log += '\nFinished processing images'
|
||||
"""
|
||||
take the average of the interquartile
|
||||
|
|
|
@ -131,7 +131,7 @@ def alsc(Cam, Img, do_alsc_colour, plot=False):
|
|||
"""
|
||||
average the green channels into one
|
||||
"""
|
||||
av_ch_g = np.mean((channels[1:2]), axis = 0)
|
||||
av_ch_g = np.mean((channels[1:2]), axis=0)
|
||||
if do_alsc_colour:
|
||||
"""
|
||||
obtain 16x12 grid of intensities for each channel and subtract black level
|
||||
|
|
|
@ -27,7 +27,7 @@ def geq_fit(Cam, plot):
|
|||
data is sorted by green difference and top half is selected since higher
|
||||
green difference data define the decision boundary.
|
||||
"""
|
||||
geqs = np.array(sorted(geqs, key = lambda r: np.abs((r[1]-r[0])/r[0])))
|
||||
geqs = np.array(sorted(geqs, key=lambda r: np.abs((r[1]-r[0])/r[0])))
|
||||
|
||||
length = len(geqs)
|
||||
g0 = geqs[length//2:, 0]
|
||||
|
|
|
@ -487,8 +487,8 @@ def get_macbeth_chart(img, ref_data):
|
|||
"""
|
||||
clustering = cluster.AgglomerativeClustering(
|
||||
n_clusters=None,
|
||||
compute_full_tree = True,
|
||||
distance_threshold = side*2
|
||||
compute_full_tree=True,
|
||||
distance_threshold=side*2
|
||||
)
|
||||
mac_mids_list = [x[0] for x in mac_mids]
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ def noise(Cam, Img, plot):
|
|||
plt.plot(x, fit_plot_2, label='fit 0 intercept', color='green', ls='--')
|
||||
plt.plot(0, 0)
|
||||
plt.title('Noise Plot\nImg: {}'.format(Img.str))
|
||||
plt.legend(loc = 'upper left')
|
||||
plt.legend(loc='upper left')
|
||||
plt.xlabel('Sqrt Pixel Value')
|
||||
plt.ylabel('Noise Standard Deviation')
|
||||
plt.grid()
|
||||
|
|
|
@ -11,7 +11,7 @@ scale = 2
|
|||
"""
|
||||
constructs normalised macbeth chart corners for ransac algorithm
|
||||
"""
|
||||
def get_square_verts(c_err = 0.05, scale = scale):
|
||||
def get_square_verts(c_err=0.05, scale=scale):
|
||||
"""
|
||||
define macbeth chart corners
|
||||
"""
|
||||
|
@ -57,13 +57,13 @@ 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):
|
||||
def get_square_centres(c_err=0.05, scale=scale):
|
||||
"""
|
||||
define macbeth square centres
|
||||
"""
|
||||
verts, mac_norm = get_square_verts(c_err, scale=scale)
|
||||
|
||||
centres = np.mean(verts, axis = 1)
|
||||
centres = np.mean(verts, axis=1)
|
||||
# print('centres')
|
||||
# print(centres)
|
||||
return np.array(centres, np.float32)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue