From patchwork Thu Nov 12 16:25:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emfox Zhou X-Patchwork-Id: 28885 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 2FB6EC3307 for ; Thu, 12 Nov 2026 16:25:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 54B676A7DC; Thu, 12 Nov 2026 17:25:43 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=debian.org header.i=@debian.org header.b="j9B/evn0"; dkim-atps=neutral Received: from stravinsky.debian.org (stravinsky.debian.org [IPv6:2001:41b8:202:deb::311:108]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D551691CE for ; Thu, 12 Nov 2026 17:25:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:MIME-Version:Content-Transfer-Encoding :Content-Type:Cc:To:Message-ID:Date:Subject:From:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=uWbDEzj70nlLrbu8GBQpwqDZIxppDVlu88U8oFQeQAw=; b=j9B/evn0+8wgcXDWwclYay2nv4 hLMMtpgUZmeLgGMOUOdrCTxeX9/CF5+9TP5uL7tmMKqnIFgTBRo8kDqFoUQjjhQsNLnWlDXpYs6jS v+Ml7X558VONwfim1YN2JUCk6cbhFNNYNjfb1rVwgMpcmMYhFme+m+1GWkOtJUCxemNpGSpn6Yiee wmt69dKEG6zChDkrDua1Rq194WWOs9af8WYF9jcmjUtgWwHdFn7Y78r5Gxow69yDyFRiAymfiLx7N 4H2H9FbazZxNFyCU66OCPRoaL67BvDZHCkOf6W6vFf0X29WkdM66+lh8i89GMHoSQ2FkOQXOqk2em 4ItOrVyA==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1xRXcK-00E69x-10; Thu, 12 Nov 2026 16:25:40 +0000 From: Emfox Zhou Subject: [PATCH v2] ipa: softisp: Add tuning data for the ov13858 and ov5693 Date: Fri, 13 Nov 2026 00:25:30 +0800 Message-ID: <179450073012.501440.7287091337140390792@debian.org> To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Laurent Pinchart , Jacopo Mondi MIME-Version: 1.0 X-Debian-User: emfox 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" Both sensors are the cameras of the Surface Pro 8, the ov13858 at the back and the ov5693 in front, behind the Intel IPU6. With no tuning file of their own they fall back to uncalibrated.yaml, which has grey world AWB and no colour correction, and a white surface comes out with a green cast. The colour gains are the ones the module vendor ships in the AIQB blob that comes with the Windows camera driver of this machine, six light sources for the ov13858 (2514 K to 6366 K) and seven for the ov5693 (2592 K to 6905 K). Each gain is the inverse of the calibrated white point of its light source, so the table and the matrices in the blob cannot disagree. The priors give every calibrated source the same probability, as there are no illuminant statistics for these modules. The blob also carries a colour matrix per light source, and those are left out. Without a chart there is nothing to check them against, and on this machine they push the same neutral surface from R/G 0.981, B/G 1.008 to 0.959 and 1.017 while doubling the saturation of the scene: more colourful, not demonstrably more accurate. They can come back once the gains have been verified against a known illuminant. Tested on a Surface Pro 8 with the software ISP, exposure and gain set by hand so that AGC does not move between runs. Under a 5700 K LED the AWB settles at 5702 K and a white sheet reads R/G 0.981 and B/G 1.008. Signed-off-by: Emfox Zhou --- src/ipa/softisp/data/meson.build | 2 ++ src/ipa/softisp/data/ov13858.yaml | 40 +++++++++++++++++++++++++++++ src/ipa/softisp/data/ov5693.yaml | 42 +++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 src/ipa/softisp/data/ov13858.yaml create mode 100644 src/ipa/softisp/data/ov5693.yaml diff --git a/src/ipa/softisp/data/meson.build b/src/ipa/softisp/data/meson.build index fd9aa0f..c775edd 100644 --- a/src/ipa/softisp/data/meson.build +++ b/src/ipa/softisp/data/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: CC0-1.0 conf_files = files([ + 'ov13858.yaml', + 'ov5693.yaml', 'uncalibrated.yaml', ]) diff --git a/src/ipa/softisp/data/ov13858.yaml b/src/ipa/softisp/data/ov13858.yaml new file mode 100644 index 0000000..bdf9015 --- /dev/null +++ b/src/ipa/softisp/data/ov13858.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: CC0-1.0 +# Calibrated from the AIQB blob shipped with the Windows camera driver of +# the Surface Pro 8 rear camera. The gains are the inverse of the white +# point of each light source, so they match its matrix. +%YAML 1.1 +--- +version: 1 +algorithms: + - BlackLevel: + - Awb: + algorithm: bayes + colourGains: + - ct: 2514 + gains: [ 0.982, 2.138 ] + - ct: 2848 + gains: [ 1.141, 2.093 ] + - ct: 2870 + gains: [ 1.121, 1.991 ] + - ct: 3786 + gains: [ 1.439, 1.698 ] + - ct: 5438 + gains: [ 1.713, 1.405 ] + - ct: 6366 + gains: [ 1.952, 1.300 ] + # Flat priors: there are no illuminant statistics for these + # modules, so every calibrated source is equally likely. + priors: + - lux: 0 + ct: [ 2514, 2848, 2870, 3786, 5438, 6366 ] + probability: [ 0.167, 0.167, 0.167, 0.167, 0.167, 0.167 ] + - lux: 100 + ct: [ 2514, 2848, 2870, 3786, 5438, 6366 ] + probability: [ 0.167, 0.167, 0.167, 0.167, 0.167, 0.167 ] + AwbMode: + Auto: + lo: 2314 + hi: 7266 + - Adjust: + - Agc: +... diff --git a/src/ipa/softisp/data/ov5693.yaml b/src/ipa/softisp/data/ov5693.yaml new file mode 100644 index 0000000..0278254 --- /dev/null +++ b/src/ipa/softisp/data/ov5693.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: CC0-1.0 +# Calibrated from the AIQB blob shipped with the Windows camera driver of +# the Surface Pro 8 front camera. The gains are the inverse of the white +# point of each light source, so they match its matrix. +%YAML 1.1 +--- +version: 1 +algorithms: + - BlackLevel: + - Awb: + algorithm: bayes + colourGains: + - ct: 2592 + gains: [ 0.869, 2.577 ] + - ct: 2773 + gains: [ 1.037, 2.484 ] + - ct: 3716 + gains: [ 1.332, 2.025 ] + - ct: 3763 + gains: [ 1.379, 2.006 ] + - ct: 4877 + gains: [ 1.447, 1.608 ] + - ct: 5894 + gains: [ 1.642, 1.453 ] + - ct: 6905 + gains: [ 1.803, 1.342 ] + # Flat priors: there are no illuminant statistics for these + # modules, so every calibrated source is equally likely. + priors: + - lux: 0 + ct: [ 2592, 2773, 3716, 3763, 4877, 5894, 6905 ] + probability: [ 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143 ] + - lux: 100 + ct: [ 2592, 2773, 3716, 3763, 4877, 5894, 6905 ] + probability: [ 0.143, 0.143, 0.143, 0.143, 0.143, 0.143, 0.143 ] + AwbMode: + Auto: + lo: 2392 + hi: 7805 + - Adjust: + - Agc: +...