[libcamera-devel,v2,1/3] libcamera: controls: Add focus Figure of Merit (FoM) control

Message ID 20200706085625.1625432-2-naush@raspberrypi.com
State Accepted
Commit c905870cd0f1d6c1af048669ea744bc1de8062de
Headers show
Series
  • Focus feedback control
Related show

Commit Message

Naushir Patuck July 6, 2020, 8:56 a.m. UTC
Provide a control to allow the IPA to return a FoM to indicate how
in-focus a scene is. Note, this is not to be used as a means to
implement a focus algorithm by the application, rather an indication of
how in-focus a scene is.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/control_ids.yaml | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Laurent Pinchart July 6, 2020, 2:16 p.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Mon, Jul 06, 2020 at 09:56:23AM +0100, Naushir Patuck wrote:
> Provide a control to allow the IPA to return a FoM to indicate how
> in-focus a scene is. Note, this is not to be used as a means to
> implement a focus algorithm by the application, rather an indication of
> how in-focus a scene is.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Will push to master after running tests.

> ---
>  src/libcamera/control_ids.yaml | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> index 8c3e4c72..988b5016 100644
> --- a/src/libcamera/control_ids.yaml
> +++ b/src/libcamera/control_ids.yaml
> @@ -251,4 +251,15 @@ controls:
>          higher than anyone could reasonably want. Negative values are
>          not allowed. Note also that sharpening is not applied to raw
>          streams.
> +
> +  - FocusFoM:
> +      type: int32_t
> +      description: |
> +        Reports a Figure of Merit (FoM) to indicate how in-focus the frame is.
> +        A larger FocusFoM value indicates a more in-focus frame. This control
> +        depends on the IPA to gather ISP statistics from the defined focus
> +        region, and combine them in a suitable way to generate a FocusFoM value.
> +        In this respect, it is not necessarily aimed at providing a way to
> +        implement a focus algorithm by the application, rather an indication of
> +        how in-focus a frame is.
>  ...

Patch

diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
index 8c3e4c72..988b5016 100644
--- a/src/libcamera/control_ids.yaml
+++ b/src/libcamera/control_ids.yaml
@@ -251,4 +251,15 @@  controls:
         higher than anyone could reasonably want. Negative values are
         not allowed. Note also that sharpening is not applied to raw
         streams.
+
+  - FocusFoM:
+      type: int32_t
+      description: |
+        Reports a Figure of Merit (FoM) to indicate how in-focus the frame is.
+        A larger FocusFoM value indicates a more in-focus frame. This control
+        depends on the IPA to gather ISP statistics from the defined focus
+        region, and combine them in a suitable way to generate a FocusFoM value.
+        In this respect, it is not necessarily aimed at providing a way to
+        implement a focus algorithm by the application, rather an indication of
+        how in-focus a frame is.
 ...