For standard eigenproblem EIG(A), A must be square

4 次查看(过去 30 天)
for the following code I get an error "For standard eigenproblem EIG(A), A must be square", what can be the reason?
Shh = imread('SLC_HH.tif'); Shv = imread('SLC_HV.tif'); Svh = imread('SLC_VH.tif'); Svv = imread('SLC_VV.tif'); S = [Shh,Shv;Svh,Svv];
A= -9999*ones(11660,6033); for i= 1:1000 for j= 1:600
%Coherency matrix T11 = (abs(Shh+Svv)).^2; T12 = (Shh+Svv).* conj(Shh-Svv); T13 = (Shh+Svv).* conj(Shv); T21 = (Shh-Svv).* conj(Shh+Svv); T22 = (abs(Shh-Svv)).^2; T23 = (Shh-Svv).* conj(Shv); T31 = 2*Shv.*conj(Shh+Svv); T32 = 2*Shv.*conj(Shh-Svv); T33 = (abs(Shv)).^2; T = 0.5 * [T11, T12, T13; T21, T22, T23; T31, T32, T33];
%Eigen value decomposition [V,D] = eig(T) ;

回答(3 个)

Youssef  Khmou
Youssef Khmou 2014-9-2
For a non square matrix, you need either to compute the covariance T*T' or you can adjust the dimensions , try the following procedure :
M=size(T);
n=min(M);
TT=T(1:n,1:n);
[V,D]=eig(TT);

Julia
Julia 2014-9-2
Hi,
Are your images greyscale or truecolor images?
From the Matlab help:
A = imread(filename, fmt)
If the file contains a grayscale image, A is an M-by-N array. If the file contains a truecolor image, A is an M-by-N-by-3 array. For TIFF files containing color images that use the CMYK color space, A is an M-by-N-by-4 array.
Perhaps your matrices Shh, Shv, Svh and Sw are not 2-dimensional and this causes the error for T?

Hana
Hana 2014-9-2
what is the solution then?
  1 个评论
Pierre Benoit
Pierre Benoit 2014-9-2
Please comment instead of answering if it's not actually an answer.
It appears that your matrice T is not square, have you checked the dimensions of your images and your variables Tij ?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Computer Vision with Simulink 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by