Patch Detail
Show a patch.
GET /api/1.1/patches/21155/?format=api
{ "id": 21155, "url": "https://patchwork.libcamera.org/api/1.1/patches/21155/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21155/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240903104018.3289112-3-chenghaoyang@chromium.org>", "date": "2024-09-03T10:39:18", "name": "[v4,2/3] libcamera: Add face detection controls", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "e2d543b75b6a08a513ce6356213cd557840e03c8", "submitter": { "id": 117, "url": "https://patchwork.libcamera.org/api/1.1/people/117/?format=api", "name": "Cheng-Hao Yang", "email": "chenghaoyang@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/21155/mbox/", "series": [ { "id": 4559, "url": "https://patchwork.libcamera.org/api/1.1/series/4559/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4559", "date": "2024-09-03T10:39:16", "name": "Add Face Detection Controls", "version": 4, "mbox": "https://patchwork.libcamera.org/series/4559/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21155/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21155/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 08C75C3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 3 Sep 2024 10:40:30 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6712F634E5;\n\tTue, 3 Sep 2024 12:40:26 +0200 (CEST)", "from mail-wm1-x335.google.com (mail-wm1-x335.google.com\n\t[IPv6:2a00:1450:4864:20::335])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D049C634E0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 3 Sep 2024 12:40:22 +0200 (CEST)", "by mail-wm1-x335.google.com with SMTP id\n\t5b1f17b1804b1-42bb9d719d4so37899435e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 03 Sep 2024 03:40:22 -0700 (PDT)", "from chenghaoyang-germany.c.googlers.com.com\n\t(161.126.77.34.bc.googleusercontent.com. [34.77.126.161])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-42bb6deb239sm170546025e9.5.2024.09.03.03.40.21\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 03 Sep 2024 03:40:21 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"eixQy3k5\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1725360022; x=1725964822;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=VXPVWY+YWhNXVm5fPP1cJd4RLZs05rleJ7Yzfmsby2o=;\n\tb=eixQy3k5oTqVI8ixXtBznlRWhC4f9R4YItRIeWwU9SLfvqgpupW/bgoAQcXuZeSsAL\n\tPRRoPiK8lVYPFX4LQPbcnVYf5ID+mhDlmA/Awd8sgKQZcP6dnhkxE647QIWt66fRbwVb\n\tPCIldYETBPJRcbI9qmQ6ngQF/+RDGJ6/tynBY=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1725360022; x=1725964822;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=VXPVWY+YWhNXVm5fPP1cJd4RLZs05rleJ7Yzfmsby2o=;\n\tb=m6t+DFHHJfN3HRQZPkHMImDOGaqqoxP79TSNfApYIGCJu6BEkwaAsb+jegPsWE5hVB\n\txdg7wyID6XFyMM51Wtww2d7qTuoIs3GAPB35PhJ7IGxsc7nVt9kJ9JUTPM9fh+RAr88O\n\toxc3xtmWv5B6dZHwUxcwvYyWTOyXNqqdhDToZOTuSmekdSwwSiR//IX4KYHdOlCeCgIK\n\tJ94t2x39Le0RY2oF3xNYkx1TkOclmZowsbmpLqNpZC170E614+rHb6f0YI3GN2RbbBpc\n\t9yFalObk2Bv18Ig/hbvkiFzt/cA0VKgKM0ayxwZtyDcKrTYj/aoKRGDqRC2WllMpLZQH\n\t8NCg==", "X-Gm-Message-State": "AOJu0YwQI6Mu0EHBpZqkMHBfMcvQ1BlKbgq/OJTtGMWyYjZD1iR5EUeM\n\tEFF/u/g8PL/pHI1w4NGhsnA0TXs33HzvB17kDQbCDsvxd3+SbWHlycYZyTgjDrpxgddReqD5SsE\n\tMpA==", "X-Google-Smtp-Source": "AGHT+IGWkPfXyo9pjR2BLyekqjkrP7wATgiwIbou9B5nPY13o3YMA7U4+uZcg/Z2rLmIPEn2eC75uQ==", "X-Received": "by 2002:a05:600c:3b8a:b0:426:58ca:5a3 with SMTP id\n\t5b1f17b1804b1-42c881031e2mr22495785e9.30.1725360022167; \n\tTue, 03 Sep 2024 03:40:22 -0700 (PDT)", "From": "Harvey Yang <chenghaoyang@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Yudhistira Erlandinata <yerlandinata@chromium.org>,\n\tbecker hsieh <beckerh@chromium.org>,\n\tHarvey Yang <chenghaoyang@chromium.org>", "Subject": "[PATCH v4 2/3] libcamera: Add face detection controls", "Date": "Tue, 3 Sep 2024 10:39:18 +0000", "Message-ID": "<20240903104018.3289112-3-chenghaoyang@chromium.org>", "X-Mailer": "git-send-email 2.46.0.469.g59c65b2a67-goog", "In-Reply-To": "<20240903104018.3289112-1-chenghaoyang@chromium.org>", "References": "<20240903104018.3289112-1-chenghaoyang@chromium.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: Yudhistira Erlandinata <yerlandinata@chromium.org>\n\nAdd FaceDetectMode, FaceDetectFaceRectangles, FaceDetectFaceScores,\nand FaceDetectFaceLandmark. Also add ControlTypePoint for supporting\nFaceDetectFaceLandmark.\n\nSigned-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\nCo-developed-by: becker hsieh <beckerh@chromium.org>\nCo-developed-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n include/libcamera/controls.h | 6 ++\n src/libcamera/control_ids_draft.yaml | 85 ++++++++++++++++++++++++++++\n src/libcamera/controls.cpp | 6 ++\n 3 files changed, 97 insertions(+)", "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 7c2bb2872..bf1b8609c 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -34,6 +34,7 @@ enum ControlType {\n \tControlTypeString,\n \tControlTypeRectangle,\n \tControlTypeSize,\n+\tControlTypePoint,\n };\n \n namespace details {\n@@ -87,6 +88,11 @@ struct control_type<Size> {\n \tstatic constexpr ControlType value = ControlTypeSize;\n };\n \n+template<>\n+struct control_type<Point> {\n+\tstatic constexpr ControlType value = ControlTypePoint;\n+};\n+\n template<typename T, std::size_t N>\n struct control_type<Span<T, N>> : public control_type<std::remove_cv_t<T>> {\n };\ndiff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\nindex 9bef5bf15..c0cf53207 100644\n--- a/src/libcamera/control_ids_draft.yaml\n+++ b/src/libcamera/control_ids_draft.yaml\n@@ -227,4 +227,89 @@ controls:\n value. All of the custom test patterns will be static (that is the\n raw image must not vary from frame to frame).\n \n+ - FaceDetectMode:\n+ type: uint8_t\n+ description: |\n+ Reporting mode of face detection.\n+\n+ The number of faces in each list must be the same.\n+\n+ Currently identical to ANDROID_STATISTICS_FACE_DETECT_MODE.\n+\n+ \\sa FaceDetectFaceRectangles\n+ \\sa FaceDetectFaceScores\n+ \\sa FaceDetectFaceLandmarks\n+ \\sa FaceDetectFaceIds\n+\n+ enum:\n+ - name: FaceDetectModeOff\n+ value: 0\n+ description: |\n+ Pipeline should not report face detection result.\n+ - name: FaceDetectModeSimple\n+ value: 1\n+ description: |\n+ Pipeline should at least report FaceDetectFaceRectangles and\n+ FaceDetectFaceScores for each detected faces.\n+ FaceDetectFaceLandmarks and FaceDetectFaceIds is optional.\n+\n+ - name: FaceDetectModeFull\n+ value: 2\n+ description: |\n+ Pipeline should report all face controls, including\n+ FaceDetectFaceRectangles, FaceDetectFaceScores,\n+ FaceDetectFaceLandmarks, and FaceDeteceFaceIds.\n+\n+ - FaceDetectFaceRectangles:\n+ type: Rectangle\n+ description: |\n+ Boundary rectangles of the detected faces.\n+ The number of values should be the number of faces.\n+\n+ The FaceDetectFaceRectangles control can only be returned in metadata.\n+\n+ Currently identical to ANDROID_STATISTICS_FACE_RECTANGLES.\n+\n+ size: [n]\n+\n+ - FaceDetectFaceScores:\n+ type: uint8_t\n+ description: |\n+ Confidence score of each of the detected faces by face detector.\n+ The range of score is [0, 100].\n+ The FaceDetectFaceScores control can only be returned in metadata.\n+ The number of values should be the number of faces.\n+\n+ Currently identical to ANDROID_STATISTICS_FACE_SCORES.\n+\n+ size: [n]\n+\n+ - FaceDetectFaceLandmarks:\n+ type: Point\n+ description: |\n+ Array of human face landmark coordinates in format:\n+ [..., left_eye_i, right_eye_i, mouth_i, left_eye_i+1, ...],\n+ with i = index of face.\n+ The number of values should be 3 * the number of faces.\n+\n+ The FaceDetectFaceLandmarks control can only be returned in metadata.\n+\n+ Currently identical to ANDROID_STATISTICS_FACE_LANDMARKS.\n+\n+ size: [n]\n+\n+ - FaceDetectFaceIds:\n+ type: int32_t\n+ description: |\n+ Each detected face is given a unique ID that is valid for as long as\n+ the face is visible to the camera device. A face that leaves the field\n+ of view and later returns may be assigned a new ID.\n+ The number of values should be the number of faces.\n+\n+ The FaceDetectFaceIds control can only be returned in metadata.\n+\n+ Currently identical to ANDROID_STATISTICS_FACE_IDS.\n+\n+ size: [n]\n+\n ...\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 11d35321c..ce73ae9d7 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -61,6 +61,7 @@ static constexpr size_t ControlValueSize[] = {\n \t[ControlTypeString]\t\t= sizeof(char),\n \t[ControlTypeRectangle]\t\t= sizeof(Rectangle),\n \t[ControlTypeSize]\t\t= sizeof(Size),\n+\t[ControlTypePoint]\t\t= sizeof(Point),\n };\n \n } /* namespace */\n@@ -255,6 +256,11 @@ std::string ControlValue::toString() const\n \t\t\tstr += value->toString();\n \t\t\tbreak;\n \t\t}\n+\t\tcase ControlTypePoint: {\n+\t\t\tconst Point *value = reinterpret_cast<const Point *>(data);\n+\t\t\tstr += value->toString();\n+\t\t\tbreak;\n+\t\t}\n \t\tcase ControlTypeNone:\n \t\tcase ControlTypeString:\n \t\t\tbreak;\n", "prefixes": [ "v4", "2/3" ] }