tif1=double(imread('C:\image\tm_Kennedy\tm1.tif'));
tif2=double(imread('C:\image\tm_Kennedy\tm2.tif'));
tif3=double(imread('C:\image\tm_Kennedy\tm3.tif'));
[z1,s1]=size(tif1);
[z2,s2]=size(tif2);
[z3,s3]=size(tif3);
if(z1~=z2)|(z2~=z3)|(s1~=s2)|(s2~=s3)
error('input images are not of same size');
end;
s1=[tif1(:) tif2(:) tif3(:)];
s=cov(s1);
[v,d]=eig(s);
w=v(:,1)';
y=w*s1';
y=reshape(y,512,512);
figure,imshow(y)
patterns=imread('c:\image\LENA256.BMP');
patterns=double(patterns);
[r,c]=size(patterns);
dimension=200;
if(r<dimension)
disp('reqired dimension is larger than the data dimension.')
disp('[will use dimension num2str(r)]')
dimension=r;
end
%calculate cov matrix and the PCA matrixes
m=mean(patterns')';
s=((patterns-m*ones(1,c))*(patterns-m*ones(1,c))');
[v,d]=eig(s);
w=v(:,r-dimension+1:r)';
u=s*w'*inv(w*s*w');
%calculate new patterns
uw=u*w;
patternsy=w*patterns;
figure,imshow(patternsy)
patternsx=w'*patternsy;
figure,imshow(patternsx)
PCA.zip_pca_闪电
版权申诉
20 浏览量
2022-09-24
21:22:41
上传
评论
收藏 622B ZIP 举报
寒泊
- 粉丝: 74
- 资源: 1万+
最新资源
- flutter appflutter app
- 扫描全能王 2024-05-10 16.45.pdf
- spire.office.free-5.3.1.jar
- 数字电路:异步触发器计数器分频器 Quartus II 环境Verilog HDL语言编程+仿真+开发板FPGACPLDEDA
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- CSDN_1715329934159.png
- Node安装教程(附安装包)
- 对点云更改重心位置和尺度python代码
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- 实验五朴素贝叶斯西瓜数据集
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈