vinits5 / pcrnet_pytorch

This is a pytorch implementation of PCRNet
MIT License
74 stars 13 forks source link

Possible error for quaternion multiplication #7

Open DavidBoja opened 3 years ago

DavidBoja commented 3 years ago

Hi, not an expert but i believe there might be an error in quaternion multipication in transform_functions.py --> qmul(q, r) function.

w = terms[:, 0, 0] - terms[:, 1, 1] - terms[:, 2, 2] - terms[:, 3, 3]
x = terms[:, 0, 1] + terms[:, 1, 0] - terms[:, 2, 3] + terms[:, 3, 2]
y = terms[:, 0, 2] + terms[:, 1, 3] + terms[:, 2, 0] - terms[:, 3, 1]
z = terms[:, 0, 3] - terms[:, 1, 2] + terms[:, 2, 1] + terms[:, 3, 0]

I believe the terms are correct but the signs are not. Apologies if i misunderstood the code somehow.