[libcamera-devel,0/3] ColourCorrectionMatrixControl
mbox series

Message ID 20200704095914.17344-1-david.plowman@raspberrypi.com
Headers show
Series
  • ColourCorrectionMatrixControl
Related show

Message

David Plowman July 4, 2020, 9:59 a.m. UTC
Hi everyone

This patch set adds the ColourCorrectionMatrix control, though its use
is for now mainly to get hold of the Colour Correction Matrix (CCM)
used by the imaging pipeline in the libcamera metadata. There are 3
commits:

1. The basic ColourCorrectionMatrix control.

2. The implementation for the Raspberry Pi platform.

3. Use of the new metadata to produce better colours in the DNG files
saved by qcam. Tools like dcraw (with -w) and RawTherapee should
produce reasonable looking images by default.

In the 3rd patch I use a little matrix arithmetic. I thought I might
be able to use Qt for this, but it appears not to have a proper 3x3
matrix class (that finds determinants and inverts them) so I ended up
rolling my own. It's only a very small amount of code but does anyone
have a better suggestion?

Thanks and best regards
David

David Plowman (3):
  libcamera: Add ColourCorrectionMatrix control
  libcamera: raspberrypi: Add ColourCorrectionMatrix control
  libcamera: qcam: Improve colour information in DNG files

 include/libcamera/ipa/raspberrypi.h |  1 +
 src/ipa/raspberrypi/raspberrypi.cpp |  9 +++
 src/libcamera/control_ids.yaml      | 12 ++++
 src/qcam/dng_writer.cpp             | 93 +++++++++++++++++++++++++++++
 4 files changed, 115 insertions(+)

Comments

David Plowman July 19, 2020, 11:33 a.m. UTC | #1
Hi everyone

Perhaps I can gently nudge people to have a look at this patch? It's
particularly helpful to anyone who wants to process the raw files
coming out of qcam.

Thanks
David

On Sat, 4 Jul 2020 at 10:59, David Plowman
<david.plowman@raspberrypi.com> wrote:
>
> Hi everyone
>
> This patch set adds the ColourCorrectionMatrix control, though its use
> is for now mainly to get hold of the Colour Correction Matrix (CCM)
> used by the imaging pipeline in the libcamera metadata. There are 3
> commits:
>
> 1. The basic ColourCorrectionMatrix control.
>
> 2. The implementation for the Raspberry Pi platform.
>
> 3. Use of the new metadata to produce better colours in the DNG files
> saved by qcam. Tools like dcraw (with -w) and RawTherapee should
> produce reasonable looking images by default.
>
> In the 3rd patch I use a little matrix arithmetic. I thought I might
> be able to use Qt for this, but it appears not to have a proper 3x3
> matrix class (that finds determinants and inverts them) so I ended up
> rolling my own. It's only a very small amount of code but does anyone
> have a better suggestion?
>
> Thanks and best regards
> David
>
> David Plowman (3):
>   libcamera: Add ColourCorrectionMatrix control
>   libcamera: raspberrypi: Add ColourCorrectionMatrix control
>   libcamera: qcam: Improve colour information in DNG files
>
>  include/libcamera/ipa/raspberrypi.h |  1 +
>  src/ipa/raspberrypi/raspberrypi.cpp |  9 +++
>  src/libcamera/control_ids.yaml      | 12 ++++
>  src/qcam/dng_writer.cpp             | 93 +++++++++++++++++++++++++++++
>  4 files changed, 115 insertions(+)
>
> --
> 2.20.1
>
Laurent Pinchart July 24, 2020, 12:16 a.m. UTC | #2
Hi David,

Thank you for the patches.

On Sat, Jul 04, 2020 at 10:59:11AM +0100, David Plowman wrote:
> Hi everyone
> 
> This patch set adds the ColourCorrectionMatrix control, though its use
> is for now mainly to get hold of the Colour Correction Matrix (CCM)
> used by the imaging pipeline in the libcamera metadata. There are 3
> commits:
> 
> 1. The basic ColourCorrectionMatrix control.
> 
> 2. The implementation for the Raspberry Pi platform.
> 
> 3. Use of the new metadata to produce better colours in the DNG files
> saved by qcam. Tools like dcraw (with -w) and RawTherapee should
> produce reasonable looking images by default.
> 
> In the 3rd patch I use a little matrix arithmetic. I thought I might
> be able to use Qt for this, but it appears not to have a proper 3x3
> matrix class (that finds determinants and inverts them) so I ended up
> rolling my own. It's only a very small amount of code but does anyone
> have a better suggestion?

I think this is fine for now. Another option would be
boost::numeric::ublas, eigen (http://eigen.tuxfamily.org/) or another
similar linear algebra library, but that's likely overkill for now.

> David Plowman (3):
>   libcamera: Add ColourCorrectionMatrix control
>   libcamera: raspberrypi: Add ColourCorrectionMatrix control
>   libcamera: qcam: Improve colour information in DNG files
> 
>  include/libcamera/ipa/raspberrypi.h |  1 +
>  src/ipa/raspberrypi/raspberrypi.cpp |  9 +++
>  src/libcamera/control_ids.yaml      | 12 ++++
>  src/qcam/dng_writer.cpp             | 93 +++++++++++++++++++++++++++++
>  4 files changed, 115 insertions(+)