最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

基于matlab数字图像处理之高通滤波器

来源:动视网 责编:小OO 时间:2025-09-23 23:51:48
文档

基于matlab数字图像处理之高通滤波器

实践二:理想高通滤波器、Butterworth高通滤波器、高斯高通滤波器2.1.1理想高通滤波器实践代码:I=imread('girlsubplot(221),imshow(I);title('原图像');s=fftshift(fft2(I));subplot(223),imshow(abs(s),[]);title('图像傅里叶变换所得频谱');subplot(224),imshow(log(abs(s)),[]);title('图像傅里叶变换取对数所得频谱');[a,b]=size(s);
推荐度:
导读实践二:理想高通滤波器、Butterworth高通滤波器、高斯高通滤波器2.1.1理想高通滤波器实践代码:I=imread('girlsubplot(221),imshow(I);title('原图像');s=fftshift(fft2(I));subplot(223),imshow(abs(s),[]);title('图像傅里叶变换所得频谱');subplot(224),imshow(log(abs(s)),[]);title('图像傅里叶变换取对数所得频谱');[a,b]=size(s);
实践二: 理想高通滤波器、Butterworth高通滤波器、高斯高通滤波器

2.1.1 理想高通滤波器实践代码: 

I=imread('girl

subplot(221),imshow(I);

title('原图像');

s=fftshift(fft2(I));

subplot(223),

imshow(abs(s),[]);

title('图像傅里叶变换所得频谱');

subplot(224),

imshow(log(abs(s)),[]);

title('图像傅里叶变换取对数所得频谱');

[a,b]=size(s);

a0=round(a/2);

b0=round(b/2);

d=10;

p=0.2;q=0.5;

for i=1:a

    for j=1:b

        distance=sqrt((i-a0)^2+(j-b0)^2);

if distance<=d h=0;

        else h=1;

        end;

        s(i,j)=(p+q*h)*s(i,j);

    end;

end;

s=uint8(real(ifft2(ifftshift(s))));

subplot(222),

imshow(s);title('高通滤波所得图像');

I=imread('girl

[f1,f2]=freqspace(size(I),'meshgrid');

Hd=ones(size(I));

r=sqrt(f1.^2+f2.^2);

Hd(r<0.2)=0;

figure

surf(Hd,'Facecolor','interp','Edgecolor','none','Facelighting','phong'); % 画三维曲面(色)图

2.1.2 理想高通滤波器实践结果截图:

2.2.1 Butterworth高通滤波器实践代码:

subplot(121),imshow(I1);

title('原始图像');

f=double(I1);

g=fft2(f);

g=fftshift(g);

[N1,N2]=size(g);

n=2;

d0=5;

n1=fix(N1/2);

n2=fix(N2/2);

for i=1:N1

    for j=1:N2

        d=sqrt((i-n1)^2+(j-n2)^2);

        if d==0

            h=0;

        else

           h=1/(1+(d0/d)^(2*n));

       end

    result(i,j)=h*g(i,j);

  end

end

result=ifftshift(result);

X2=ifft2(result);

X3=uint8(real(X2));

subplot(122),imshow(X3) ;

title('Butterworth高通滤波');

I1=imread('flower

[f1,f2]=freqspace(size(I1),'meshgrid');

D=0.3;

r=f1.^2+f2.^2;

n=4;

for i=1:size(I1,1)

    for j=1:size(I1,2)

        t=(D*D)/r(i,j);

        Hd(i,j)=1/(t^n+1);

    end

end

figure

surf(Hd,'Facecolor','interp','Edgecolor','none','Facelighting','phong'); % 画三维曲面(色)图

2.2.2 Butterworth高通滤波器实践结果截图:

2.3.1 高斯高通滤波器实践代码:

clear all

IA=imread('girl 

[f1,f2]=freqspace(size(IA),'meshgrid');

%D=100/size(IA,1);

D=0.3;

r=f1.^2+f2.^2;

for i=1:size(IA,1)

    for j=1:size(IA,2)

        t=r(i,j)/(D*D);

        Hd(i,j)=1-exp(-t);

    end

end

Y=fft2(double(IA));

Y=fftshift(Y);

Ya=Y.*Hd;

Ya=ifftshift(Ya);

Ia=real(ifft2(Ya));

figure

subplot(2,2,1),imshow(uint8(IA));title('原始图像');

subplot(2,2,2),imshow(uint8(Ia));title('高斯高通滤波');

figure

surf(Hd,'Facecolor','interp','Edgecolor','none','Facelighting','phong');

2.3.2 高斯高通滤波器实践结果截图:

文档

基于matlab数字图像处理之高通滤波器

实践二:理想高通滤波器、Butterworth高通滤波器、高斯高通滤波器2.1.1理想高通滤波器实践代码:I=imread('girlsubplot(221),imshow(I);title('原图像');s=fftshift(fft2(I));subplot(223),imshow(abs(s),[]);title('图像傅里叶变换所得频谱');subplot(224),imshow(log(abs(s)),[]);title('图像傅里叶变换取对数所得频谱');[a,b]=size(s);
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top