Skip to content

place the pose skeleton from MediaPipe's metric landmarks - #503

Merged
dli7319 merged 2 commits into
google:mainfrom
salmanmkc:pose-metric-projection
Aug 7, 2026
Merged

place the pose skeleton from MediaPipe's metric landmarks#503
dli7319 merged 2 commits into
google:mainfrom
salmanmkc:pose-metric-projection

Conversation

@salmanmkc

Copy link
Copy Markdown
Contributor

pose landmarks are positioned by raycasting the depth mesh, and when that misses, by back-projecting through the camera. both assume the detected person is part of the scene being sensed. that holds on a headset. it doesn't on desktop with a webcam, where you're sitting outside the simulated room: the rays hit the walls and furniture and smear the skeleton across them, and the back-projection uses device intrinsics that don't match a 16:9 webcam so what survives comes out stretched.

adds world.humans.useDepthProjection (default true, so nothing changes for existing apps or on device). with it off, landmarks come from mediapipe's world landmarks instead, which are metres from the hip centre and independent of both the camera and whether a joint is even in frame, so the body keeps its real proportions.

also puts metricPosition on each landmark. it was already being computed and everything but z thrown away.

Landmarks are placed by raycasting each one onto the depth mesh. That is
right when the people being detected are physically in front of you,
since the ray lands on their actual body.

It is wrong when the camera shows someone who is not part of the depth
scene, which is exactly what a webcam feed on the desktop simulator is:
every ray hits the surrounding room geometry instead, and the skeleton
ends up smeared across the walls and floor.

Turning projection off places landmarks along the view ray at a fixed
distance instead, which keeps the body together. Defaults to on, so
device behaviour is unchanged.
Landmarks were always positioned by raycasting the depth mesh and, when that
missed, by back-projecting through the camera. Neither works when the detected
person is not part of the scene being sensed, as on desktop with a webcam: the
rays hit the surrounding room and smear the body across it, and the
back-projection uses device intrinsics that do not match the webcam's aspect,
stretching the result.

MediaPipe already returns world landmarks in metres relative to the hips. Those
are independent of the camera and of whether a joint is in frame, so when depth
projection is off they are used to place a correctly proportioned skeleton in
front of the viewer. The raw metric position is also exposed on each landmark,
since it was being computed and then discarded.
@dli7319
dli7319 merged commit 2b6ec13 into google:main Aug 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants