MATLAB: Line orientation in 3D from centroid and Euler angles

image processingMATLAB

I used the regionprops3 function to detect centroid and Euler angles of cylinders of the same size in 3D space. Now I want to obtain the 3D coordinates of a line (of given length, representing the axis of the cylinders) passing through the centroid and oriented according to the three Euler angles. What kind of coordinate transformation should I consider?

Best Answer

I think you'd be better off using regionprops3 to extract the Eigenvalues and Eigenvectors properties of the cylinders, instead of the Orientation property (which I assume you are using now). The eigenvector corresponding to the largest eigenvalue should give you the direction vector of the long axis of the cylinder directly.
Related Question