YoungXIAO13 / PoseFromShape

(BMVC 2019) PyTorch implementation of Paper "Pose from Shape: Deep Pose Estimation for Arbitrary 3D Objects"
http://imagine.enpc.fr/~xiaoy/PoseFromShape/
MIT License
170 stars 34 forks source link

rotation_acc method for accuracy calculation #14

Closed ajuric closed 4 years ago

ajuric commented 4 years ago

Hi Yang,

I have a couple of questions regarding the accuracy calculation.

1) I assume that this line converts the angles to [-180, 180]. But you only convert Elevation and In-plane rotation, and not Azimuth angle? Why?

2) These calculations convert from polar coordinates (Azimut, Elevation, In-plane rotation) to the rotation matrix? How did you arrive at these formulas? I tried it myself, didn't succeed. Also, I have tried to search for it on the web, also didn't find anything like that.

ajuric commented 4 years ago

Also, why converting to rotation matrix? Why not just looking at the difference between the angles without converting to rotation matrix?

YoungXIAO13 commented 4 years ago

Hi ajuric,

For the first question, you can refer to #7

And to obtain the calculations, I computed it by myself by using the equation R=RZ(θ)RX(e−π/2)RZ(−a) proposed in StarMap. You can also refer to their implementation, which is much clearer compared to my implementation.

For the last question, the angle distance between rotation matrix is a measure in SO(3), which is not the case if we just consider the difference between the angles.

ajuric commented 4 years ago

Thanks a lot!

ajuric commented 4 years ago

One more question about the angle distance between rotation matrices:

In the blog you mention, it defines the R:

R = P * Q.T

I assumed that this multiplication is the real matrix multiplication, not the element-wise multiplication. But in the code, you do the element-wise multiplication, also without the transpose on the second matrix?

YoungXIAO13 commented 4 years ago

Yes, I did an element-wise sum of the rotation matrix as the angle can be determined by: arccos((Trace(R) - 1) / 2), so I compute directly the trace of *R_pred R_gt.T**.

More details can be found in determine the angle

ajuric commented 4 years ago

I see, cool :+1: