Why does this shortcut for eigenvectors of 2x2 symmetric work?

In summary, the conversation discusses the computation of the eigenvectors and eigenvalues in a MATLAB code for the Frangi vesselness filter. The question asks about a specific part of the code where v2x is calculated as 2b and then normalized. The reason for this is not explicitly stated, but it is assumed to be a shortcut or factorization. The conversation ends with the person expressing curiosity about this calculation.
  • #1
RickF-
1
0
Hi,

I'k looking at some MATLAB code specifically eig2image.m at:

http://www.mathworks.com/matlabcent...angi-vesselness-filter/content/FrangiFilter2D

So, I understand how the computations are done with respect to the eigenvector / eigenvalues and using (varitions of ) the quadratic equation etc. But my question is about the computation of the eigenvector using the following code (based on the MATLAB code) given matrix [a b; b d];

%% My code, just a scalar version of eig2image.m for understanding eigenvector decomposition

M = [1,2;2,3];

function [ L1,L2,v1x,v1y,v2x,v2y ] = SymmetricEig( M )

% | a b |
% | |
% | b d |

a = M(1,1);
b = M(1,2);
d = M(2,2);

tmp = sqrt((a - d)^2 + 4*b^2);
v2x = 2*b;
v2y = d - a + tmp;

% Normalize
mag = sqrt(v2x^2 + v2y^2);

v2x = v2x/mag; %% Why is v2x now the correct eigenvector value?
v2y = v2y/mag;

% The eigenvectors are orthogonal
v1x = -v2y;
v1y = v2x;

% Compute the eigenvalues
mu1 = 0.5*(a + d + tmp);
mu2 = 0.5*(a + d - tmp);

% Sort eigen values by absolute value abs(Lambda1)<abs(Lambda2)
check=abs(mu1)>abs(mu2);

L1=mu1;
L1(check)=mu2(check);
L2=mu2;
L2(check)=mu1(check);

Ix=v1x;
Ix(check)=v2x(check);
Iy=v1y;
Iy(check)=v2y(check);

end

Notice my comment above - Why is v2x now the correct eigenvector value? It was b multiplied by two and then normalized to the magnitude of v2x,v2y; Why does this work? (and it does). It must be a shortcut, factorization, etc. but I don't see it and haven't seen anyplace else that does this.

I'm just curious.

Thanks

Rick
 
Physics news on Phys.org
  • #2
b is a real number, so v2x is a real number. A real number cannot be an eigenvector (in a 2D vector space).
What do you mean with "eigenvector value"?
 

1. What is the shortcut for finding eigenvectors of a 2x2 symmetric matrix?

The shortcut is to use the formula [1, (λ1-1)/a] for the first eigenvector and [1, (λ2-1)/a] for the second eigenvector, where λ1 and λ2 are the eigenvalues of the matrix and a is the value in the top left corner of the matrix.

2. How does this shortcut work?

This shortcut is based on the fact that the eigenvectors of a 2x2 symmetric matrix are always orthogonal (perpendicular) to each other. By using the formula mentioned above, we can find the eigenvectors that satisfy this condition.

3. Can this shortcut be applied to matrices of other sizes?

No, this shortcut only works for 2x2 symmetric matrices. For matrices of different sizes, different methods or formulas must be used to find the eigenvectors.

4. Are there any limitations to using this shortcut?

Yes, this shortcut only works for symmetric matrices. If the matrix is not symmetric, this shortcut will not give accurate results for the eigenvectors.

5. Can this shortcut be generalized to higher dimensions?

Yes, there is a similar shortcut for finding the eigenvectors of a 3x3 symmetric matrix, but it involves more complex calculations. Beyond 3x3 matrices, this shortcut cannot be generalized and other methods must be used.

Similar threads

  • Linear and Abstract Algebra
Replies
2
Views
2K
  • Linear and Abstract Algebra
Replies
4
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
5K
  • Calculus and Beyond Homework Help
Replies
17
Views
7K
Replies
2
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
2K
Back
Top