From patchwork Thu Jan 9 11:54:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22498 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 789CDC32EA for ; Thu, 9 Jan 2025 11:55:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1984868541; Thu, 9 Jan 2025 12:55:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="p8eWFrIh"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DD31D68549 for ; Thu, 9 Jan 2025 12:55:34 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:93b9:eca8:897d:eae6]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 535676F3; Thu, 9 Jan 2025 12:54:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736423681; bh=GhhoTJtyX+AEcCErZ2QM5LTWxhyVrJ4mPx3umBjy400=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p8eWFrIh/qjxrgIvvkz5ol4wVYuJlhxHlEqi8rIG83xJzMTwDsPoVnR1JhLI6WV+F 6WXW4/t5/4FFq06SDnvQTNgpPCrHhDeJbSs8FXymfJflVG4j2fLtoJDpbu0L/YQamV 6fpEemmKVLK9NqgxBO4DxSeF1XK87vwWLeIDrTSU= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 11/11] ipa: rkisp1: awb: Apply gains based on default colour temperature on start Date: Thu, 9 Jan 2025 12:54:02 +0100 Message-ID: <20250109115412.356768-12-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250109115412.356768-1-stefan.klug@ideasonboard.com> References: <20250109115412.356768-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 --- 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 39a2c0589943..1761185b1181 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;