Effacer les filtres
Effacer les filtres

Question about regionprops3 'Orientation' angles / origin

5 vues (au cours des 30 derniers jours)
Hello Matlab
Hello Matlab le 20 Juin 2018
Modifié(e) : Hello Matlab le 20 Juil 2018
I want to find out the spatial orientation of an object in a 3D image stack. For this, I am using regionprops3 of the Image Processing Toolbox. However the "order" of x-y-z angles confuses me, as the description sais "The angles are based on the right-hand rule. regionprops3 interprets the angles by looking at the origin along the x-, y-, and z-axis representing roll, pitch, and yaw respectively." Does this mean, the origin is at the lower front right corner of my image stack?
So my question is, can someone please help me translate the x-y-z angles into my image stack coordinate system, where the origin is at the top-left corner, y/rows goes down, x/columns to the right and z/pages "towards you"? As far as I figured, the "x" angle of regionprops seems to refer to what's my "Z"? Thanks a lot.
  1 commentaire
Hello Matlab
Hello Matlab le 6 Juil 2018
Modifié(e) : Hello Matlab le 20 Juil 2018
So for anyone interested, I basically found the mapping of the axes from the regionprops3 output and my image axes.
The first angle from the vector needs to be rotated along the z/pages axis. The second along the y/rows axis and the third angle along the x/rows axis. As in my case I am doing an extrinsic rotation, the order of rotation is z-y-x. For intrinsic rotation the rotation sequence of roll-pitch-yawn is z-y'-x''.
I don't know whether this is applicable for most cases, but it is what worked for me.

Connectez-vous pour commenter.

Réponse acceptée

Matt J
Matt J le 21 Juin 2018
Modifié(e) : Matt J le 21 Juin 2018
It is probably easier to use the EigenValues/EigenVectors property to determine 3D orientation. See this similar thread.
  7 commentaires
Matt J
Matt J le 24 Juin 2018
Modifié(e) : Matt J le 24 Juin 2018
But it seems there is something wrong here as I don't get the angle I am expecting (78°C). What am I doing wrong?
You're not doing anything wrong, except maybe that you should be using acosd() if you want the angle in degrees.
Hello Matlab
Hello Matlab le 26 Juin 2018
Indeed, indeed, I should do that. Thank you, Matt

Connectez-vous pour commenter.

Plus de réponses (1)

KARSH THARYANI
KARSH THARYANI le 21 Juin 2018
Modifié(e) : KARSH THARYANI le 21 Juin 2018
The co-ordinate system based on your description is not right handed. If your x is towards the left and increasing, the y is increasing downwards then, z must be normally-inwards to the page.
Nonetheless, when you created a 3-D array it is assumed that the origin is the top left corner, the x is increasing in the column number, and y is increasing in the row number and z is the inward dimension or the stack number increasing inwards(like I said).
The document says that the roll-pitch-yaw rotations correspond to the rotations along the x-axis, y-axis and z-axis respectively and in that order. For Euler rotations the order of rotations matters because given same rotation magnitudes two different order rotations will result in a different orientation. I hope that cleared your doubt regarding axis conventions.
Also, counter-clockwise rotations are considered to be positive according to the function.
  1 commentaire
Hello Matlab
Hello Matlab le 22 Juin 2018
Modifié(e) : Hello Matlab le 22 Juin 2018
Thanks for your reply!
Yes, my 3D Array is just as you described it in the second paragraph (x increases to the right with column number) and I understand that the order of the axes is important for the rotation. But here is the problem, as the (XYZ)-axes that are returned by the 'Orientation' option don't seem to correlate to the (xyz) axes of my 3D array.
I assume this, as I know the rotation angle of my object along the z-axis/inward dimension. But exactly this angle (78°C) is returned by regionprops3 at the first position of the [xyz] output array of 'Orientation'. So I guess regionprops views as X-axis, what is the Z-axis in my 3D array.
Therefore I am unsure which of the other two angles of the 'Orientation' output corresponds to what axis in my 3D array. Or which finger in the Right-Hand rule is which axis in my 3D array :D
Thanks for helping!

Connectez-vous pour commenter.

Produits


Version

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by