常用图像锐化算法

%常用图像锐化算法
clc
clear
close all
% 程序代写&算法设计,联系qq:380238062,转载时请保留
ima=imread('input.jpg');%读入图像
if isrgb(ima)
    ima=rgb2gray(ima);%如果是彩色图像,则转为灰度图像   
end
ima=double(ima);

bw1 = edge(ima,'sobel'); %sobel算子锐化
figure;subplot(121);imshow(uint8(ima));title('原始图像');%图像显示
subplot(122);imshow(bw1);title('sobel算子锐化');

bw2 = edge(ima,'prewitt');%prewitt算子锐化
figure;subplot(121);imshow(uint8(ima));title('原始图像');
subplot(122);imshow(bw2);title('prewitt算子锐化');

bw3 = edge(ima,'roberts');%roberts算子锐化
figure;subplot(121);imshow(uint8(ima));title('原始图像');
subplot(122);imshow(bw3);title('roberts算子锐化');

bw4 = edge(ima,'log');%log算子锐化
figure;subplot(121);imshow(uint8(ima));title('原始图像');
subplot(122);imshow(bw4);title('log算子锐化');

bw5 = edge(ima,'canny');�nny算子锐化
figure;subplot(121);imshow(uint8(ima));title('原始图像');
subplot(122);imshow(bw5);title('canny算子锐化');
% 程序代写&算法设计,联系qq:380238062,转载时请保留
h1=fspecial('gaussian',[9 9]);%gaussian低通滤波器锐化
bw6 = imfilter(ima,h1);
figure;subplot(121);imshow(uint8(ima));title('原始图像');
subplot(122);imshow(uint8(bw6));title('gaussian低通滤波器锐化');

h2=fspecial('laplacian');%laplacian算子锐化
bw7 = imfilter(ima,h1);
figure;subplot(121);imshow(uint8(ima));title('原始图像');
subplot(122);imshow(uint8(bw7));title('laplacian算子锐化')

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值