Sub topic 16
Extension: lifting 2D poses to 3D
Assume you know Python, NumPy, convolutional neural networks, image coordinates, and basic supervised learning. This chapter extends a 2D pose, where each joint has (x, y), into a 3D pose with (X, Y, Z).
What 2D-to-3D lifting means
A 2D keypoint detector discards depth. A lifting model takes the detected 2D joints, and sometimes the image or a sequence of frames, and predicts their 3D positions.
The most common output is root-relative 3D pose. One joint, usually the pelvis, becomes the origin. The other joints describe their 3D offset from that root. This removes the person's global location in the scene.
A camera projection explains why lifting is difficult:
u = fx * X / Z + cxv = fy * Y / Z + cy
Here, (u, v) is the image location, (X, Y, Z) is the camera-space position, (fx, fy) are focal lengths, and (cx, cy) is the principal point. Many different 3D poses can produce the same (u, v). This is called depth ambiguity.
Lifting approaches and trade-offs
| Approach | Input | Strength | Limitation |
|---|---|---|---|
| Image-to-3D | Image and 2D pose | Uses appearance and occlusion clues | More computation and camera dependence |
| Pose-to-3D | 2D keypoints | Fast and compact | Cannot recover information absent from the keypoints |
| Temporal lifting | A sequence of 2D poses | Uses motion and reduces jitter | Adds latency and fails on unusual motion |
| Multi-view triangulation | Matching 2D poses from cameras | Geometrically accurate with calibration | Requires synchronized, calibrated cameras |
A pose-to-3D model may use a multilayer perceptron, temporal convolution, transformer, or graph neural network. A graph model represents joints as nodes and bones as edges. The model learns relationships such as the typical length between a shoulder and an elbow.
Back-projecting predicted depths
A lifter may predict one depth value per joint. With camera calibration, you can convert each 2D point and depth into camera-space coordinates:
import numpy as np
def back_project(points_2d, depths, fx, fy, cx, cy):
"""Return camera-space points with shape (K, 3)."""
points_2d = np.asarray(points_2d, dtype=np.float32)
depths = np.asarray(depths, dtype=np.float32)
u, v = points_2d[:, 0], points_2d[:, 1]
x = (u - cx) * depths / fx
y = (v - cy) * depths / fy
return np.stack([x, y, depths], axis=1)
points = np.array([[320, 240], [350, 280]])
depths = np.array([2.0, 2.1])
xyz = back_project(points, depths, 800, 800, 320, 240)
print(xyz)To obtain a root-relative pose, subtract the pelvis coordinate from every joint. This representation is useful for action recognition and motion analysis, but it does not reveal where the person stands in the room.
Failure modes and evaluation
Lifting becomes unreliable when 2D detections contain left-right swaps, missing joints, or incorrect occlusion estimates. A model trained on walking poses may also fail on sitting, crouching, or unusual camera angles.
Common evaluation measures include mean per-joint position error, or MPJPE, in millimetres. Procrustes-aligned MPJPE additionally removes translation, rotation, and scale, so it measures pose shape rather than absolute placement. Always report which alignment you used.
Exercise
Why can two different 3D poses produce the same 2D keypoints?
Show answer
Projection removes depth information, so different values of X, Y, and Z can map to the same image coordinates.