开发者

Face Detection android in emulator + webcam Preview

开发者 https://www.devze.com 2023-03-01 17:27 出处:网络
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开发者_StackOverfl

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

精彩评论

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