hardware: samsung_slsi: libcamera2: clipping fd score to the max score
authorYounghwan Joo <yhwan.joo@samsung.com>
Thu, 18 Oct 2012 06:21:19 +0000 (15:21 +0900)
committerRebecca Schultz Zavin <rebecca@android.com>
Tue, 23 Oct 2012 22:39:01 +0000 (15:39 -0700)
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 <yhwan.joo@samsung.com>
Change-Id: Ieae601cce47d79bcf79bc6e2d80a9ab24a1bb937

libcamera2/MetadataConverter.cpp

index 11d1b3a9dea05454fb3c6e96c55038bd577e3b43..e4092bc1a99b5bb55b1e4b535da36ef0dc86a3c4 100644 (file)
@@ -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));