[libcamera-devel,0/3] libcamera sharpness strength control
mbox series

Message ID 20200619092725.19109-1-david.plowman@raspberrypi.com
Headers show
Series
  • libcamera sharpness strength control
Related show

Message

David Plowman June 19, 2020, 9:27 a.m. UTC
Hi

Here is a set of patches to implement a sharpness strength control for
libcamera. Unfortunately I couldn't quite bring myself to do it as an
int32_t control because it seems so similar to existing float controls
like contrast, or saturation. But if we'd rather go back to ints, as
previously suggested, just let me know and I'll redo the changes!

There are 3 small patches in this set:

1. The first one just adds the "sharpness" control. This commit is
the only Raspberry Pi indpendent change (and doesn't even involve
any C++ code).

2. The second implements the control's effect in Raspberry Pi's
sharpness control algorithm.

3. The final patch just plumbs the two together.

Thanks and best regards
David

David Plowman (3):
  libcamera: add a sharpness strength control
  libcamera: raspberrypi: add sharpness strength control to Raspberry Pi
    IPAs
  libcamera: raspberrypi: plumb the libcamera sharpness control through
    to the Raspberry Pi implementation

 include/libcamera/ipa/raspberrypi.h           |  1 +
 .../raspberrypi/controller/rpi/sharpen.cpp    | 23 +++++++++++++++----
 .../raspberrypi/controller/rpi/sharpen.hpp    |  6 +++--
 .../controller/sharpen_algorithm.hpp          | 21 +++++++++++++++++
 .../raspberrypi/controller/sharpen_status.h   |  2 ++
 src/ipa/raspberrypi/raspberrypi.cpp           | 12 ++++++++++
 src/libcamera/control_ids.yaml                | 11 +++++++++
 7 files changed, 70 insertions(+), 6 deletions(-)
 create mode 100644 src/ipa/raspberrypi/controller/sharpen_algorithm.hpp

Comments

Laurent Pinchart June 22, 2020, 1:57 a.m. UTC | #1
Hi David,

On Fri, Jun 19, 2020 at 10:27:22AM +0100, David Plowman wrote:
> Hi
> 
> Here is a set of patches to implement a sharpness strength control for
> libcamera. Unfortunately I couldn't quite bring myself to do it as an
> int32_t control because it seems so similar to existing float controls
> like contrast, or saturation. But if we'd rather go back to ints, as
> previously suggested, just let me know and I'll redo the changes!

I was going to ask after reading patch 1/3 :-) I think you're right
here, and if we want to go for int32_t, we should conver contract and
saturation (and brightness). That's a separate discussion.

> There are 3 small patches in this set:
> 
> 1. The first one just adds the "sharpness" control. This commit is
> the only Raspberry Pi indpendent change (and doesn't even involve
> any C++ code).
> 
> 2. The second implements the control's effect in Raspberry Pi's
> sharpness control algorithm.
> 
> 3. The final patch just plumbs the two together.

Bonus points if someone could implement support for this control in the
UVC pipeline handler ;-) As a reference, the two UVC devices I use most
often for development report the V4L2 sharpeness control as

- Integrated webcam

control 0x0098091b `Sharpness' min 1 max 7 step 1 default 2 current 2

- Logitech C905

control 0x0098091b `Sharpness' min 0 max 255 step 1 default 191 current 191

The default value for the second one is quite "interesting".

> David Plowman (3):
>   libcamera: add a sharpness strength control
>   libcamera: raspberrypi: add sharpness strength control to Raspberry Pi
>     IPAs
>   libcamera: raspberrypi: plumb the libcamera sharpness control through
>     to the Raspberry Pi implementation
> 
>  include/libcamera/ipa/raspberrypi.h           |  1 +
>  .../raspberrypi/controller/rpi/sharpen.cpp    | 23 +++++++++++++++----
>  .../raspberrypi/controller/rpi/sharpen.hpp    |  6 +++--
>  .../controller/sharpen_algorithm.hpp          | 21 +++++++++++++++++
>  .../raspberrypi/controller/sharpen_status.h   |  2 ++
>  src/ipa/raspberrypi/raspberrypi.cpp           | 12 ++++++++++
>  src/libcamera/control_ids.yaml                | 11 +++++++++
>  7 files changed, 70 insertions(+), 6 deletions(-)
>  create mode 100644 src/ipa/raspberrypi/controller/sharpen_algorithm.hpp