Class FaceLandmarks
java.lang.Object
com.codename1.ai.vision.FaceLandmarks
The keys Face.getLandmarks() uses, as constants instead of
literals. Every backend normalizes its own landmark identifiers onto these
names; a landmark the backend could not locate is absent from the map
rather than present with a meaningless position, so read one through
Face.getLandmark(String) and check for null.
detector.process(VisionImage.fromCameraFrame(frame)).ready(faces -> {
for (Face face : faces) {
VisionPoint left = face.getLandmark(FaceLandmarks.LEFT_EYE);
VisionPoint right = face.getLandmark(FaceLandmarks.RIGHT_EYE);
if (left != null && right != null) {
placeGlasses(left.toPoint(preview), right.toPoint(preview));
}
}
});
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCenter of the subject's left eye, which appears on the right of the image.static final StringLeft corner of the mouth.static final StringRight corner of the mouth.static final StringBase of the nose, between the nostrils.static final StringCenter of the subject's right eye, which appears on the left of the image. -
Method Summary
-
Field Details
-
LEFT_EYE
Center of the subject's left eye, which appears on the right of the image.- See Also:
-
RIGHT_EYE
Center of the subject's right eye, which appears on the left of the image.- See Also:
-
NOSE_BASE
-
MOUTH_LEFT
-
MOUTH_RIGHT
-