Confusion in interpreting Euler angles
Posted: Wed Nov 25, 2015 6:40 pm
Hi,
I am performing fine registration of two meshes and I wish to know the final transformation in terms of the angles the 'DATA' mesh rotates about the X-Y-Z axes to align with the 'MODEL' mesh. I understand that the option to view the transformation matrix in terms of EULER angles allows me to visualize these angles I am talking about. To test this out, I was giving my mesh known rotations of 90 degrees to PHI, THETA and PSI respectively, keeping everything else as zero. I first gave the sample a rotation of PHI=90 degrees, keeping THETA, PSI and the translations as 0. The output of this transformation led to a rotation along Z-axis by 90 degrees, however visually I could also see that the sample had translated to a new position in space although in the output transformation matrix the value of my translations were all 0. Similar observations were seen in cases where I gave the mesh a rotation of THETA=90 and PSI=90, keeping everything else as zero. To further test out the system, I tried performing a fine registration of the rotated mesh with the original mesh (I did this without matching the centres)hoping that the matrix which I would obtain as a result of this registration would be an inverse of the transformation I had given the system while rotating it by 90 degrees. This holds true for rotations of PHI and PSI, however for the case where the rotation was given to THETA, the meshes just don't align (infact they seem to be mirror images of each other).
Later on when I also do a match bounding box centres operation on the two meshes (rotated and intact-I rotate the mesh again by the same amount and then match the centres) to check if what I am observing visually(that the rotated sample has translated) and what I view in the transformation matrix (no translations) are actually same; I see that the rotated sample has actually translated as it had rotated, but these translations were completely missing when I had done the fine registration without aligning the centres. Infact now after matching centres , when I again perform fine registration the samples just don't align.
I can't figure out the reason for such discrepancies. Please enlighten me. I tried looking at your source code for fine registration, but I could not find the piece where you compute the angles from the rotation matrices.
There is also a second part of my question, which is basically a continuation of whatever I have described above. Whenever I give my mesh a rotation of THETA greater than 90 degrees, it basically rotates the sample in such a way that the values of PHI and PSI become 180 degrees and THETA becomes (180-THETA), for eg. a rotation of PHI=0.THETA=135,PSI=0 is basically taken as a PHI=180, THETA=45,PSI=180, similarly PHI=0,THETA=210,PSI=0, is taken as PHI=180,THETA=-30,PSI=180. I suspect this 180 degree rotation of PHI and PSI are responsible for the samples not aligning and being mirror images when I perform the registration.
I was trying to attach some snapshots of what I have described so that it could be easy for you to understand, but I am not able to attach the files.
PLEASE HELP...
I am performing fine registration of two meshes and I wish to know the final transformation in terms of the angles the 'DATA' mesh rotates about the X-Y-Z axes to align with the 'MODEL' mesh. I understand that the option to view the transformation matrix in terms of EULER angles allows me to visualize these angles I am talking about. To test this out, I was giving my mesh known rotations of 90 degrees to PHI, THETA and PSI respectively, keeping everything else as zero. I first gave the sample a rotation of PHI=90 degrees, keeping THETA, PSI and the translations as 0. The output of this transformation led to a rotation along Z-axis by 90 degrees, however visually I could also see that the sample had translated to a new position in space although in the output transformation matrix the value of my translations were all 0. Similar observations were seen in cases where I gave the mesh a rotation of THETA=90 and PSI=90, keeping everything else as zero. To further test out the system, I tried performing a fine registration of the rotated mesh with the original mesh (I did this without matching the centres)hoping that the matrix which I would obtain as a result of this registration would be an inverse of the transformation I had given the system while rotating it by 90 degrees. This holds true for rotations of PHI and PSI, however for the case where the rotation was given to THETA, the meshes just don't align (infact they seem to be mirror images of each other).
Later on when I also do a match bounding box centres operation on the two meshes (rotated and intact-I rotate the mesh again by the same amount and then match the centres) to check if what I am observing visually(that the rotated sample has translated) and what I view in the transformation matrix (no translations) are actually same; I see that the rotated sample has actually translated as it had rotated, but these translations were completely missing when I had done the fine registration without aligning the centres. Infact now after matching centres , when I again perform fine registration the samples just don't align.
I can't figure out the reason for such discrepancies. Please enlighten me. I tried looking at your source code for fine registration, but I could not find the piece where you compute the angles from the rotation matrices.
There is also a second part of my question, which is basically a continuation of whatever I have described above. Whenever I give my mesh a rotation of THETA greater than 90 degrees, it basically rotates the sample in such a way that the values of PHI and PSI become 180 degrees and THETA becomes (180-THETA), for eg. a rotation of PHI=0.THETA=135,PSI=0 is basically taken as a PHI=180, THETA=45,PSI=180, similarly PHI=0,THETA=210,PSI=0, is taken as PHI=180,THETA=-30,PSI=180. I suspect this 180 degree rotation of PHI and PSI are responsible for the samples not aligning and being mirror images when I perform the registration.
I was trying to attach some snapshots of what I have described so that it could be easy for you to understand, but I am not able to attach the files.
PLEASE HELP...