1、 i=zeros(256,256); i(124:132,120:136)=1; subplot(1,3,1);imshow(i); i=im2double(i); f1=fft2(i); subplot(1,3,2);imshow(log(1+abs(f1),); fc1=fftshift(f1); subplot(1,3,3);imshow(fc1); Displaying real part of complex input In imshowValidateCdata at 497ParseInputs at 378 In imshow at 85 i1=imread(rice.png
2、 i1=im2double(i1); f1=fft2(i1); subplot(1,2,1);imshow(i1); subplot(1,2,2);imshow(log(1+abs(fc1);求线性滤波器的频率响应: h=fspecial(gaussian freqz2(h); f=zeros(1000,1000); f(350:649,475:524)=1; subplot(2,2,1);imshow(f, subplot(2,2,2);f=fftshift(abs(fft2(f); imshow(f,-1,5, f=imrotate(f,45,bilinear,crop subplot(2
3、,2,3); f=fftshift(abs(fft2(f); subplot(2,2,4);imshow(f,-1,5, a=magic(3); b=ones(3); a(8,8)=0; b(8,8)=0; c=fft2(a).*fft2(b); d=ifft2(c); d=d(1:5,1:5); d=real(d)d = 8.0000 9.0000 15.0000 7.0000 6.0000 11.0000 17.0000 30.0000 19.0000 13.0000 15.0000 30.0000 45.0000 30.0000 15.0000 7.0000 21.0000 30.000
4、0 23.0000 9.0000 4.0000 13.0000 15.0000 11.0000 2.0000离散余弦变换: rgb=imread(autumn.tif i=rgb2gray(rgb); j=dct2(i);imshow(rgb);imshow(log(abs(j),); colormap(jet(64);colorbar; clear; j(abs(j)10)=0; k=idct2(j);imshow(k,0,255); i=imread( a=im2double(i);imshow(a); d=dctmtx(size(a,1); dct=d*a*d;imshow(dct);W
5、alsh-Hadamard变换: sq=1,1,3,1;2,1,2,2; for k=1:4 wht(:,k)=hadamard(2)*sq(:,k)/2; end; wht; for j=1:2; a=wht(j,:) hadamard(4); wh(:,j)=hadamard(4)*wht(j,:/4; wh=whwh = 1.6250 0.3750 -0.3750 -0.1250 -0.1250 0.1250 -0.1250 -0.3750cameraman.tif h=hadamard(256); i=double(i)/256; hi=h*i*h; hi=hi/256;imshow(
6、hi); ci=dct2(i);imshow(ci);Radon变换: iptsetpref(ImshowAxesVisibleon i=zeros(100,100); i(25:75,25:75)=1; th=0:180; r,xp=radon(i,th); imshow(r,); colormap(hot); i=fitsread(solarspectra.fts i=mat2gray(i); bw=edge(i);imshow(bw);Radon逆变换: p=phantom(256); imshow(p); th1=0:10:170;r1,xp=radon(p,th1); th2=0:r2,xp=radon(p,th2); th3=0:r3,xp=radon(p,th3); figure,imagesc(th3,xp,r3); figure;i1=iradon(r1,10); i2=iradon(r2,5); i3=iradon(r3,2);imshow(i2);imshow(i3);Fan-Beam变换: ph=phantom(128);imshow(ph); f,fpos,fangles=fanbeam(ph,250);imshow(f,); axis normal;
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1