Home | History | Annotate | Download | only in impl

Lines Matching refs:Face

48 import android.hardware.camera2.params.Face;
591 private boolean setFaces(Face[] faces) {
600 for (Face face : faces) {
601 if (face == null) {
603 Log.w(TAG, "setFaces - null face detected, skipping");
607 if (face.getId() == Face.ID_UNSUPPORTED) {
623 for (Face face : faces) {
624 if (face == null) {
628 faceRectangles[i] = face.getBounds();
629 faceScores[i] = (byte)face.getScore();
632 faceIds[i] = face.getId();
636 faceLandmarks[i * FACE_LANDMARK_SIZE + j++] = face.getLeftEyePosition().x;
637 faceLandmarks[i * FACE_LANDMARK_SIZE + j++] = face.getLeftEyePosition().y;
638 faceLandmarks[i * FACE_LANDMARK_SIZE + j++] = face.getRightEyePosition().x;
639 faceLandmarks[i * FACE_LANDMARK_SIZE + j++] = face.getRightEyePosition().y;
640 faceLandmarks[i * FACE_LANDMARK_SIZE + j++] = face.getMouthPosition().x;
641 faceLandmarks[i * FACE_LANDMARK_SIZE + j++] = face.getMouthPosition().y;
655 private Face[] getFaces() {
667 Log.w(TAG, "Face detect mode metadata is null, assuming the mode is SIMPLE");
671 return new Face[0];
675 Log.w(TAG, "Unknown face detect mode: " + faceDetectMode);
676 return new Face[0];
680 // Face scores and rectangles are required by SIMPLE and FULL mode.
682 Log.w(TAG, "Expect face scores and rectangles to be non-null");
683 return new Face[0];
685 Log.w(TAG, String.format("Face score size(%d) doesn match face rectangle size(%d)!",
689 // To be safe, make number of faces is the minimal of all face info metadata length.
691 // Face id and landmarks are only required by FULL mode.
694 Log.w(TAG, "Expect face ids and landmarks to be non-null for FULL mode," +
700 Log.w(TAG, String.format("Face id size(%d), or face landmark size(%d) don't" +
701 "match face number(%d)!",
704 // To be safe, make number of faces is the minimal of all face info metadata length.
710 ArrayList<Face> faceList = new ArrayList<Face>();
713 if (faceScores[i] <= Face.SCORE_MAX &&
714 faceScores[i] >= Face.SCORE_MIN) {
715 faceList.add(new Face(faceRectangles[i], faceScores[i]));
721 if (faceScores[i] <= Face.SCORE_MAX &&
722 faceScores[i] >= Face.SCORE_MIN &&
730 Face face = new Face(faceRectangles[i], faceScores[i], faceIds[i],
732 faceList.add(face);
736 Face[] faces = new Face[faceList.size()];
741 // Face rectangles are defined as (left, top, right, bottom) instead of
959 metadata.setFaces((Face[])value);
996 * Convert Face Rectangles from managed side to native side as they have different definitions.
998 * Managed side face rectangles are defined as: left, top, width, height.
999 * Native side face rectangles are defined as: left, top, right, bottom.
1000 * The input face rectangle need to be converted to native side definition when set is called.
1003 * @param faceRects Input face rectangles.
1004 * @return true if face rectangles can be set successfully. Otherwise, Let the caller