撰寫者:謝翔宇
----------------------------------------------------------------------------------------------------
pro
test
n=200
xa=100.
ya=100.
sa=15.
ia=250.
xb=80.
yb=80.
sb=15.
ib=150.
i12=fltarr(n,n)
for
i=0,n-1 do begin
for j=0,n-1 do begin
d1=(i-xa)^2+(j-ya)^2
d2=(i-xb)^2+(j-yb)^2
i1=ia*exp(-(d1/sa^2))
i2=ib*exp(-(d2/sb^2))
i12(i,j)=i1+i2
endfor
endfor
surface,i12
write_bmp,'d:\write_bmp\ixy.bmp',i12
ixy=read_bmp('d:\write_bmp\ixy.bmp')
i12_fft=abs(1+shift(fft(ixy),100,100))*10000
write_bmp,'d:\write_bmp\ifft.bmp',i12_fft
end
全站熱搜
留言列表