2024年5月27日发(作者:)

实验一 图像增强和图像分割实验

(1)分别用图中给出的直线和曲线作为增强函数进行增强,比较它们的效果

并讨论其特点。

L-1

E1(s)

E2(s)

L-1

E4(s)

E3(s)

E5(s)

线性变换 对指数变换

L-1

L-1

图片1 图片2

实验步骤:

1. 在MATLAB中编写灰度图像的线性变换点运算程序

图片1处理程序

I=imread('图片');

%读入原图像

I=im2double(I);

%转换数据类型为double

[M,N]=size(I);

精选

figure(1);

imshow(I);%显示原图像

title('原图像');

figure(2);

I=rgb2gray(I);

%转化为灰度图像

[H,x]=imhist(I,64);

stem(x,(H/M/N),'.');

title('原图像');

%tan=30`

a=sqrt(3)/3;b=0;

y=a.*I+b;

figure(3);

imshow(y);

title('tan=30');

figure(4);

[H,x]=imhist(y,64);

stem(x,(H/M/N),'.');

title('tan=30');

%tan=45`

a=1;b=0;

y=a.*I+b;

figure(5);

imshow(y);

title('tan=45');

figure(6);

[H,x]=imhist(y,64);

stem(x,(H/M/N),'.');

title('tan=45');

%tan=60`

a=sqrt(3);b=0;

y=a.*I+b;

figure(7);

imshow(y);

title('tan=60');

figure(8);

[H,x]=imhist(y,64);

stem(x,(H/M/N),'.');

title('tan=60');

实验结果如下图所示:

原图像

图片1的原图像

精选