From patchwork Fri Jul 5 14:41:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20609 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8EB58BD87C for ; Fri, 5 Jul 2024 14:43:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 39DDD63372; Fri, 5 Jul 2024 16:43:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Dgkv+Qqf"; dkim-atps=neutral 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 788AA63367 for ; Fri, 5 Jul 2024 16:43:04 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:60b6:33a3:3a20:6030]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ECF0B4CC; Fri, 5 Jul 2024 16:42:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1720190555; bh=HM13yj/E/MbjeNSkEMeGwLwbNhbgFCmUhpbdNuqcNs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dgkv+QqfMaaV6r0jWnYUtip8chJao3E7FIlN7Ff5V6FyYAkvJSCk2drJ96L234Da+ xCPRgSynKZXzFgJCnujzFQ8oxCfPn/KfZc1Ok73EOo7fdAfY+mZfzT2tagFxr/jfwv z5UAKpp7YMBubID8Gxp5vh1aL01uuLYB02Zb6VjI= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Paul Elder Subject: [PATCH v4 20/23] tuning: rkisp1: Add some static modules Date: Fri, 5 Jul 2024 16:41:56 +0200 Message-ID: <20240705144209.418906-21-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240705144209.418906-1-stefan.klug@ideasonboard.com> References: <20240705144209.418906-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add awb, blc, cproc, filter, and gamma to the tuning file. These don't need any configuration. At the moment there are no inter-module dependencies in the tuning process. We can therefore safely sort them alphabetically. As soon as the first dependency gets introduced (most likely lsc -> ccm) we will see how to solve that. The output order controls the order of processing in the IPA. It is now also in alphabetical order which happens to be no change for the modules that existed previously. For the others, there is no need for a specific order. Signed-off-by: Stefan Klug Reviewed-by: Paul Elder Reviewed-by: Daniel Scally --- utils/tuning/rkisp1.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/utils/tuning/rkisp1.py b/utils/tuning/rkisp1.py index fae35783c656..0d279a39ab1b 100755 --- a/utils/tuning/rkisp1.py +++ b/utils/tuning/rkisp1.py @@ -15,11 +15,24 @@ from libtuning.generators import YamlOutput from libtuning.modules.lsc import LSCRkISP1 from libtuning.modules.agc import AGCRkISP1 from libtuning.modules.ccm import CCMRkISP1 - +from libtuning.modules.static import StaticModule coloredlogs.install(level=logging.INFO, fmt='%(name)s %(levelname)s %(message)s') +awb = StaticModule('Awb') +blc = StaticModule('BlackLevelCorrection') +color_processing = StaticModule('ColorProcessing') +filter = StaticModule('Filter') +gamma_out = StaticModule('GammaOutCorrection', {'gamma': 2.2}) + tuner = lt.Tuner('RkISP1') +tuner.add(AGCRkISP1(debug=[lt.Debug.Plot])) +tuner.add(awb) +tuner.add(blc) +tuner.add(CCMRkISP1(debug=[lt.Debug.Plot])) +tuner.add(color_processing) +tuner.add(filter) +tuner.add(gamma_out) tuner.add(LSCRkISP1( debug=[lt.Debug.Plot], # This is for the actual LSC tuning, and is part of the base LSC @@ -39,11 +52,11 @@ tuner.add(LSCRkISP1( # values. This can also be a custom function. smoothing_function=lt.smoothing.MedianBlur(3), )) -tuner.add(AGCRkISP1(debug=[lt.Debug.Plot])) -tuner.add(CCMRkISP1(debug=[lt.Debug.Plot])) + tuner.set_input_parser(YamlParser()) tuner.set_output_formatter(YamlOutput()) -tuner.set_output_order([AGCRkISP1, CCMRkISP1, LSCRkISP1]) +tuner.set_output_order([AGCRkISP1, awb, blc, CCMRkISP1, color_processing, + filter, gamma_out, LSCRkISP1]) if __name__ == '__main__': sys.exit(tuner.run(sys.argv))