Matlab数字图像处理基础【6】

实例:彩色图像的锐化
clc;
clear;

%读取经典图像lena.jpg
A = imread('lena.jpg');
figure,imshow(A),title('原图像');

%提取三个通道的像素值
R_A = A(:,:,1);
G_A = A(:,:,2);
B_A = A(:,:,3);
figure
subplot(1,3,1),imshow(R_A),title('R通道');
subplot(1,3,2),imshow(G_A),title('G通道');
subplot(1,3,3),imshow(B_A),title('B通道');

%定义锐化算子
h1 = fspecial('sobel');
h2 = fspecial('prewitt');

%R通道锐化
R_h1 = imfilter(R_A, h1);
R_h2 = imfilter(R_A, h2);
figure,
subplot(1,2,1),imshow(R_h1),title('Sobel R通道锐化');
subplot(1,2,2),imshow(R_h2),title('Prewitt R通道锐化');

%G通道锐化
G_h1 = imfilter(G_A, h1);
G_h2 = imfilter(G_A, h2);
figure,
subplot(1,2,1),imshow(G_h1),title('Sobel G通道锐化');
subplot(1,2,2),imshow(G_h2),title('Prewitt G通道锐化');

%B通道锐化
B_h1 = imfilter(B_A, h1);
B_h2 = imfilt
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值