aboutsummaryrefslogtreecommitdiffci
path: root/patches/0003-ipa-simple-data-add-ov02c10-tuning-file.patch
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'patches/0003-ipa-simple-data-add-ov02c10-tuning-file.patch')
-rw-r--r--patches/0003-ipa-simple-data-add-ov02c10-tuning-file.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/patches/0003-ipa-simple-data-add-ov02c10-tuning-file.patch b/patches/0003-ipa-simple-data-add-ov02c10-tuning-file.patch
new file mode 100644
index 0000000..24f2143
--- /dev/null
+++ b/patches/0003-ipa-simple-data-add-ov02c10-tuning-file.patch
@@ -0,0 +1,78 @@
+ipa: simple: data: Add an OV02C10 tuning file
+
+The simple IPA applies a colour correction matrix only when the tuning file
+asks for it, and there is no tuning file for the OV02C10, so the front camera
+of the Surface Pro 12in falls back to uncalibrated.yaml:
+
+ WARN IPAProxy ipa_proxy.cpp:196 Configuration file 'ov02c10.yaml' not found for IPA module 'simple', falling back to '/usr/share/libcamera/ipa/simple/uncalibrated.yaml'
+
+That leaves the CCM at identity, i.e. the raw sensor channels are displayed as
+if they were sRGB. The grey-world AWB does balance the frame, so the preview is
+not tinted on average -- captured through PipeWire on this board it measures
+R/G 1.03 and B/G 0.98 -- but it is flat: mean HSV saturation 0.07, with 94% of
+the pixels below 0.15. Skin therefore lands close to grey and reads cyan.
+
+Add a tuning file that enables Ccm with a hand-tuned matrix whose blue row sums
+to 0.85, both to restore saturation and to take the cool edge off what the
+grey-world AWB leaves behind. It is not lab-calibrated, and the file says so.
+
+--- /dev/null
++++ b/src/ipa/simple/data/ov02c10.yaml
+@@ -0,0 +1,47 @@
++# SPDX-License-Identifier: CC0-1.0
++#
++# Software ISP tuning for the OV02C10 front camera of the Microsoft Surface
++# Pro 12in.
++#
++# With no tuning file the simple IPA falls back to uncalibrated.yaml, which
++# runs no CCM: the raw sensor channels are handed to the display as though they
++# were already sRGB. The grey-world AWB still balances the frame on average, so
++# the preview is not tinted overall -- measured on this board its mean channel
++# ratios are R/G 1.03 and B/G 0.98 -- it is flat, with a mean HSV saturation of
++# 0.07 and 94% of the pixels below 0.15. What little colour survives reads
++# cool, and that is what makes skin look cyan.
++#
++# The matrix below is hand-tuned, not measured against a colour target. Its
++# off-diagonal terms undo part of the CFA crosstalk and so restore saturation,
++# and its blue row sums to 0.85 rather than 1.0, taking 15% out of blue to
++# counter the cool cast the grey-world AWB leaves behind. It comes from the
++# Samsung Galaxy Book OV02C10 work, which met the same sensor on the same
++# software ISP:
++#
++# https://github.com/hfb0/galaxy-book-ipu6-ov02c10-linux
++#
++# Both entries carry the same matrix, so nothing is interpolated over colour
++# temperature. There is no measured data to justify two different ones.
++#
++# The black level is deliberately not repeated here. The CameraSensorHelper
++# added by 0001-libipa-camera_sensor-add-ov02c10.patch already reports 0x40 at
++# 10 bits, which is what a dark frame off the CAMSS RDI node measures, and one
++# source for it is enough.
++#
++# Enabling Ccm also exposes the Saturation control, and costs nothing
++# noticeable here because the software ISP debayers on the GPU.
++%YAML 1.1
++---
++version: 1
++algorithms:
++ - BlackLevel:
++ - Awb:
++ - Ccm:
++ ccms:
++ - ct: 2860
++ ccm: [ 1.35, -0.20, -0.15, -0.15, 1.30, -0.15, -0.05, -0.20, 1.10 ]
++ - ct: 6500
++ ccm: [ 1.35, -0.20, -0.15, -0.15, 1.30, -0.15, -0.05, -0.20, 1.10 ]
++ - Adjust:
++ - Agc:
++...
+--- a/src/ipa/simple/data/meson.build
++++ b/src/ipa/simple/data/meson.build
+@@ -1,6 +1,7 @@
+ # SPDX-License-Identifier: CC0-1.0
+
+ conf_files = files([
++ 'ov02c10.yaml',
+ 'uncalibrated.yaml',
+ ])
+