From patchwork Thu Jan 23 11:41:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22626 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 4B5F4BDE6B for ; Thu, 23 Jan 2025 11:42:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BC18668576; Thu, 23 Jan 2025 12:42:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tPQebcrL"; 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 0CCFA6856F for ; Thu, 23 Jan 2025 12:42:43 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c0a:33cd:b453:5d3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 827E21AEE; Thu, 23 Jan 2025 12:41:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1737632499; bh=WADHu65mbtZ/NsO8A60cEh1k6Xo9MEkSoQlshS2XCJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tPQebcrLLEGjjOd1s5YoZRWfAUv2DkPgYJLImBEeVy6/RXJYxnyVCc89MN/EFne3/ pk8EI5Bb/mJj0tzllnzVS68R0PNjAz9R3l4nIqht8DQF/cpJ+eXq2YJnisNKJdh8ZU GLewBwRl0viBFXGPeUT6NWpV7x/ISB34aRXnjYhY= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Paul Elder , Daniel Scally Subject: [PATCH v2 11/17] ipa: rkisp1: awb: Apply gains based on default colour temperature on start Date: Thu, 23 Jan 2025 12:41:01 +0100 Message-ID: <20250123114204.79321-12-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250123114204.79321-1-stefan.klug@ideasonboard.com> References: <20250123114204.79321-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" The colour gains are initialized with a default value of 1. Improve that by querying the auto white balance algorithm for the gains for a default colour temperature. This is still not based on measurements, but it is still better than the current implementation. If the algorithm doesn't implement mapping from colour temperature to gains, it will internally fallback to 1.0. Signed-off-by: Stefan Klug Reviewed-by: Paul Elder Reviewed-by: Daniel Scally --- Changes in v2: - Collected tags --- src/ipa/rkisp1/algorithms/awb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 55e1b43c8cd2..f92ff2f0f716 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -125,7 +125,8 @@ int Awb::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) { context.activeState.awb.gains.manual = RGB{ 1.0 }; - context.activeState.awb.gains.automatic = RGB{ 1.0 }; + context.activeState.awb.gains.automatic = + awbAlgo_->gainsFromColourTemperature(kDefaultColourTemperature); context.activeState.awb.autoEnabled = true; context.activeState.awb.temperatureK = kDefaultColourTemperature;