Creative Machine
Creative Machine Logo

Pose Detector

Real-time pose detection on PImage.

alt text

Quick Start

// create a Pose Detector
PoseDetector detector = new PoseDetector(this);

// load image
PImage img = loadImage("pose_soccer.png");

// detect pose
MLPose pose = detector.predict(img);

Usage

Initialize

PoseDetector detector = new PoseDetector(this);

Methods

.predict(PImage image)

Run pose detection on PImage and returns an MLPose object.

// load input image
PImage img = loadImage("pose_soccer.png");

// run pose detection
MLPose pose = detector.predict(img);

// plot each joint (keypoint) of the detected pose
for (int i = 0; i < pose.getKeyPoints().size(); i++) {
    MLKeyPoint keypoint = pose.getKeyPoints().get(i);
    point(keypoint.getX(), keypoint.getY());
}

Parameters

  • PImage image: (required) Image to run pose detection on.

Returns

  • MLPose: MLPose contains an ArrayList of 17 MLKeyPoint. Each keypoint represents the following body parts in order:
1. nose
2. left eye
3. right eye
4. left ear
5. right ear
6. left shoulder
7. right shoulder
8. left elbow
9.  right elbow
10. left wrist
11. right wrist
12. left hip
13. right hip
14. left knee
15. right knee
16. left ankle
17. right ankle

Read more at MLPose for how to retrieve each body part easily.

Examples

PoseDetectorExample

PoseDetectorVideoExample