clc
clear
Rmuban=imread('Rmuban.jpg');
Rmuban=rgb2gray(imcrop(Rmuban,[4,2,63,63]));
%Rmuban=im2double(Rmuban);
%figure;imshow(Rmuban);title('R1');
for i=1:5
b(i)={[imresize(Rmuban,1+0.2*(i-1))]};
end
for i=1:5
m=size(b{i},1);
c=b{i};
for j=1:64
for k=1:64
d(j,k)=c(j+round((m-64)/2),k+round((m-64)/2));
end
end
e(i)={d};
end
for i=1:5
%figure;imshow(e{i});
end
%产生系列放大图像完毕,即e{i}
for i=1:5
for j=1:5
R(i,j)=corr2(e{i},e{j});
end
end
%相关矩阵R求得
a=ones(5,1);
c=R*a;
while (max(c)-min(c))/max(c)>0.02
c=R*a;
for j=1:5
a(j)=a(j)+0.2*(max(c)-c(j));
end
end
b=sum(a);
for i=1:5
a(i)=a(i)/b;
end
a
%权因子a求得
%产生综合参考模板
f=0;
for i=1:5
f=f+a(i)*e{i};
end
%figure;imshow(f);title('综合参考图像');
muban=uint8(zeros(256,256));
for i=97:160
for j=65:128
muban(i,j)=f(i-96,j-64);
end
end
%figure;imshow(muban);title('综合参考模板');
%产生不同比例目标图像
for i=1:5
ee{i}=uint8(zeros(256,256));
for m=97:160
for n=129:192
ee{i}(m,n)=e{i}(m-96,n-128);
end
end
%figure;imshow(uint8(ee{i}*255));title('不同比例目标图像');
end
%产生不同比例的综合图像
for i=1:5
zonghe{i}=muban+ee{i};
figure;imshow(zonghe{i});title('不同比例综合图像');
end
%开始用不同比例R与综合参考图像比较
for i=1:5
Forizonghe=fft2(double(zonghe{i}),256,256);
Foricenterzonghe=fftshift(Forizonghe);
Forizongheabs=abs(Foricenterzonghe);
Forizongheabs=double(Forizongheabs);
%Forizonghe2=Forizongheabs.*Forizongheabs;
%figure;imagesc(Forizonghe2);axis tight;
%figure;mesh(double(Forizonghe2));axis tight;title('综合功率谱');
Iforizero=ifft2(Forizongheabs);
Iforizerocenter=fftshift(Iforizero);
Iforizerocenterim=uint8((abs(Iforizerocenter)/max(max(abs(Iforizerocenter))))*255);
%figure;imshow(Iforizerocenterim);title('去零级相关输出');
figure; mesh(abs(Iforizerocenter));axis tight;title('去零级相关输出的三维显示');
max(max(abs(Iforizerocenter(:,1:100))))
end
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
47268450Joint_transform_correlation_method_of_optical_simulation.rar (2个子文件)
Rmuban.JPG 1KB
jingdianxishutry4.m 2KB
共 2 条
- 1
资源评论
- wukedi04102013-09-05这根本不是联合变换
- 廖沙2013-05-15只有一副图像,不是联合变换
mouse_1130
- 粉丝: 2
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功