使用Android SDK中没有OpenCV的人脸识别 [英] Face recognition using android sdk not opencv

查看:222
本文介绍了使用Android SDK中没有OpenCV的人脸识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的面部识别的机器人。我花了合理的时间在互联网上,我发现FaceDetector.Face类机器人。而这些都是这个类的实用程序:

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 class:

 Constants
 float  CONFIDENCE_THRESHOLD
 int    EULER_X The x-axis Euler angle of a face.
 int    EULER_Y The y-axis Euler angle of a face.
 int    EULER_Z The z-axis Euler angle of a face.

 Public Methods
 float   confidence()
 float   eyesDistance()
 void    getMidPoint(PointF point)
 float   pose(int euler)

现在的问题是,我不知道如何使用这些方法,我无法找到任何教程或示例源$ C ​​$ C这一点。现在的问题是,我应该使用eyesDistance()为differenciating人呢?例如萨拉的eyesDistance是=6.51厘米和约翰是= 6.82。当code计算一个人的眼睛的距离,当它是6.82,是它告诉你,这是约翰这样的方式identifind的人吗?或者什么是算法是什么?或者我应该用欧拉常数?以什么方式?我想我会用这些方法用于人脸识别,但我不知道如何使用它。

The problem is, I do not know how to use these methods and I cannot find any tutorial or example source code for this. The question is, should I use eyesDistance() for differenciating the people? For example Sarah's eyesDistance is= 6.51 cm and John's is= 6.82. When the code calculates a persons eyes distance and when it is 6.82, is it tell you that "it is john" is this the way for identifind the people? Or what is the algorithm for that? Or should I use EULER constants? In what way? I think I am going to use these methods for face recognition, but I do not know how to use it.

或者你可以建议人脸识别另一种解决方案? 任何帮助将是AP preciated。

Or can you suggest another solution for face recognition? Any help would be appreciated.

推荐答案

FaceDetector 类并没有做什么,你认为它。具体而言,它不会做面部识别,而是面部检测(因此类名)。

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).

据分析图像并返回 S中的图像中找到。它使之间的没有区别面 S(你无法知道它是约翰的或莎拉的)比他们的眼睛之间的距离等 - 但是这是不是一个真正的有效的比较点。它只是给你找到了面和信心水平找到的对象实际上是秒。

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.

例如:

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
}

这篇关于使用Android SDK中没有OpenCV的人脸识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆