I want to find the end point coordinates of the major axis of a 3D object?

5 views (last 30 days)
Naim on 11 Aug 2017
Answered: Binu on 11 Aug 2017
I know how to find the major axis of a 2D object (with region props) but I'm having a hard time extending this to 3D objects. I want the coordinates (i.e x,y,z) of the end points as well. Any ideas how I might be able to achieve this?

Accepted Answer

Binu on 11 Aug 2017
There is no 3D equivalent of regionprops to find major and minor axis. You could find the eigenvalues of your 3D point cloud which gives you the largest magnitudes in each axis(3 values if in 3D). Check documentation for the functions eigs or eig. If you do not know how to create a point cloud from a binary mask, try the boundary function
If you are looking for a quick solution, try fitting an ellipsoid fit(file exchange code) on your 3D point cloud using least squares. The radii this function returns will be your major, middle and minor axis. Ellipsoid fit
You can find the centroid by using a mean of your coordinates.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by