1,基于梯子算子的图像锐化滤波
%基于梯子算子的图像锐化滤波
clear,clc,close all;
Image = im2double(imread('pic01.bmp'));
[height,width,color] = size(Image);
edgeImage = zeros(height,width,color);
for c =1:color
for x = 1:width-1
for y = 1:height-1
edgeImage(y,x,c) = abs(Image(y,x+1,c)-Image(y,x,c))+abs(Image(y+1,x,c)-Image(y,x,c));
end
end
end
sharpImage = Image+edgeImage;
subplot(131),imshow(Image),title('原图');
subplot(132),imshow(edgeImage),title('梯度图像');
subplot(133),imshow(sharpImage),title('锐化图像');
结果:
2,基于Roberts算子的图像锐化滤波
|