[libcamera-devel] Colour Matrix control proposal
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Fri Jul 3 00:23:45 CEST 2020
Hi Dave,
On Thu, Jul 02, 2020 at 04:19:20PM +0100, David Plowman wrote:
> Hi everyone
>
> One thing we've overlooked is the ability to return the colour matrix
> used by the pipeline. This is particularly important for people
> wanting to process raw files themselves, as we can then arrange for it
> to be written into DNG files. (You might allow the matrix to be
> written as well as returned; I think both are fine.)
>
> I'd therefore like to propose a new control called ColourMatrix:
Bikeshedding on the name, this is usually referred to as CCM, Colour
Correction Matrix. Would ColourCorrectionMatrix make sense a a control
name, or do you think it's unnecessary long ?
> * It would hold an array of 9 floats representing a 3x3 matrix, listed
> in normal "reading order".
>
> * It is the cameraRGB -> sRGB matrix used by the ISP (you can find
> them in Raspberry Pi camera tuning files under "rpi.ccm"). To be extra
> clear, this is the matrix normally applied *after* white balancing,
> and *before* the gamma transform.
By white balancing, I assume you mean the colour gains, as reported by
ColourGains ?
Looking at the IPA implementation, a CCM is picked from the
configuration file based on the colour temperature (with interpolation),
and the saturation is then applied to it. Do you think there would be a
use case for letting the application set the CCM directly ? Or maybe
provide a matrix to replace the Y2RGB * S * RGB2Y term in
apply_saturation(), keeping the base CCM interpolation in the IPA ?
> I'm hoping this is relatively uncontroversial (??) so I'm happy to
> create a patch. If people have other ideas, I'm of course delighted to
> discuss and re-think.
I think it's a good idea.
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list