From patchwork Tue May 12 00:03:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3777 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 53DF760E1E for ; Tue, 12 May 2020 02:03:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="k2TisRIn"; dkim-atps=neutral Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C984911F3; Tue, 12 May 2020 02:03:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1589241828; bh=qYgSzfYk8qfXQvj7AQz1975n95mssuUQXjDhA6CrPfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2TisRInK4BWCAKGwnA9TuKnSCiTTOVPcYTPR7kItEg71CeVk8CdPvXtTtpYBUZOq 8ciH6ah9s7C5FG9UG9OUbqQt2GloZqdZsBes4ZMQ9DqFHEPxa6sv+nISF80l/ruaej PypO/pcBx/p0jY3Vo1YU/KYnDozotrtTB2TMH3j0= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 12 May 2020 03:03:21 +0300 Message-Id: <20200512000322.11753-24-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512000322.11753-1-laurent.pinchart@ideasonboard.com> References: <20200512000322.11753-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 23/24] utils: raspberrypi: ctt: Fix pycodestyle E305 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 00:03:49 -0000 E305 expected 2 blank lines after class or function definition Signed-off-by: Laurent Pinchart --- utils/raspberrypi/ctt/ctt.py | 2 ++ utils/raspberrypi/ctt/ctt_alsc.py | 2 ++ utils/raspberrypi/ctt/ctt_awb.py | 1 + utils/raspberrypi/ctt/ctt_ccm.py | 2 ++ utils/raspberrypi/ctt/ctt_geq.py | 1 + utils/raspberrypi/ctt/ctt_image_load.py | 1 + utils/raspberrypi/ctt/ctt_lux.py | 1 + utils/raspberrypi/ctt/ctt_macbeth_locator.py | 1 + utils/raspberrypi/ctt/ctt_tools.py | 7 +++++++ 9 files changed, 18 insertions(+) diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py index 8f8e06f069df..02f1d8531269 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 b697ed3e22b4..b988f565f245 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 c269b67a12c0..834d4dec2742 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 0a4eb57a8cdf..dd660e40bb66 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 1ffa4e91b1b7..d24b216389df 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 e373c7c0d2a0..240d68f984a2 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 55b2aa299ed3..ab367cae37d7 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 4e666b0f1089..6567490c5539 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 3a2fb4af95c5..d5d64d47d25b 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... """