开发者

Face Detection android in emulator + webcam Preview

I'm new to Android-Emulator..Can anyone tell me how do i use "android.media.FaceDetector" ? And how do i combine a webcam preview together with the Face detection in android emula开发者_StackOverflow社区tor?


I'm not sure what you're asking for; the api is fairly straight forward:

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);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜