matlab彩色图像锐化
时间: 2024-01-08 16:03:37 浏览: 239
用MATLAB实现图像锐化的程序代码
5星 · 资源好评率100%
以下是matlab彩色图像锐化的步骤:
1.读取彩色图像
```matlab
img = imread('color.jpg');
```
2.分离RGB通道
```matlab
R = img(:,:,1);
G = img(:,:,2);
B = img(:,:,3);
```
3.设置锐化模板
```matlab
sharp_kernel = [0 -1 0; -1 5 -1; 0 -1 0];
```
4.对图像三个分量分别锐化滤波
```matlab
R_sharp = imfilter(R, sharp_kernel);
G_sharp = imfilter(G, sharp_kernel);
B_sharp = imfilter(B, sharp_kernel);
```
5.将滤波后的三分量组合
```matlab
img_sharp = cat(3, R_sharp, G_sharp, B_sharp);
```
6.显示锐化后的图像
```matlab
imshow(img_sharp);
```
阅读全文