资源简介
空间滤波。阿贝二次成像理论和阿贝-波特实验。阿贝讲显微镜成像过程分为两个过程,平面光照射物体夫琅禾费衍射成像。被透镜手机的衍射次级平面光波在像平面上相干形成物体的像。MATLAB代码
代码片段和文件信息
r=512c=r; %物面采样数
Uo=zeros(cr); %预设物
d=30;a=10; %光栅常数和缝宽
for n=1:d:c %循环生成物(二维光栅)
Uo(n:n+a:)=1;
end
for m=1:d:r
Uo (:m:m+a)=1;
end
Uo=Uo(1:c1:r);
figure
subplot(221)
imshow(Uo[]) %显示物分布
lamda=6328*10^(-10);k=2*pi/lamda; %赋值波长单位:米波矢
f=0.004; Lo=0.001 %赋值透镜的焦距物面的尺寸Lo单位:米
D1=0.00005 %赋值滤波片直径单位:米
D2=0.00005 %赋值滤波片宽度单位:米
%= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%下面计算物光传递到透镜的衍射过程(S-FFT)
xo=linspace(-Lo/2Lo/2r);yo=linspace(-Lo/2Lo/2c); %赋值物面的坐标
[xoyo]=meshgrid(xoyo); %生成物面的坐标网格
do=0.0041; %物面到透镜的距离do单位:米
L=r*lamda*do/Lo %衍射光在透镜前表面上的尺寸L单位:米
xl=linspace(-L/2L/2r);yl=linspace(-L/2L/2c); %赋值透镜前表面的坐标
[xlyl]=meshgrid(xlyl); %生成透镜前表面的坐标网格
F0=exp(j*k*do)/(j*lamda*do)*exp(j*k/2/do*(xl.^2+yl.^2));
F=exp(j*k/2/do*(xo.^2+yo.^2));
FU=(Lo*Lo/r/r).*fftshift(fft2(Uo.*F));
U1=F0.*FU; %透镜前表面上的光场复振幅分布
I1=U1.*conj(U1); %透镜前表面上的光强分布
subplot(222)
imshow(I1[]) colormap(pink)title(‘透镜上的光强分布‘)
%= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%下面计算通过透镜后的光场
U1yp=U1.*exp(-j*k.*(xl.^2+yl.^2)/2/f); %计算通过透镜后的光场
%= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%下面计算通过透镜后的光场到达后焦面的过程(S-FFT)
dlf=f
Lyp=r*lamda*dlf/L %给出后焦面的尺寸单位:米
xf=linspace(-Lyp/2Lyp/2r);yf=linspace(-Lyp/2Lyp/2c); %给出后焦面的坐标
[xfyf]=meshgrid(xfyf); %生成后焦面的坐标网格
F0=exp(j*k*dlf)/(j*lamda*dlf)*exp(j*k/2/dlf*(xf.^2+yf.^2));
F=exp(j*k/2/dlf*(xl.^2+yl.^2));
Uf=(L*L/r/r).*fft2(U1yp.*F);Uf=Uf.*F0; % 计算后焦面上的光场分布
I2=Uf.*conj(Uf); % 后焦面上的光强分布
subplot(223)imshow(I2[0max(I2(:))/100]) colormap(pink)title(‘后焦面上的光强分布‘)
%= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%下面生成三种滤波器
DD=round(D1*r/Lyp); %赋值滤波器直径,单位:像素
SD=round(D2*r/Lyp/2); %赋值滤波器宽带,单位:像素
H1=zeros(cr); %预设滤波器H1
for n=1:c %循环生成滤波器H1
for m=1:r
if (n-c/2-1).^2+(m-r/2-1).^2<=(DD/2).^2;
H1(nm)=1;
end
end
end
figuresubplot(131)imshow(H1[]);title(‘滤波器H1‘)
H2=zeros(cr); %预设滤波器H2
H2(round(c/2)-SD:round(c/2)+SD:)=1; %生成滤波器H2
subplot(132)imshow(H2[]);title(‘滤波器H2‘)
H3=zeros(cr); %预设滤波器H3
H3(:round(r/2)-SD:round(r/2)+SD)=1; %生成滤波器H3
subplot(133)imshow(H3[]);title(‘滤波器H3‘)
%= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%完成三个滤波,得到三个不同的光场
Uf1=H1.*Uf;
Uf2=H2.*Uf;
Uf3=H3.*Uf;
%= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%下面计算通过焦面后的光场到达像面的衍射成像过程(S-FFT)
dfi=do*f/(do-f)-f; %满足物像公式
Li=r*lamda*dfi/Lyp
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 27838 2016-05-06 21:20 Spatial filtering\1.jpg
文件 9489 2016-05-06 21:19 Spatial filtering\2.jpg
文件 27859 2016-05-06 21:19 Spatial filtering\3.jpg
文件 29129 2016-05-06 21:19 Spatial filtering\4.jpg
文件 4586 2016-04-19 16:35 Spatial filtering\CX9_1.m
文件 3187 2016-04-19 21:49 Spatial filtering\CX9_1_1.m
目录 0 2016-05-06 21:24 Spatial filtering
----------- --------- ---------- ----- ----
102088 7
评论
共有 条评论