![](/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.