Div*_*dal 2 android face-detection eye-detection
你好我是android的新手.我想检测左眼和右眼的坐标以及图像中的毛发.在这个链接链接中,它显示了检测眼睛的方法是什么,但我无法实现这些方法.此外,我想检测图像中的毛发,所以我该怎么做.
使用移动视觉API,可以将左眼和右眼检测为面部标志.请参阅此处的地标检测教程:
https://developers.google.com/vision/detect-faces-tutorial
和枚举地标类型的API:
https://developers.google.com/android/reference/com/google/android/gms/vision/face/Landmark
只需稍微修改教程中的代码即可专门找到眼睛:
for (int i = 0; i < faces.size(); ++i) {
Face face = faces.valueAt(i);
for (Landmark landmark : face.getLandmarks()) {
switch (landmark.getType()) {
case Landmark.LEFT_EYE:
// use landmark.getPosition() as the left eye position
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4608 次 |
| 最近记录: |