图像锐化处理

锐化
 I = imread('photo.jpeg');
w1 = fspecial('sobel');
w2 = w1';
G1 = imfilter(I,w1);
G2 = imfilter(I,w2);
G = abs(G1)+abs(G2);
figure;
subplot(2,2,1);
imshow(I),title('原图像');
subplot(2,2,2);
imshow(G1,[]),title('水平sobel');  
subplot(2,2,3);
imshow(G2,[]),title('竖直sobel');
subplot(2,2,4);
imshow(G,[]),title('sobel');
I0
I0
锐化
I=im2double(rgb2gray(imread('logo.jpg')));
subplot(311);
imshow(I),title('原始图像');
BW=edge(I,'roberts');
H1=[1 0;0 -1];H2=[0 1;-1 0];
R1=imfilter(I,H1);
R2=imfilter(I,H2);
edgeI=abs(R1)+abs(R2);
subplot(312);
imshow(edgeI),title('Robert梯度图像');
sharpI=I+edgeI;
subplot(313);
imshow(sharpI),title('Robert锐化图像');

猜你喜欢

转载自blog.csdn.net/LiuJiuXiaoShiTou/article/details/78588845