How does this function "regionprops" to find the orientation of any object?

18 ビュー (過去 30 日間)
marian wagdy
marian wagdy 2013 年 10 月 22 日
コメント済み: Simone conigliaro 2017 年 8 月 31 日
How does this function "regionprops" to find the orientation of any object?
  9 件のコメント
Image Analyst
Image Analyst 2017 年 8 月 29 日
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
Simone conigliaro 2017 年 8 月 31 日
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

サインインしてコメントする。

採用された回答

David Legland
David Legland 2013 年 10 月 22 日
Hi Marian,
the code is in the regionprops function, you can access it via "edit regionprops", and checking the "ComputeEllipseParams" function.
The principle is to compute the inertia ellipse of a shape. It is obtained by computing normalised centered moments. The matrix of Inertia is obtained from the normalised moments of order 2 : Ixx, Ixy, and Iyy. By extracting eigen values and eigen vectors of the inertia matrix, it is possible to obtain the direction of the first eigen vector, that is converted into angle.
  2 件のコメント
Image Analyst
Image Analyst 2013 年 10 月 22 日
Please mark as Accepted if it answers your question.
marian wagdy
marian wagdy 2013 年 10 月 28 日
OK, thanks.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2013 年 10 月 22 日
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.
  2 件のコメント
marian wagdy
marian wagdy 2013 年 10 月 22 日
Yes, I know this, but I want to know the details of this function by using the mathematical equations,and the code
marian wagdy
marian wagdy 2013 年 10 月 22 日
thanks for reply

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by