人脸检测android在模拟器+网络摄像头预览



我是android模拟器的新手。谁能告诉我如何使用"android.media"?FaceDetector"?我如何结合网络摄像头预览与人脸检测在安卓模拟器?

我不知道你在要求什么;该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);
}

最新更新