X = [2 2; 2 3; 3 4; 4 3; 5 4; 5 5]; V = cov(X); [COEFF,latent] = pcacov(V)
P277
I = imread(‘baboon.bmp‘); x = double(I)/255; [m,n]=size(x); y =[]; %拆解图像 for i = 1:m/8; for j = 1:n/8; ii = (i-1)*8+1; jj = (j-1)*8+1; y_app = reshape(x(ii:ii+7,jj:jj+7),1,64); y=[y;y_app]; end end
%KL变换 [COEFF,SCORE,latent] = princomp(y); kl = y * COEFF;