首页 > 编程知识 正文

matlab高斯高通滤波器,matlab 低通滤波器

时间:2023-05-04 13:46:34 阅读:134935 作者:4275

文章开头和结尾更新: https://mwhls.top/2454.html

请在mwhls.top上确认新的更新内容。

关于无图/无目录/格式错误/进一步的关联,请参照上面文章的第一页。

目录1 .目的2 .原理3 .实验结果4 .编码目的采用理想的高通/低通滤波器处理频域。 原理是使用傅立叶变化,变换到频域。 以频率低的部分为中心移动。 以中心为原点设定距离阈值。 根据距离阈值进行频率滤波。 滤波后,重置频率较低的部分。 使用傅立叶逆变换可以获得结果。 码帧: f=fft2(imggray ); %傅立叶变换f1=FFTshift(f ); %低频偏移中心g(u,v )=h ) u,v ).*F1 ) u,v ); 在%滤波函数h和频域F1点处g2=FFTshift(g ); %低频复位imgresult=ifft2(G2 ); %傅立叶逆变换实验结果代码clear; img=imread(Lena_color.jpg ); imggray=RGB2gray(img; [height,width]=size(imggray ); hist array=zeros (1,256 ); % thefouriertransformftransform=ff T2 (img gray ); fransformcenter=FFT shift (ftransform ); % ideal low-passideallowpass=zeros (height,width ); idealhighpass=Zeros(height,width ); mid_width=width/2; mid_height=height/2; DLThreshold=30; DLThresholdExp2=DLThreshold ^ 2; DHThreshold=10; DHThresholdExp2=DHThreshold ^ 2; forrow=1: heightforcol=1: width % ideal low-passtemp=((row-mid _ height ) ^2) col-mid_width ) ^2; iftempdlthresholdexp2ideal low pass (row,col )=1; endiftempdhthresholdexp2ideal high pass (row,col )=1; endendenddlprocesscenter=ideal low pass.* ftransformcenter; dl process=FFT shift (dlprocesscenter; imgdlprocess=uint8(ifft2 ) dlprocess ); dprocesscenter=ideal high pass.* ftransformcenter; DH process=FFT shift (dhprocesscenter; imgdhprocess=uint8(ifft2 ) DHprocess ); subplot (1,3,1 ) imshow ) imggray ),title ) )、Origin ); subplot (1,3,2 ) imshow ) imgdlprocess ),title ) ) thefouriertransformbaseonideallow-pass ); subplot (1,3,3 ) imshow ) imgdhprocess ),title ) ) thefouriertransformbaseonidealhigh-pass );

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。