diff options
Diffstat (limited to 'services/camera/libcameraservice/camera2/FrameProcessor.cpp')
-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]); |