Daniil-Osokin / lightweight-human-pose-estimation-3d-demo.pytorch

Real-time 3D multi-person pose estimation demo in PyTorch. OpenVINO backend can be used for fast inference on CPU.
Apache License 2.0
653 stars 137 forks source link

3D Coordination #53

Closed Moj-Dev closed 3 years ago

Moj-Dev commented 3 years ago

In my application, the human stands in a fixed position and a camera rotates around the human. When I run the algorithm, there is no translation movements in 3D visualization. it shows only a skeleton rotating. In other words, the algorithm believes that human rotates around himself. How can I fix this issue?

Daniil-Osokin commented 3 years ago

Hi! Network predicts pose in coordinate system relative to the camera. To transform from camera to world coordinate system pass extrinsics.

Moj-Dev commented 3 years ago

I tried both; with and without extrinsic! Also, I commented the "rotate_poses(poses_3d, R, t)" function, but it's still the same. The problem is that the skeleton rotates itself instead of transitional movement.

Daniil-Osokin commented 3 years ago

I just did not get which translation you expect. From the camera view skeleton is really just rotated. Extrinsics just aligns camera coordinate system with the world, so the effect will be the same.

Moj-Dev commented 3 years ago

I want to define the human position coordination as an origin and calculate the position of the moving camera. Here is the video sample shows that a human is fixed in the center and a camera moves around it. How can I calculate the relative position and orientation of the camera with respect to human coordination as an origin?

Daniil-Osokin commented 3 years ago

If you have extrinsics at each camera position (while it is rotating) you can find its translation relative to human in the following way:

  1. Calculate human coordinates in the world space (as it works now).
  2. Calculate human origin from the pose coordinates (e.g. take a neck coordinates or somehow else).
  3. Subtract translation of camera extrinsics from human origin.

It will give you camera coordinates in human-centered coordinate system.

Moj-Dev commented 3 years ago

Is it possible to calculate without camera extrinsic? Does the algorithm calculate the human orientation with respect to the camera?

Daniil-Osokin commented 3 years ago

No, network predicts pose in coordinate system relative to the camera.

Daniil-Osokin commented 3 years ago

Hope, it is clear now.