I know, this should be easy to solve, but I have been struggling with it for a few days and have not been able to find the problem.
I have given two poses of the same object in two different coordinate systems.
In Python:
M_A = np.array(
[[-0.41946089267730713, 0.5219402313232422, 0.7427188158035278, 1396.02392578125], [0.9048191905021667, 0.30634719133377075, 0.29572609066963196, -2081.299072265625], [-0.0731784850358963, 0.7960716485977173, -0.6007621884346008, 666.0630493164062], [0.0, 0.0, 0.0, 1.0]])
M_B = np.array(
[[0.3433801233768463, 0.5848271250724792, 0.7348926663398743, -0.495464563369751], [-0.07314831018447876, 0.7967458367347717, -0.5998711585998535, 0.6749213933944702], [-0.9363435506820679, 0.15222769975662231, 0.3163657486438751, -1.0815355777740479], [0.0, 0.0, 0.0, 1.0]])
I want to transform a new point in coordinate system A into B:
P_A = np.array([3268.470703125, -3019.842529296875, 1869.7952270507812, 1.0])
So I am calculating:
print((M_B @ np.linalg.inv(M_A)) @ P_A)
But what I am getting is:
[6.58380141e+02 1.20581370e+03 1.98623149e+03 1.00000000e+00]
But the correct result should be:
[0.1752457618713379, 0.8773664236068726, 0.9237697124481201, 1.0]
Any ideas what I am doing wrong? Or is it not possible to transform points by only having two poses?
Thank you so much in advance!