EigenVectors and EigenValues from Regionprops3

4 Ansichten (letzte 30 Tage)
Ashbub
Ashbub am 2 Mai 2018
Bearbeitet: Saurabh Patel am 21 Sep. 2018
Hi
I am using regionprops3 to get eigenvectors and eigenvalues. Looks like the eigenvalues are sorted always. Am I right? The corresponding eigenvectors are in column or row?
Thanks.
  3 Kommentare
KSSV
KSSV am 20 Sep. 2018
What s the connection between eigenvalues and regionprops?
Saurabh Patel
Saurabh Patel am 21 Sep. 2018
Bearbeitet: Saurabh Patel am 21 Sep. 2018
Let us say, you want the orientation of some object in your image. You could essentially fit a line or plane to the set of points in that object and get the orientation of the line or plane. Matlab does better, RegionProps fits an ellipse or ellipsoid to the segmented object with conservation of second central moment. The major, intermediate, and minor axis radii of this ellipse are stored as eigenvalues. The orientation of these axes are stored in eigenvectors.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 20 Sep. 2018
Bearbeitet: Matt J am 20 Sep. 2018
We can investigate whether the eigenvectors are rows or columns using the single slice ellipse image below. Applying regionprops3 gives,
>> S=regionprops3(A,'Eigenvector','EigenValues'); S{1,1}{:}, S{1,2}{:}
ans =
0.1738 -0.9848 0
0.9848 0.1738 0
0 0 1.0000
ans =
897.8691
156.9113
0.0833
The largest eigenvalue 897.8961 corresponds to the long axis of the ellipse, which is therefore either the first column or row of the above 3x3 eigenvector matrix. However, as we can see from the image, the long axis of the ellipse points in a direction whose coordinates are the same sign (regardless of whether x,y or i,j coordinates are being used). Therefore, its corresponding eigenvector would be the first column, not the first row of the matrix.
Also, the size of the different components tells us that the first coordinate is the vertical axis and the second coordinate is the horizontal axis, indicating that the coordinate system used by regionprops3 is (i,j)-oriented in 2D, not (x,y)-oriented. This is oddly inconsistent with the conventions of all the 2D image processing toolbox functions. On the other hand, this inconsistency is consistent with the inconsistency between meshgrid and ndgrid :-)

Community Treasure Hunt

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

Start Hunting!

Translated by