![](/img/trans.png)
[英]How to calculate length between left eye and right eye using google face API face landmarks in 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.