%% 学习目标: 使用高频强调滤波和直方图均衡化对图像处理
f=imread('01.png'); %% 读入图像
subplot(2,2,1); %% 在同一个窗口中显示多副图像
imshow(f),title('原图')
%% 对图象进行填充
PQ=paddedsize(size(f));
%% 高通滤波
D0=0.05*PQ(1);
HBW=hpfilter('btw',PQ(1),PQ(2),D0,2);
gbw=dftfilt(f,HBW);
gbw=uint8(gbw);
subplot(2,2,2);
imshow(gbw),title('btw滤波后图像')
%% 高频强调滤波
H=0.5+2*HBW;
ghf=dftfilt(f,H);
ghf=uint8(ghf);
subplot(2,2,3);
imshow(ghf),title('高频强调滤波后图像')
%% 对高频强调滤波后图象进行直方图均衡化
ghe=histeq(ghf,256);
ghe=uint8(ghe);
subplot(2,2,4);
imshow(ghe),title('直方图均衡化图像')
%% 大仙QQ:1960009019
%% 在线教育微信公众号:大仙一品堂