matlab图像增强与平滑简单程序.docx

上传人:b****6 文档编号:16728503 上传时间:2023-07-16 格式:DOCX 页数:10 大小:3.66MB
下载 相关 举报
matlab图像增强与平滑简单程序.docx_第1页
第1页 / 共10页
matlab图像增强与平滑简单程序.docx_第2页
第2页 / 共10页
matlab图像增强与平滑简单程序.docx_第3页
第3页 / 共10页
matlab图像增强与平滑简单程序.docx_第4页
第4页 / 共10页
matlab图像增强与平滑简单程序.docx_第5页
第5页 / 共10页
matlab图像增强与平滑简单程序.docx_第6页
第6页 / 共10页
matlab图像增强与平滑简单程序.docx_第7页
第7页 / 共10页
matlab图像增强与平滑简单程序.docx_第8页
第8页 / 共10页
matlab图像增强与平滑简单程序.docx_第9页
第9页 / 共10页
matlab图像增强与平滑简单程序.docx_第10页
第10页 / 共10页
亲,该文档总共10页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

matlab图像增强与平滑简单程序.docx

《matlab图像增强与平滑简单程序.docx》由会员分享,可在线阅读,更多相关《matlab图像增强与平滑简单程序.docx(10页珍藏版)》请在冰点文库上搜索。

matlab图像增强与平滑简单程序.docx

matlab图像增强与平滑简单程序

图像增强与平滑

直方图:

I=imread('1.jpg');

imshow(I);

I=rgb2gray(I);%三维变成二维的图;

figure,imhist(I);%显示灰度分布

直方图均衡处理:

I=imread('1.jpg');

I=rgb2gray(I);

J=histeq(I);

Subplot(1,2,1),imshow(I);

Subplot(1,2,2),imshow(J);

figure,Subplot(1,2,1),imhist(I,64);

Subplot(1,2,2),imhist(J,64);%这个参数是什么意思?

灰度变换:

imadjust(I,[],[],);

I=imread('1.jpg');

I=rgb2gray(I);

J=imadjust(I,[0.1,0.5],[]);

Subplot(1,2,1),imshow(I);

Subplot(1,2,2),imshow(J);

figure,Subplot(1,2,1),imhist(I,64);

Subplot(1,2,2),imhist(J,64);

图像反转:

I=imread('1.jpg');

I=rgb2gray(I);

J=imadjust(I,[0.1,0.9],[0.90.1]);

Subplot(1,2,1),imshow(I);

Subplot(1,2,2),imshow(J);

figure,Subplot(1,2,1),imhist(I,64);

Subplot(1,2,2),imhist(J,64);

图像平滑

噪声

I=imread('1.jpg');

I=rgb2gray(I);

J=imnoise(I,'salt&pepper',0.02);

H=ones(5,5)/25;

I2=imfilter(J,H);%领域平均法去噪;

Subplot(1,2,1),imshow(J);

Subplot(1,2,2),imshow(I2);

高斯噪声

J=imnoise(I,’gaussian’,0.02);%高斯噪声

I=imread('1.jpg');

I=rgb2gray(I);

J=imnoise(I,'gaussian',0.02);

H=ones(5,5)/25;

I2=imfilter(J,H);%领域平均法去噪;

Subplot(1,2,1),imshow(J);

Subplot(1,2,2),imshow(I2);

掩模大小对比

I=imread('2.bmp');

I=rgb2gray(I);

J=imnoise(I,'gaussian',0.02);

H=ones(2,2)/25;

H1=ones(5,5)/25;

I1=imfilter(J,H1);%5*5领域平均法去噪

I2=imfilter(J,H);%2*2领域平均法去噪

Subplot(1,2,1),imshow(I1);

Subplot(1,2,2),imshow(I2);

中值滤波

I=imread('2.bmp');

I=rgb2gray(I);

J=imnoise(I,'gaussian',0.02);

H=ones(5,5)/25;

I2=medfilt2(J,[5,5]);

Subplot(1,2,1),imshow(J);

Subplot(1,2,2),imshow(I2);

梯度法对图像锐化

I=imread('2.bmp');

I=rgb2gray(I);

I=double(I);

[IX,IY]=gradient(I);

GM=sqrt(IX.*IX+IY.*IY);

figure

(1),imshow(GM,[]);

拉普拉斯贝尔特拉米算子

I=imread('2.bmp');

I=rgb2gray(I);

I=double(I);

Subplot(1,2,1),imshow(I,[]);

H=[010,1-41,010];

J=conv2(I,H,'same');

figure

(1),imshow(J,[]);

图像色彩加强

[rgb]=imread('3.jpg');

rbgnew(:

:

1)=rgb(:

:

3);

rbgnew(:

:

2)=rgb(:

:

1);

rbgnew(:

:

3)=rgb(:

:

2);

figure,imshow(rbgnew);

图像分割

边缘检测

I=imread('2.bmp');

I=rgb2gray(I);

J=edge(I,’Roberts’,0.1);/%edge调用roberts,算子,,,阀值0.1

figure

(1),imshow(J,[]);

阀值0.05;;;;;;;

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 自然科学 > 物理

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2