[v9,4/5] libcamera: control_ids_draft: Add face detection controls
diff mbox series

Message ID 20240930195915.152187-5-jacopo.mondi@ideasonboard.com
State Accepted
Headers show
Series
  • Add Face Detection Controls
Related show

Commit Message

Jacopo Mondi Sept. 30, 2024, 7:59 p.m. UTC
From: Yudhistira Erlandinata <yerlandinata@chromium.org>

Add FaceDetectMode, FaceDetectFaceRectangles, FaceDetectFaceScores,
and FaceDetectFaceLandmark. Also add ControlTypePoint for supporting
FaceDetectFaceLandmark.

Signed-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org>
Co-developed-by: Becker Hsieh <beckerh@chromium.org>
Co-developed-by: Harvey Yang <chenghaoyang@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/libcamera/control_ids_draft.yaml | 82 ++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

Comments

Harvey Yang Oct. 1, 2024, 7:10 a.m. UTC | #1
Thanks Jacopo,

LGTM.
Reviewed-by: Harvey Yang <chenghaoyang@chromium.org>

BR,
Harvey

On Tue, Oct 1, 2024 at 3:59 AM Jacopo Mondi
<jacopo.mondi@ideasonboard.com> wrote:
>
> From: Yudhistira Erlandinata <yerlandinata@chromium.org>
>
> Add FaceDetectMode, FaceDetectFaceRectangles, FaceDetectFaceScores,
> and FaceDetectFaceLandmark. Also add ControlTypePoint for supporting
> FaceDetectFaceLandmark.
>
> Signed-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org>
> Co-developed-by: Becker Hsieh <beckerh@chromium.org>
> Co-developed-by: Harvey Yang <chenghaoyang@chromium.org>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>  src/libcamera/control_ids_draft.yaml | 82 ++++++++++++++++++++++++++++
>  1 file changed, 82 insertions(+)
>
> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml
> index 9bef5bf15238..1b284257f601 100644
> --- a/src/libcamera/control_ids_draft.yaml
> +++ b/src/libcamera/control_ids_draft.yaml
> @@ -227,4 +227,86 @@ controls:
>              value. All of the custom test patterns will be static (that is the
>              raw image must not vary from frame to frame).
>
> +  - FaceDetectMode:
> +      type: int32_t
> +      description: |
> +        Control to select the face detection mode used by the pipeline.
> +
> +        Currently identical to ANDROID_STATISTICS_FACE_DETECT_MODE.
> +
> +        \sa FaceDetectFaceRectangles
> +        \sa FaceDetectFaceScores
> +        \sa FaceDetectFaceLandmarks
> +        \sa FaceDetectFaceIds
> +
> +      enum:
> +        - name: FaceDetectModeOff
> +          value: 0
> +          description: |
> +            Pipeline doesn't perform face detection and doesn't report any
> +            control related to face detection.
> +        - name: FaceDetectModeSimple
> +          value: 1
> +          description: |
> +            Pipeline performs face detection and reports the
> +            FaceDetectFaceRectangles and FaceDetectFaceScores controls for each
> +            detected face. FaceDetectFaceLandmarks and FaceDetectFaceIds are
> +            optional.
> +        - name: FaceDetectModeFull
> +          value: 2
> +          description: |
> +            Pipeline performs face detection and reports all the controls
> +            related to face detection including FaceDetectFaceRectangles,
> +            FaceDetectFaceScores, FaceDetectFaceLandmarks, and
> +            FaceDeteceFaceIds for each detected face.
> +
> +  - FaceDetectFaceRectangles:
> +      type: Rectangle
> +      description: |
> +        Boundary rectangles of the detected faces. The number of values is
> +        the number of detected faces.
> +
> +        The FaceDetectFaceRectangles control can only be returned in metadata.
> +
> +        Currently identical to ANDROID_STATISTICS_FACE_RECTANGLES.
> +      size: [n]
> +
> +  - FaceDetectFaceScores:
> +      type: uint8_t
> +      description: |
> +        Confidence score of each of the detected faces. The range of score is
> +        [0, 100]. The number of values should be the number of faces reported
> +        in FaceDetectFaceRectangles.
> +
> +        The FaceDetectFaceScores control can only be returned in metadata.
> +
> +        Currently identical to ANDROID_STATISTICS_FACE_SCORES.
> +      size: [n]
> +
> +  - FaceDetectFaceLandmarks:
> +      type: Point
> +      description: |
> +        Array of human face landmark coordinates in format [..., left_eye_i,
> +        right_eye_i, mouth_i, left_eye_i+1, ...], with i = index of face. The
> +        number of values should be 3 * the number of faces reported in
> +        FaceDetectFaceRectangles.
> +
> +        The FaceDetectFaceLandmarks control can only be returned in metadata.
> +
> +        Currently identical to ANDROID_STATISTICS_FACE_LANDMARKS.
> +      size: [n]
> +
> +  - FaceDetectFaceIds:
> +      type: int32_t
> +      description: |
> +        Each detected face is given a unique ID that is valid for as long as the
> +        face is visible to the camera device. A face that leaves the field of
> +        view and later returns may be assigned a new ID. The number of values
> +        should be the number of faces reported in FaceDetectFaceRectangles.
> +
> +        The FaceDetectFaceIds control can only be returned in metadata.
> +
> +        Currently identical to ANDROID_STATISTICS_FACE_IDS.
> +      size: [n]
> +
>  ...
> --
> 2.46.1
>

Patch
diff mbox series

diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml
index 9bef5bf15238..1b284257f601 100644
--- a/src/libcamera/control_ids_draft.yaml
+++ b/src/libcamera/control_ids_draft.yaml
@@ -227,4 +227,86 @@  controls:
             value. All of the custom test patterns will be static (that is the
             raw image must not vary from frame to frame).
 
+  - FaceDetectMode:
+      type: int32_t
+      description: |
+        Control to select the face detection mode used by the pipeline.
+
+        Currently identical to ANDROID_STATISTICS_FACE_DETECT_MODE.
+
+        \sa FaceDetectFaceRectangles
+        \sa FaceDetectFaceScores
+        \sa FaceDetectFaceLandmarks
+        \sa FaceDetectFaceIds
+
+      enum:
+        - name: FaceDetectModeOff
+          value: 0
+          description: |
+            Pipeline doesn't perform face detection and doesn't report any
+            control related to face detection.
+        - name: FaceDetectModeSimple
+          value: 1
+          description: |
+            Pipeline performs face detection and reports the
+            FaceDetectFaceRectangles and FaceDetectFaceScores controls for each
+            detected face. FaceDetectFaceLandmarks and FaceDetectFaceIds are
+            optional.
+        - name: FaceDetectModeFull
+          value: 2
+          description: |
+            Pipeline performs face detection and reports all the controls
+            related to face detection including FaceDetectFaceRectangles,
+            FaceDetectFaceScores, FaceDetectFaceLandmarks, and
+            FaceDeteceFaceIds for each detected face.
+
+  - FaceDetectFaceRectangles:
+      type: Rectangle
+      description: |
+        Boundary rectangles of the detected faces. The number of values is
+        the number of detected faces.
+
+        The FaceDetectFaceRectangles control can only be returned in metadata.
+
+        Currently identical to ANDROID_STATISTICS_FACE_RECTANGLES.
+      size: [n]
+
+  - FaceDetectFaceScores:
+      type: uint8_t
+      description: |
+        Confidence score of each of the detected faces. The range of score is
+        [0, 100]. The number of values should be the number of faces reported
+        in FaceDetectFaceRectangles.
+
+        The FaceDetectFaceScores control can only be returned in metadata.
+
+        Currently identical to ANDROID_STATISTICS_FACE_SCORES.
+      size: [n]
+
+  - FaceDetectFaceLandmarks:
+      type: Point
+      description: |
+        Array of human face landmark coordinates in format [..., left_eye_i,
+        right_eye_i, mouth_i, left_eye_i+1, ...], with i = index of face. The
+        number of values should be 3 * the number of faces reported in
+        FaceDetectFaceRectangles.
+
+        The FaceDetectFaceLandmarks control can only be returned in metadata.
+
+        Currently identical to ANDROID_STATISTICS_FACE_LANDMARKS.
+      size: [n]
+
+  - FaceDetectFaceIds:
+      type: int32_t
+      description: |
+        Each detected face is given a unique ID that is valid for as long as the
+        face is visible to the camera device. A face that leaves the field of
+        view and later returns may be assigned a new ID. The number of values
+        should be the number of faces reported in FaceDetectFaceRectangles.
+
+        The FaceDetectFaceIds control can only be returned in metadata.
+
+        Currently identical to ANDROID_STATISTICS_FACE_IDS.
+      size: [n]
+
 ...