From 6a87e47a1b93226f778d859a37b0e4655785a4a8 Mon Sep 17 00:00:00 2001 From: Younghwan Joo Date: Thu, 18 Oct 2012 15:21:19 +0900 Subject: [PATCH] hardware: samsung_slsi: libcamera2: clipping fd score to the max score This patch is to clip fd score if the score is over the android max fd score (100). If a fd score exceeds to 100, that value is fixed to 100. BUG : 7368020 Signed-off-by: Younghwan Joo Change-Id: Ieae601cce47d79bcf79bc6e2d80a9ab24a1bb937 --- libcamera2/MetadataConverter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libcamera2/MetadataConverter.cpp b/libcamera2/MetadataConverter.cpp index 11d1b3a..e4092bc 100644 --- a/libcamera2/MetadataConverter.cpp +++ b/libcamera2/MetadataConverter.cpp @@ -588,7 +588,11 @@ status_t MetadataConverter::ToDynamicMetadata(struct camera2_shot_ext * metadata for (int i = 0; i < CAMERA2_MAX_FACES; i++) { if (metadata->dm.stats.faceIds[i] > 0) { mataFaceIds[tempFaceCount] = metadata->dm.stats.faceIds[i]; - metaFaceScores[tempFaceCount] = metadata->dm.stats.faceScores[i]; + // clipping fd score because the max face score of android is 100 + if (metadata->dm.stats.faceScores[i] > 100) + metaFaceScores[tempFaceCount] = 100; + else + metaFaceScores[tempFaceCount] = metadata->dm.stats.faceScores[i]; memcpy(&mataFaceLandmarks[tempFaceCount][0], &metadata->dm.stats.faceLandmarks[i][0], 6*sizeof(uint32_t)); memcpy(&metaFaceRectangles[tempFaceCount][0], &metadata->dm.stats.faceRectangles[i][0], 4*sizeof(uint32_t)); -- 2.20.1