MATLAB Answers

Naim
0

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

Asked by Naim
on 11 Aug 2017
Latest activity Answered by 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?

  0 Comments

Sign in to comment.

1 Answer

Answer by Binu
on 11 Aug 2017
 Accepted Answer

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.

  0 Comments

Sign in to comment.