How does this function "regionprops" to find the orientation of any object?
Show older comments
How does this function "regionprops" to find the orientation of any object?
9 Comments
Simone conigliaro
on 28 Aug 2017
hi, I would like to ask to you what function is possible to use to find orientation in 3D. i used "regionprops "to obtain orientation in 2D. what function do you suggest? please answer it.
Image Analyst
on 28 Aug 2017
regionprops() is the function I would suggest also.
Simone conigliaro
on 29 Aug 2017
thanks for your answer but regionprops(orientation) is no possibile to use for orientation of blobs 3D. it is excellent for 2/d. another advice? thanks
Simone conigliaro
on 29 Aug 2017
'Orientation' — Scalar; the angle (in degrees ranging from -90 to 90 degrees) between the x-axis and the major axis of the ellipse that has the same second-moments as the region. This property is supported only for 2-D input label matrices.
Simone conigliaro
on 29 Aug 2017
do you know another property that is supported for 3D input label matrix? many thanks
Image Analyst
on 29 Aug 2017
Use principal components analysis, pca().
Simone conigliaro
on 29 Aug 2017
thanks. could you write how i calculate it? if is possible the matlab code because i have no idea how to calculate.
many thanks
Image Analyst
on 29 Aug 2017
You'd use [y, x, z] = find(binaryImage) and then pass them into pca(). I don't have a demo for exactly that, but I'm attaching a demo of using pca to determine axes for a color gamut, for whatever that's worth.
Simone conigliaro
on 31 Aug 2017
thanks for your replay. i have another question to ask you. i would like to know what is the method that regionprops label the object? because i used this function to get centroid and volume(sum voxel for each blob)but i don't understand this aspect. thank you very much
Accepted Answer
More Answers (1)
Image Analyst
on 22 Oct 2013
1 vote
It fits the blob to an ellipse and then gets the angle of the major axis of the ellipse from the horizontal. Note: the major axis of the fitted ellipse is not the farthest distance between two points in the blob.
Categories
Find more on ROI-Based Processing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!