From patchwork Wed Nov 18 16:47:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: GuyliandeJong X-Patchwork-Id: 29026 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 196E9C3304 for ; Wed, 18 Nov 2026 16:47:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C165E6A912; Wed, 18 Nov 2026 17:47:10 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=proton.me header.i=@proton.me header.b="fOnMtRpn"; dkim-atps=neutral Received: from mail-24416.protonmail.ch (mail-24416.protonmail.ch [109.224.244.16]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B5BC6A900 for ; Wed, 18 Nov 2026 17:47:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1795020428; x=1795279628; bh=kPaHdNMPNF6wh6zn7dTO/fTDikW3573LXIk6vBZEs/I=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=fOnMtRpngzkkLkpMHqz7ZyLMUNMHBPK+8VEsQ21vf9QUmClJYAgRxW3DX0gs+wkbX QEB/ZFNFLru9cu7Rvznt6rJBOoz2wtWkZMijIRkcjLptA7gun3lrCPpZljEIvy0wP8 W4fApPb0yVjEc25Vu5enzlOOGzESSMNvYz1MFkDCaY8j9op0IQqpfMf7E5C8WrfUeg ipWo/6uTW1vldNv9Ym8XL1yQPTNIuLPhX/+Y0CBM1aSJgvXcAhKbfYS/Mm4S2MTuu7 fwS5iqYOGXM3JOanEYBJCs0JP45jlFQGrD51IkvKtCmkzB3sHNIUSSvqp2ESWfci7Z GIfzeGaCkoiKQ== Date: Wed, 18 Nov 2026 16:47:03 +0000 To: libcamera-devel@lists.libcamera.org From: GuyliandeJong Cc: Daniel Scally , Barnabas Pocze , Afonso Figuinha Subject: [PATCH 5/6] ipa: ipu3: Add a tuning file for the OV9734 Message-ID: <20261118164621.15513-6-guyliandejong@proton.me> In-Reply-To: <20261118164621.15513-1-guyliandejong@proton.me> References: <20261118164621.15513-1-guyliandejong@proton.me> Feedback-ID: 112452169:user:proton X-Pm-Message-ID: 655fb292366cfa8753870246998ba0e2313199bc 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 OV9734, used as the front camera of the Surface Laptop 1 and 2, has strong lens shading: the relative illumination drops to about 0.38 at three quarters of the image radius and to about 0.25 in the corners, and the red channel falls off faster than the others. The uncalibrated tuning file has no Lsc entry, so none of this is corrected. Add a tuning file with a polynomial Lsc table, and keep the other algorithms at their defaults as in uncalibrated.yaml. The polynomials were measured on a Surface Laptop 2 from raw CIO2 frames of a diffuser over the lens, under room lighting of about 3200K. The log of each frame was fitted with a radial polynomial plus a plane, to separate the lens shading from gradients in the lighting. Two captures with the light coming from different directions gave the same radial falloff (a gain of 1.56 and 1.66 at half the radius, 2.64 for both at three quarters). With this file, the processed image of the flat field is uniform to within 3%, against a corner to centre ratio of 0.64 without it. The corner gains of up to 4.6 are clamped to the 4.0 maximum of the LUT format, which only affects the outermost corners. Signed-off-by: GuyliandeJong --- src/ipa/ipu3/data/meson.build | 1 + src/ipa/ipu3/data/ov9734.yaml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/ipa/ipu3/data/ov9734.yaml diff --git a/src/ipa/ipu3/data/meson.build b/src/ipa/ipu3/data/meson.build index 0f7cd5c6..9fb0cfdb 100644 --- a/src/ipa/ipu3/data/meson.build +++ b/src/ipa/ipu3/data/meson.build @@ -1,6 +1,7 @@ # SPDX-License-Identifier: CC0-1.0 conf_files = files([ + 'ov9734.yaml', 'uncalibrated.yaml', ]) diff --git a/src/ipa/ipu3/data/ov9734.yaml b/src/ipa/ipu3/data/ov9734.yaml new file mode 100644 index 00000000..d031ec3f --- /dev/null +++ b/src/ipa/ipu3/data/ov9734.yaml @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: CC0-1.0 +%YAML 1.1 +--- +version: 1 +algorithms: + - Af: + - Agc: + - Awb: + - BlackLevelCorrection: + - Ccm: + - Lsc: + # Measured from raw flat fields (diffuser over the lens) on a Surface + # Laptop 2, under room lighting of about 3200K. + type: polynomial + sets: + - ct: 3200 + r: { cx: 0.5, cy: 0.5, k0: 2.1956, k1: 1.7585, k2: 2.9072, k3: -3.2151, k4: 0.0 } + gr: { cx: 0.5, cy: 0.5, k0: 2.0225, k1: 1.5855, k2: 0.9147, k3: -1.6029, k4: 0.0 } + gb: { cx: 0.5, cy: 0.5, k0: 2.0237, k1: 1.5748, k2: 1.0013, k3: -1.6269, k4: 0.0 } + b: { cx: 0.5, cy: 0.5, k0: 1.8914, k1: 1.7020, k2: 1.6762, k3: -2.6457, k4: 0.0 } + - ToneMapping: +...