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:
Laurent Pinchart 2020-05-02 03:32:00 +03:00
parent 6eb1bce9c7
commit 965cae72a7
6 changed files with 9 additions and 9 deletions

View file

@ -474,7 +474,7 @@ class Camera:
run calibration on all images and sort by slope. run calibration on all images and sort by slope.
""" """
plot = "rpi.noise" in self.plot 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' self.log += '\nFinished processing images'
""" """
take the average of the interquartile take the average of the interquartile

View file

@ -131,7 +131,7 @@ def alsc(Cam, Img, do_alsc_colour, plot=False):
""" """
average the green channels into one 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: if do_alsc_colour:
""" """
obtain 16x12 grid of intensities for each channel and subtract black level obtain 16x12 grid of intensities for each channel and subtract black level

View file

@ -27,7 +27,7 @@ def geq_fit(Cam, plot):
data is sorted by green difference and top half is selected since higher data is sorted by green difference and top half is selected since higher
green difference data define the decision boundary. 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) length = len(geqs)
g0 = geqs[length//2:, 0] g0 = geqs[length//2:, 0]

View file

@ -487,8 +487,8 @@ def get_macbeth_chart(img, ref_data):
""" """
clustering = cluster.AgglomerativeClustering( clustering = cluster.AgglomerativeClustering(
n_clusters=None, n_clusters=None,
compute_full_tree = True, compute_full_tree=True,
distance_threshold = side*2 distance_threshold=side*2
) )
mac_mids_list = [x[0] for x in mac_mids] mac_mids_list = [x[0] for x in mac_mids]

View file

@ -102,7 +102,7 @@ def noise(Cam, Img, plot):
plt.plot(x, fit_plot_2, label='fit 0 intercept', color='green', ls='--') plt.plot(x, fit_plot_2, label='fit 0 intercept', color='green', ls='--')
plt.plot(0, 0) plt.plot(0, 0)
plt.title('Noise Plot\nImg: {}'.format(Img.str)) plt.title('Noise Plot\nImg: {}'.format(Img.str))
plt.legend(loc = 'upper left') plt.legend(loc='upper left')
plt.xlabel('Sqrt Pixel Value') plt.xlabel('Sqrt Pixel Value')
plt.ylabel('Noise Standard Deviation') plt.ylabel('Noise Standard Deviation')
plt.grid() plt.grid()

View file

@ -11,7 +11,7 @@ scale = 2
""" """
constructs normalised macbeth chart corners for ransac algorithm 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 define macbeth chart corners
""" """
@ -57,13 +57,13 @@ def get_square_verts(c_err = 0.05, scale = scale):
# print(square_verts) # print(square_verts)
return np.array(square_verts, np.float32), mac_norm 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 define macbeth square centres
""" """
verts, mac_norm = get_square_verts(c_err, scale=scale) 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')
# print(centres) # print(centres)
return np.array(centres, np.float32) return np.array(centres, np.float32)