EigenVectors and EigenValues from Regionprops3
조회 수: 4 (최근 30일)
이전 댓글 표시
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
Saurabh Patel
2018년 9월 21일
편집: Saurabh Patel
2018년 9월 21일
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.
답변 (1개)
Matt J
2018년 9월 20일
편집: Matt J
2018년 9월 20일
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 :-)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!