public final class Pose
- Object
- Pose
Portable body-pose result. Landmark coordinates use the normalized
top-left-origin image space defined by VisionPoint; confidence is
in the range 0..1.
Common backend-neutral names include nose, leftEye, rightEye,
leftEar, rightEar, and the left/right forms of Shoulder, Elbow,
Wrist, Hip, Knee, and Ankle. A backend can additionally report
finer eye, mouth, finger, heel, foot, neck, or root landmarks using the
same lower-camel-case convention. PoseLandmarks holds those names
as constants.
PoseDetector detector = new PoseDetector();
detector.process(VisionImage.fromCameraFrame(frame)).ready(pose -> {
Pose.Landmark wrist = pose.getLandmark(PoseLandmarks.RIGHT_WRIST);
Pose.Landmark shoulder = pose.getLandmark(PoseLandmarks.RIGHT_SHOULDER);
boolean raised = wrist != null && shoulder != null
&& wrist.getConfidence() > 0.6f
&& wrist.getPosition().getY() < shoulder.getPosition().getY();
repsLabel.setText(raised ? "up" : "down");
});
Nested types
class Pose.Landmark | One named body joint with normalized position and confidence. |
Constructors
public Pose(Pose.Landmark[] landmarks) | Creates a pose without backend metadata. |
public Pose(Pose.Landmark[] landmarks, VisionMetadata metadata) | Creates a pose with backend diagnostics. |
Methods
public Pose.Landmark getLandmark(String name) | Looks up one named joint. |
public Pose.Landmark[] getLandmarks() | |
public VisionMetadata getMetadata() |
Inherited methods
Constructor details
Pose
public Pose(Pose.Landmark[] landmarks)Creates a pose without backend metadata.
Parameters
landmarksPose.Landmark[]- detected named body landmarks, defensively copied
Pose
public Pose(Pose.Landmark[] landmarks, VisionMetadata metadata)Creates a pose with backend diagnostics.
Parameters
landmarksPose.Landmark[]- detected named body landmarks, defensively copied
metadataVisionMetadata- backend details, or
null
Method details
getLandmark
public Pose.Landmark getLandmark(String name)Looks up one named joint.
Backends detect different subsets of the skeleton, so a null
return means “this backend did not report that joint for this frame”,
not “unsupported”. Check Landmark.getConfidence() before
trusting a position.
Parameters
nameString- one of the
PoseLandmarksconstants
Returns
the detected joint, or
null when it was not reportedgetLandmarks
public Pose.Landmark[] getLandmarks()Returns
defensive copy of detected body landmarks
getMetadata
public VisionMetadata getMetadata()Returns
backend metadata, or
null when manually constructed