繁体   English   中英

如何使用android人脸检测检测左右眼的坐标

[英]How to detect coordinates of left and right eye using android face detection

你好,我是安卓新手。 我想检测左眼和右眼的坐标以及图像中的毛发。 在此链接中,它显示了检测眼睛的方法是什么,但我无法实现这些方法。 我也想检测图像中的毛发,所以我该怎么做。

使用移动视觉 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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM