Android的 - 人脸特征检测 [英] Android - Face feature detection

查看:208
本文介绍了Android的 - 人脸特征检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在为Android手机的应用程序。我们想检测到脸部的特征。该PROGRAMM应该能够检测眼睛的位置,鼻子,嘴和面部的边缘

Currently I'm working on an app for Android phones. We want to detect features of a face. The programm should be able to detect the positions of the eyes, the nose, the mouth and the edge of the face.

精度应该是罚款,但并不需要完善。这没关系宽松一些精度提高速度。所有的脸部正面,我们将之前知道的功能大致位置。我们不需要现场检测。该功能应提取保存的图像。的检测时间应当只是只要它不disturbe用户体验。因此,甚至2或3秒都还可以。

Accuracy should be fine but doesn't need to be perfect. It's okay to loose some accuracy to speed things up. All the faces will be frontal and we will know the approximate positions of the features before. We don't need live detection. The features should be extracted from saved images. The detection time should be only as long as it doesn't disturbe the user experience. So maybe even 2 or 3 seconds are okay.

有了这个假设应该不会太难找到一个库,使我们能够实现这一目标。但我的问题是,什么是最好的办法?你对此有何建议?这是我第一次为Android开发,我不希望在错误的方向上运行。这是个好主意,我们的库或者是更好的(更快/更高精度)来实现我自己的一些现有的算法?

With this assumptions it shouldn't be too hard to find a library which enables us to achieve this. But my question is, what is the best approach? What's your suggestion? It's the first time for me developing for Android and I don't want to run in the wrong direction. Is it a good idea to us a library or is it better (faster/higher accuracy) to implement some existing algorithm on my own?

我GOOGLE了很多,我发现了很多有趣的事情。还有一种人脸检测了Android的API中。但返回的面类(<一href="http://developer.android.com/reference/android/media/FaceDetector.Face.html">http://developer.android.com/reference/android/media/FaceDetector.Face.html)只包含眼睛的位置,这是为了少对我们的一个应用,然后还有OpenCV进行Android或JavaCV。你认为什么是呢?工作为了什么库有好的文档,教程好主意吗?

I googled a lot and I found many interesting things. There is also a face detection in the Android API. But the returned face class (http://developer.android.com/reference/android/media/FaceDetector.Face.html) only contains the position of the eyes. This is to less for our applicaton. Then there is also OpenCV for Android or JavaCV. What do you think is a good idea to work with? For what library there are good documentations, tutorials?

推荐答案

OpenCV的的的教程为此,不幸的是,C ++只有那么你就必须将其转换到Android。

OpenCV has a tutorial for this purpose, unfortunately is C++ only so you would have to convert it to Android.

您也可以尝试FaceDetection API在Android中,这是一个简单的例子如果你正在检测从被拉伸或SD卡的图像。或者更近的 Camera.Face API 它与相机的工作原理图像。

You can also try FaceDetection API in Android, this is a simple example if you are detecting images from a drawable or sdcard images. Or the more recent Camera.Face API which works with the camera image.

如果您从您的相机在动态时要像比第一次读到的如何拍摄照片从相机。的,但我会建议你检查的官方OpenCV的Andr​​oid的样本,并利用它们。

If you want image from your camera at dynamic time than first read How to take picture from camera., but I would recommend you to check the official OpenCV Android samples and use them.

更新:

疯帽子例使用摄像头与SurfaceView的方法。它很有希望快。看一看疯帽子

Mad Hatter Example use the approach of Camera with SurfaceView. Its promisingly fast. Have a look at Mad Hatter.

相关code,万一链路出现故障,是这样的:

The relevant code, in case the link goes down, is this:

public class FaceDetectionListener implements Camera.FaceDetectionListener {
    @Override
    public final void onFaceDetection(Face[] faces, Camera camera) {
        if (faces.length > 0) {
            for (Face face : faces) {
                if (face != null) {
                    // do something
                }
            }
        }
    }
}

这篇关于Android的 - 人脸特征检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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