diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-09-17 18:07:20 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2012-09-17 18:07:20 -0700 |
commit | a9f8d040146533a9c214473fd79cbd9dff44428d (patch) | |
tree | 9c5acf57dc0f278ef24e37659cd56ecd08861af1 /services/camera | |
parent | d14de47262340d70fc11fe56159462b9b981067f (diff) | |
download | frameworks_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.cpp | 8 |
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]); |