我是Android-Emulator的新手。任何人都可以告诉我如何使用“android.media.FaceDetector”?我如何将网络摄像头预览与Android模拟器中的人脸检测结合起来?
答案 0 :(得分:2)
我不确定你要求的是什么; 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);
}