Reputation: 113
I am trying to get the list of points from each eye detection using Firebase ML kit.
I have succeded to get the eye position of each eye (X, Y),
but when I try to call retrieve all points, it returns me an empty array. The code I am using is bellow which I tried different versions for the right and left eye from FirebaseVisionFaceContour.
for (FirebaseVisionFace face : faces)
{
leftEye = face.getLandmark(FirebaseVisionFaceLandmark.LEFT_EYE);
if (leftEye != null) {
leftEyePos = leftEye.getPosition();
Log.d(TAG, "Left eye position: " + leftEyePos);
}
rightEye = face.getLandmark(FirebaseVisionFaceLandmark.RIGHT_EYE);
if (rightEye != null) {
rightEyePos = rightEye.getPosition();
Log.d(TAG, "Right eye position: " + rightEyePos);
}
leftEyeContour = face.getContour(FirebaseVisionFaceContour.LEFT_EYE).getPoints();
Log.d(TAG, "Left eye contour: " + Arrays.toString(leftEyeContour));
rightEyeContour = face.getContour(FirebaseVisionFaceContour.RIGHT_EYE).getPoints();
for (int i=0; i<rightEyeContour.size(); i++){
Log.d(TAG, "Right eye contour: " + rightEyeContour.get(i).getX().toString());
Log.d(TAG, "Right eye contour: " + rightEyeContour.get(i).getY().toString());
}
}
Do you have any idea how to solve it and get all points of eye contour??
Upvotes: 0
Views: 834
Reputation: 935
To get all the face contour points, you have to enable ALL_CONTOURS in the options.
Upvotes: 2