【问题标题】:Face Detection android in emulator + webcam Preview模拟器+网络摄像头预览中的人脸检测android
【发布时间】:2011-04-29 07:32:45
【问题描述】:

我是 Android-Emulator 的新手。谁能告诉我如何使用“android.media.FaceDetector”?以及如何将网络摄像头预览与 android 模拟器中的人脸检测结合起来?

【问题讨论】:

    标签: android android-emulator android-layout


    【解决方案1】:

    我不确定您要的是什么;该 API 相当简单:

    FaceDector fc = new FaceDetector(<width of your bitmap>, <height of your bitmap>, <max number of faces>);
    Face[] faces = new Face[<max number of faces>];
    int found = fc.findFaces(<your bitmap>, faces);
    PointF point = new PointF();
    for (int i = 0; i < found; ++i) {
      faces[i].getMidPoint(point);
      System.out.println("Point: " + point.x + ", " + point.y);
    }
    

    【讨论】:

    • 我可以在android emulator 2.1中使用这个方法吗?以及如何将此方法与视频流结合使用?因为目前我的程序正在为我的视频输出运行一个线程,因此我很难从我的类方法中调用位图。
    • 你可以运行它,但我认为你不能访问相机(至少不能在我的机器上)。您需要一个静止图像位图来搜索人脸,但您可以从视频流中获取它(参见stackoverflow.com/questions/2326523/… 和developer.android.com/reference/android/graphics/…)。
    猜你喜欢
    • 2021-01-22
    • 2014-05-29
    • 1970-01-01
    • 2017-10-07
    • 1970-01-01
    • 2013-03-20
    • 1970-01-01
    • 1970-01-01
    • 2016-12-11
    相关资源
    最近更新 更多