我想对 256x256 Lena 图像的 8 长度向量实现 8x8 DCT 和 8x8 KLT 矩阵(例如,每行图像有 32 个向量 256/8 = 32,所有行 256x32 = 8192)。我进行特征分析以在 MATLAB 中查找 KLT 矩阵:
co = corr(I); % I is Lena image
co = co(1:8,1:8); % 8x8 autocorrelatin matrix
[V,D] = eig(co); % eigen analysis
eigval = diag(D); % eigen values
[desc, ind] = sort(eigval,'descend'); % sorting eigen values for optimum KLT
eigvec = V(:,ind); %sorted eigenvectors = 8x8 KLT matrix
y = transpose(eigvec*transpose(I(t,m:(m+7)))); % KLT matrix*8-lenght vectors-- t=1:256 and m=1:8:256 iterations of for loop
xtilda = transpose(inv(eigvec)*transpose(y)); % inverse KLT matrix*basis restricted vectors
MSE(k) = MSE(k) + immse(I(t,m:(m+7)),xtilda); % MSE between restricted vector and original vector, k iteration of for loop
MSEfor32vec(g) = mean(MSE); % average error for one row=32 vectors, g iteration of for loop
以同样的方式,我使用dctmtx命令计算了 8x8 DCT 矩阵的MSEfor32vec 。
当我得到结果时,我期待 KLT 的错误更少;但 DCT 的误差较小。在大多数信号处理书籍中,得出的结论是 KLT 必须具有较小的误差。我的错误是什么,或者如果我的解决方案是正确的,我在书中遗漏了什么?我试图以最好的方式解释我的问题,如果不是很清楚,请问我..