Relative marker position
Hello, I am using solvePNP to compute the poses relative to two planar markers.
The markers 0-1 are identical and both visible in the same frame, say more or less like two checkerboards. My final goal is that I want to calculate the marker 1 coordinates relative to marker 0.
I have pose P0=[R0 t0]
, pose P1=[R1 t1]
. Please note that the poses are calculated for the same image, so they are in fact the same pose relative to two different markers.
I have calculated those based on equal 3D point coordinates for both poses, since the markers are identical.
Now I want to get the 3D transformation that brings 3D points of one marker to 3D points on the other marker, so that I know the relative positions of the markers.
I know I can calculate a transform which converts the pose relative to marker 1 to a pose relative to marker 0 as such:
T01 = [R0 t0] [R1-1 -R1-1*t1] = [R0*R1-1 -R0*R1-1*t1+t0]
With this I can transform a generic pose P2 relative to marker 1 and get the pose from marker 0:
P2_0=T01*P2.
How do I use this information to get the trasnform from marker 0 coordinates to marker 1?
Just invert T01^-1 = [R | t] = [R^t [ -R^t*t] or compute T10.
Please note also that you should use rotation transpose instead of rotation inverse.
The inverse of T01 is still a pose transform, not world coordinates transform. I found the correct way: P1 takes points from world coordinates W1 to camera coordinates, then P0-1 takes the camera coordinates to world coordinates W0. so the transform to go from W1 to W0 is Tw=P0-1*P1.
This seems to be different from either T01=P0P1-1 or even T10 = P1P0-1.
I will post the more complete answer when possible (2 days limit).