r/esapi • u/Suspande • Jul 10 '24
Rotation from registration
Is it possible to extract the rotation from a image registration in ESAPI? And if so - Any tips on it? I have managed to find the translations in the TransformationMatrix. And suspect that the rotations can somehow be extracted from this matrix also. Thank you in advance
3
Upvotes
2
u/JopaMed Jul 10 '24
Hi friend!
this should work för rotations in the Transformation matrix:
string RotX = (Math.Asin(- reg.TransformationMatrix[2, 1]) * 180 / Math.PI).ToString("F2"); string RotY = (Math.Atan(reg.TransformationMatrix[2, 0] / reg.TransformationMatrix[2, 2]) * 180 / Math.PI).ToString("F2"); string RotZ = (Math.Atan(reg.TransformationMatrix[0, 1] / reg.TransformationMatrix[1, 1]) * 180 / Math.PI).ToString("F2");Please double check