Face recognition using android sdk not opencv

后端 未结 2 1178
情书的邮戳
情书的邮戳 2020-12-14 12:37

I am currently work on face recognition in android. I spent reasonable time on internet and I found FaceDetector.Face class in Android. And these are the utilities of this c

2条回答
  •  借酒劲吻你
    2020-12-14 13:11

    The FaceDetector class doesn't do what you think it does. Specifically, it doesn't do Facial Recognition, but instead Facial Detection (hence the class name).

    An example of Facial Detection

    It analyzes an image and returns Faces found in the image. It makes no distinction between Faces (you can't tell if it's John's Face or Sarah's Face) other than the distance between their eyes - but that isn't really a valid comparison point. It just gives you the Faces found and the confidence level that the objects found are actually Faces.

    Ex:

    int maxNumFaces = 2; // Set this to whatever you want
    FaceDetector fd = new FaceDetector(imageWidth,imageHeight,maxNumFaces);
    Faces[] faces = new Faces[maxNumFaces];
    
    try {
      int numFacesFound = fd.findFaces(image, faces);
    
      for (int i = 0; i < maxNumFaces; ++i) {
         Face face = faces[i];
         Log.d("Face " + i + " found with " + face.confidence() + " confidence!");
         Log.d("Face " + i + " eye distance " + face.eyesDistance());
         Log.d("Face " + i + " pose " + face.pose());
         Log.d("Face " + i + " midpoint (between eyes) " + face.getMidPoint());
      }
    } catch (IllegalArgumentException e) {
      // From Docs:
      // if the Bitmap dimensions don't match the dimensions defined at initialization 
      // or the given array is not sized equal to the maxFaces value defined at 
      // initialization
    }
    

提交回复
热议问题