From patchwork Thu Dec 19 17:57:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22408 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 E244AC3272 for ; Thu, 19 Dec 2024 17:57:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B8D4C68472; Thu, 19 Dec 2024 18:57:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Y3ioFpB1"; 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 CAF0661899 for ; Thu, 19 Dec 2024 18:57:34 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:783:85f9:c998:cb11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E254C163; Thu, 19 Dec 2024 18:56:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734631016; bh=PcpELKNwZmor4Se6r1qyMP0HJcH3vqQ02B28QJIKmCU=; h=From:To:Cc:Subject:Date:From; b=Y3ioFpB17GWbW/pEI5nv6aiUJEnzaSlGt059/fnjB7mKFB0WfruoN6R1RThI+UQxH lHGKAY7IgVYp9ovYuu4hC6qlqVv8ZBPHdP5HUt7P6yG2gL9/NM6JWxdyttnl4VYFTt pIKf9HhRfjtysMAiBJ2pAR6cbMR8bZidkXxkY6rM= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v6 0/9] rkisp1: Add manual colour temperature control Date: Thu, 19 Dec 2024 18:57:17 +0100 Message-ID: <20241219175729.293782-1-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 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" This series adds the ability to manually set the colour temperature control. It is a partial resurrection of the "libcamera: controls: Update the ColourTemperature control to be writable" series by David Plowman [1], but with a implementation for the rkisp1 instead of the rpi. Patch 1 updates the control id documentation. Patches 2-3 implement the control for the rkisp1. Patches 4-8 update the tuning scripts accordingly. Patch 9 is a rebase of the RPi implementation form [1]. It was tested and seems to work as expected. After some discussions in v4 an agreement on the expected behavior of the manual controls was found and documented in control_ids_core.yaml. Changes v5 -> v6: - Updated documentation according to discussions in v4 - Fixed minor issues from v5 reviews - Changed colour temperature metadata to be the temperature used for the frame instead of the latest measurement - Added the RPi implementation form David as patch 9/9 Changes v4 -> v5: - Rebased on current master - Small fixes from review - Replaced Interpolator with Interpolator as we now have a genric Vector class. Changes v1 -> v4: - Incremented series version to v4, because technically it is a superset of [1] - Fixed compile issue on patch 2 - Fixed typos and wording in patch 1 - Collected tags Best regards, Stefan [1] https://patchwork.libcamera.org/project/libcamera/list/?series=4083 David Plowman (1): ipa: rpi: awb: Make it possible to set the colour temperature directly Stefan Klug (8): libcamera: controls: Update the ColourTemperature control to be writable ipa: rkisp1: awb: Load white balance gains from tuning file ipa: rkisp1: awb: Implement ColourTemperature control libtuning: Use logging framework in ctt_awb.awb() libtuning: Remove the Cam object from ctt_awb.awb() libtuning: Fix access to color member in ctt_awb.awb() libtuning: Add initial AWB module utils: tuning: rkisp1: Replace static AWB with new AWB module src/ipa/rkisp1/algorithms/awb.cpp | 67 ++++++++++++++++--- src/ipa/rkisp1/algorithms/awb.h | 7 ++ src/ipa/rkisp1/ipa_context.h | 1 + src/ipa/rpi/common/ipa_base.cpp | 20 ++++++ src/ipa/rpi/controller/awb_algorithm.h | 1 + src/ipa/rpi/controller/rpi/awb.cpp | 18 +++++ src/ipa/rpi/controller/rpi/awb.h | 1 + src/libcamera/control_ids_core.yaml | 38 ++++++++++- utils/tuning/libtuning/ctt_awb.py | 55 +++++++-------- .../tuning/libtuning/modules/awb/__init__.py | 6 ++ utils/tuning/libtuning/modules/awb/awb.py | 36 ++++++++++ utils/tuning/libtuning/modules/awb/rkisp1.py | 27 ++++++++ utils/tuning/rkisp1.py | 4 +- 13 files changed, 240 insertions(+), 41 deletions(-) create mode 100644 utils/tuning/libtuning/modules/awb/__init__.py create mode 100644 utils/tuning/libtuning/modules/awb/awb.py create mode 100644 utils/tuning/libtuning/modules/awb/rkisp1.py