summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-09-17 18:07:20 -0700
committerEino-Ville Talvala <etalvala@google.com>2012-09-17 18:07:20 -0700
commita9f8d040146533a9c214473fd79cbd9dff44428d (patch)
tree9c5acf57dc0f278ef24e37659cd56ecd08861af1 /services/camera
parentd14de47262340d70fc11fe56159462b9b981067f (diff)
downloadframeworks_av-a9f8d040146533a9c214473fd79cbd9dff44428d.zip
frameworks_av-a9f8d040146533a9c214473fd79cbd9dff44428d.tar.gz
frameworks_av-a9f8d040146533a9c214473fd79cbd9dff44428d.tar.bz2
Camera2: Filter out faces with 0 confidence.
Bug: 7078231 Change-Id: I559f1281359835e0489456091a5409ebc8f73479
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/camera2/FrameProcessor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/camera2/FrameProcessor.cpp b/services/camera/libcameraservice/camera2/FrameProcessor.cpp
index e24db0b..df5e11f 100644
--- a/services/camera/libcameraservice/camera2/FrameProcessor.cpp
+++ b/services/camera/libcameraservice/camera2/FrameProcessor.cpp
@@ -220,7 +220,13 @@ status_t FrameProcessor::processFaceDetect(const CameraMetadata &frame,
faces.setCapacity(metadata.number_of_faces);
- for (int i = 0; i < metadata.number_of_faces; i++) {
+ size_t maxFaces = metadata.number_of_faces;
+ for (size_t i = 0; i < maxFaces; i++) {
+ if (faceScores[i] == 0) {
+ metadata.number_of_faces--;
+ continue;
+ }
+
camera_face_t face;
face.rect[0] = l.mParameters.arrayXToNormalized(faceRects[i*4 + 0]);