Patch Detail
Show a patch.
GET /api/1.1/patches/21000/?format=api
{ "id": 21000, "url": "https://patchwork.libcamera.org/api/1.1/patches/21000/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21000/", "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": "<20240823131148.2449434-3-chenghaoyang@google.com>", "date": "2024-08-23T13:07:34", "name": "[v1,2/3] libcamera: Add face detection controls", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f4113f08da69959d3f4057e90520bcf3d5204254", "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/21000/mbox/", "series": [ { "id": 4535, "url": "https://patchwork.libcamera.org/api/1.1/series/4535/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4535", "date": "2024-08-23T13:07:32", "name": "Add Face Detection Controls", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4535/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21000/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21000/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 064BBC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 23 Aug 2024 13:12:00 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BB962633D7;\n\tFri, 23 Aug 2024 15:11:57 +0200 (CEST)", "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D9CB5633CF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Aug 2024 15:11:51 +0200 (CEST)", "by mail-wr1-x433.google.com with SMTP id\n\tffacd0b85a97d-371a13c7c80so1710022f8f.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Aug 2024 06:11:51 -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\tffacd0b85a97d-3730810ffb9sm4185000f8f.7.2024.08.23.06.11.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 23 Aug 2024 06:11:50 -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=\"ktcMMypC\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1724418711; x=1725023511;\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=djAA4idgeV6EJbCGqlIZlZ4tuy/a4YT0To9eKJrnat8=;\n\tb=ktcMMypCX116ulsdkkMUVmW4tTsK3soWh4kOfx9H2mlrrOj8jREtol1GnXFTk9nRk/\n\tIBhvh03T9+lShAIViZtULLeEREwV+FR6PAqNkCCAkWJAQHBwroLBDnbWm1ClD/t3xDvN\n\tI+UFQ+xhfY2l8cwop4/PjezH/HF6mDjYseecQ=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1724418711; x=1725023511;\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=djAA4idgeV6EJbCGqlIZlZ4tuy/a4YT0To9eKJrnat8=;\n\tb=BKushf585WosiIA6UVwI+sBeudZ1aHAqxtL3zdtnOImnsEuMjac90xLcMq+kTsYSP2\n\tRiNmdap0m08nA235jfz1v/eKkfVoZd0ZRehcDv+yyDrLo3x1iDKpdnOs9gXTb+LlJOzo\n\tFP+bkW/+Q9bRXDw72XjY3W7dPsRmUGUBtnsF0Dci3+2bxX44F4bIjGld4zRczcM4z7UX\n\tkfEdow9zgjfxha4ynptwuW0gpxM7vvONL5s9bdYqhdTopgpfBVUscc3PuuN2Hrs4PKp6\n\tKocnsHfu8xZg9Jdje28cylAk0tPsagCXttsuBewdMccOvm4TtlCbAx2Ek1b8/HeaBC7z\n\tlxJg==", "X-Gm-Message-State": "AOJu0YydQkS7t0hE8V2v3p7vZ1YjNnGNiVZUa2gNLdIxbTdt1rdq983r\n\t5QcC9x5oq61mC5GjHxp/15nJWE3uHi3af/IJLrJ8/mOZsndyuqOShNeYdq4bzm0GxXuyokeCv0A\n\tf+Ulh", "X-Google-Smtp-Source": "AGHT+IGpCzMe2L4WCd8wXBQD0tRXHQKzHWaedW9XIFKM8ATP5+DcQE7cB/hFAY0n+hAm6agE7JnoDQ==", "X-Received": "by 2002:adf:ea06:0:b0:367:8fe2:7d8b with SMTP id\n\tffacd0b85a97d-373052f4cf4mr3169466f8f.31.1724418711092; \n\tFri, 23 Aug 2024 06:11:51 -0700 (PDT)", "From": "Harvey Yang <chenghaoyang@chromium.org>", "X-Google-Original-From": "Harvey Yang <chenghaoyang@google.com>", "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 v1 2/3] libcamera: Add face detection controls", "Date": "Fri, 23 Aug 2024 13:07:34 +0000", "Message-ID": "<20240823131148.2449434-3-chenghaoyang@google.com>", "X-Mailer": "git-send-email 2.46.0.295.g3b9ea8a38a-goog", "In-Reply-To": "<20240823131148.2449434-1-chenghaoyang@google.com>", "References": "<20240823131148.2449434-1-chenghaoyang@google.com>", "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\nBUG=b:308713855\nTEST=emerge-geralt libcamera-mtkisp7\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_core.yaml | 42 +++++++++++++++++++++++++++++\n src/libcamera/controls.cpp | 6 +++++\n 3 files changed, 54 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_core.yaml b/src/libcamera/control_ids_core.yaml\nindex 6381970b4..5ff46c71e 100644\n--- a/src/libcamera/control_ids_core.yaml\n+++ b/src/libcamera/control_ids_core.yaml\n@@ -860,6 +860,48 @@ controls:\n No further state changes or lens movements will occur until the\n AfPauseResume control is sent.\n \n+ - FaceDetectMode:\n+ type: uint8_t\n+ description: |\n+ Reporting mode of face detection.\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 faces boundary rectangles and\n+ confidence score for each of them.\n+\n+ - FaceDetectFaceRectangles:\n+ type: Rectangle\n+ description: |\n+ Boundary rectangle of the detected faces.\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], but usually those with low confidence\n+ scores will not be included.\n+ Currently identical to ANDROID_STATISTICS_FACE_SCORES.\n+\n+ size: [n]\n+\n+ - FaceDetectFaceLandmark:\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+\n+ size: [n]\n+\n - HdrMode:\n type: int32_t\n description: |\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": [ "v1", "2/3" ] }