From patchwork Thu Oct 6 12:01:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17538 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 53A7DC0DA4 for ; Thu, 6 Oct 2022 12:01:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 14BB062D01; Thu, 6 Oct 2022 14:01:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665057690; bh=OD3pHQLn5o9+nGWkB9nOeKv2ZxjIZctNvJLiT2moTIM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hFNSHYuKIipMxNL9/A+d9TJAEMWuf8nlOf2nvMbCQIZ94hiRPbn+QvY4G3+f42erq vonYR9FCU+YzjR4wjLyLR+X+Jsv1bpez+m9ckuyl0NDTRARD57to4ZTbEwYSzinJU3 33PZV3h/+U1MN/QazQieaZsgnp1+KZzhqHUdSLJDJ+trEJCEqy7cCP4IewC8WVEKE+ TDF8tDNngyo2GQFzeKB+oSlIFQFwme8acc6thcyHRBnUTqjVisiogyvRr2P5oed1l0 AtB+ojIh4o1OeK23JZ6hOeiObv34zNuiJpXk+bTlAbs1c2UIjUGd+0O8mFxR/G0uYU I2G16kGGiq2bQ== 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 DF50F62D01 for ; Thu, 6 Oct 2022 14:01:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UUN5ntTW"; dkim-atps=neutral Received: from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 692B94DD; Thu, 6 Oct 2022 14:01:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665057687; bh=OD3pHQLn5o9+nGWkB9nOeKv2ZxjIZctNvJLiT2moTIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UUN5ntTWH9lLVb30AVw9zKtREItN9PuwAF+IIrhlVj5UDdp2ttuMaDQN9WU23Z7Yd W1J4U3iipY3wgOlOn7iADnYlTGdRO1MMA0dNY8rl/+ZK/g/eJWWm/TKA4hpAivs0/d 7s5kIZ5yzKbG8ntvHeK2N1vzwVPxnVAE/P+AxTxQ= To: libcamera-devel@lists.libcamera.org Date: Thu, 6 Oct 2022 21:01:03 +0900 Message-Id: <20221006120105.3861831-6-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221006120105.3861831-1-paul.elder@ideasonboard.com> References: <20221006120105.3861831-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 5/7] utils: tuning: Add alsc-only libtuning raspberrypi tuning script 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-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a tuning script for raspberrypi for alsc only, that uses libtuning. Since there will also be a tuning script for raspberrypi that has more modules, put the libtuning alsc module definition in a separate file so that it can be reused later. Signed-off-by: Paul Elder --- utils/tuning/raspberrypi/__init__.py | 0 utils/tuning/raspberrypi/alsc.py | 18 ++++++++++++++++++ utils/tuning/raspberrypi_alsc_only.py | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 utils/tuning/raspberrypi/__init__.py create mode 100644 utils/tuning/raspberrypi/alsc.py create mode 100755 utils/tuning/raspberrypi_alsc_only.py diff --git a/utils/tuning/raspberrypi/__init__.py b/utils/tuning/raspberrypi/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/utils/tuning/raspberrypi/alsc.py b/utils/tuning/raspberrypi/alsc.py new file mode 100644 index 00000000..dd92cb8b --- /dev/null +++ b/utils/tuning/raspberrypi/alsc.py @@ -0,0 +1,18 @@ +import libtuning as lt +from libtuning.modules import ALSC + +RaspberryPiALSC = \ + ALSC(do_color=lt.param('do_alsc_colour', lt.param.mode.Optional, True), + debug=[lt.debug.Plot], + luminance_strength=lt.param('luminance_strength', lt.param.mode.Optional, 0.5), + sector_shape=(16, 12), + sector_x_gradient=lt.gradient.Linear, + sector_y_gradient=lt.gradient.Linear, + sector_x_remainder=lt.remainder.DistributeFront, + sector_y_remainder=lt.remainder.DistributeFront, + sector_average_function=lt.average_functions.Mean, + smoothing_function=lt.smoothing.MedianBlur, + output_type=float, + output_color_channels=[lt.color.R, lt.color.G, lt.color.B], + output_range=(0, 3.999) + ) diff --git a/utils/tuning/raspberrypi_alsc_only.py b/utils/tuning/raspberrypi_alsc_only.py new file mode 100755 index 00000000..e1e7b6e3 --- /dev/null +++ b/utils/tuning/raspberrypi_alsc_only.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import sys + +import libtuning as lt +from libtuning.modules import ALSC +from libtuning.parsers import RaspberryPiParser +from libtuning.generators import RaspberryPiOutput + +from raspberrypi.alsc import ALSC as RaspberryPiALSC + +tuner = lt.Camera('Raspberry Pi (ALSC only)') +tuner.add(RaspberryPiALSC) +tuner.setInputType(RaspberryPiParser) +tuner.setOutputType(RaspberryPiOutput) +tuner.setOutputOrder([ALSC]) + +tuner.run(sys.argv)