perfanalytics / pose2sim

Markerless kinematics with any cameras — From 2D Pose estimation to 3D OpenSim motion
https://perfanalytics.github.io/pose2sim/
BSD 3-Clause "New" or "Revised" License
242 stars 46 forks source link

z coordinates of triangulation are negative #99

Closed EmanuelWicki closed 5 months ago

EmanuelWicki commented 5 months ago

Hi David, I have all negative z-coordinates in my triangualted .trc file. The rest appears to be correct. Have you ever experienced something like this?

Best, Emanuel

davidpagnon commented 5 months ago

Hi, I suspect that there is something wrong in your extrinsic calibration. How did you go about it? Did you convert a file, used the scene, or a checkerboard?

davidpagnon commented 5 months ago

You may have switched the X and Y axis, which in a right-handers system would lead to a Z axis pointing downwards

EmanuelWicki commented 5 months ago

I used the checkerboard, wouldt that automatically recognize the coordinate direction ?

davidpagnon commented 5 months ago

You may have a mirrored version of the standard checkerboard I suppose. Where did you print it from? Can you show me a picture?

EmanuelWicki commented 5 months ago

Screenshot 2024-04-19 162352

davidpagnon commented 5 months ago

This may be the issue:

https://github.com/perfanalytics/pose2sim?tab=readme-ov-file#calculate-from-scratch

Make sure that the board:

  • is filmed from different angles, covers a large part of the video frame, and is in focus.
  • is flat, without reflections, surrounded by a white border, and is not rotationally invariant (Nrows ≠ Ncols, and Nrows odd if Ncols even).

A common error is to specify the external, instead of the internal number of corners. This may be one less than you would intuitively think.

Here, both the number of rows and of columns are odd, which makes the board not rotationally invariant.

Did you already move your cameras? If not, you can print another checkerboard, capture it, and then run the analysis again. If you did, you can measure several coordinates of your walking track and calibrate your extrinsics from the scene instead. That's actually what I would recommend, as calibration is better if a larger space area is covered.

EmanuelWicki commented 5 months ago

Thanks a lot. I will do it :)

EmanuelWicki commented 5 months ago

Thank you very much, this issue is resolved