%高频提升滤波
function d=strength_filter(x,n)
d=x;
operator=[0,-1,0;-1,6,-1;0,-1,0];
[width,height]=size(x);
for ii=1:width-(n-1)
for jj=1:height-(n-1)
tmp=x(ii:ii+n-1,jj:jj+n-1).*operator;
p=sum(sum(tmp));
d(ii+(n-1)/2,jj+(n-1)/2)=p;
end
function d=strength_filter(x,n)
d=x;
operator=[0,-1,0;-1,6,-1;0,-1,0];
[width,height]=size(x);
for ii=1:width-(n-1)
for jj=1:height-(n-1)
tmp=x(ii:ii+n-1,jj:jj+n-1).*operator;
p=sum(sum(tmp));
d(ii+(n-1)/2,jj+(n-1)/2)=p;
end
end
%==================================================================================
%author:王同乐
%date:2016/10/30
img=imread('lena.png');
img=rgb2gray(img);
img=im2double(img);%输入图像类型为uint8,将其转换为double类型进行运算
%====================================高频提升
subplot(1,3,1);imshow(img);title('原图');
subplot(1,3,2);imshow(strength_filter(img,3));title('高频提升A=2后的图像');
subplot(1,3,3);imshow(Laplacian_strength(img,3));title('laplacian提升A=1后的图像');