Matlab 专栏收录该内容
8 篇文章 0 订阅

This MATLAB function maps the intensity values in grayscale image I to new

values in J such that 1% of data is saturated at low and high intensities of I.

(本博客系原创，转载请注明出处：http://blog.csdn.net/xuexiyanjiusheng/article/details/46944395)

(博主cnblogs中对应文章：http://www.cnblogs.com/pfli1995/p/4657302.html)

Description

J = imadjust(I) maps the intensity values in grayscale image I to new values in J such that 1% of data is saturated饱和的at low and high intensities of I. This increases the contrast of the output image J. This syntax is equivalent to imadjust(I,stretchlim(I)).

J = imadjust(I,[low_in; high_in],[low_out; high_out]) maps the values in I to new values in J such that values between low_in and high_in map to values between low_out and high_out.

Note If high_out is less than low_out, imadjust reverses the output image, as in a photographic negative.

J = imadjust(I,[low_in; high_in],[low_out; high_out],gamma) maps the values in I to new values in J, where gamma specifies the shape of the curve describing the relationship between the values in I and J.

newmap = imadjust(map,[low_in; high_in],[low_out; high_out],gamma) transforms the m-by-3 array colormap associated with an indexed image. low_in, high_in, low_out, and high_out must be 1-by-3 vectors. gamma can be a 1-by-3 vector that specifies a unique gamma value for each channel or a scalar that specifies the value used for all three channels. The rescaled colormap newmap is the same size as map.

RGB2 = imadjust(RGB1,___) performs the adjustment on each plane (red, green, and blue) of the RGB image RGB1. If low_in, high_in, low_out, high_out, and gamma are scalars, imadjust applies the same mapping to the red, green, and blue components of the image. To specify unique mappings for each color component of the image, specify low_in, high_in, low_out, high_out, and gamma as 1-by-3 vectors.

• % GRAY TRANSFORM

clc;
Imshow (I);
J=imadjust (I, [0.3 0.7], [0 1], 1); %transforms the walues in the %intensity image I to values in J by lineally mapping values

% between 0.3 and 0.7 to values between 0 and 1.
Figure;
Imshow (J);
J=imadjust (I, [0.3 0.7], [0 1], 0.5); % if GAMMA is less than 1, the

% mapping si weighted toward higher (brighter) output values.
Figure;
Imshow (J);
J=imadjust (I, [0.3 0.7], [0 1], 1.5); % if GAMMA is greater than% 1, the mapping si weighted toward lower (darker) output values.
Figure;
Imshow (J)
J=imadjust (I, [0.3 0.7], [1 0], 1); % If TOP<BOTTOM, the output% image is reversed, as in a photographic negative.
Figure;
Imshow (J);

•  已知图像像素的灰度值主要集中在[50，200]，因此图像的灰度变换的思想是先将灰度值小于50像素点赋0，大于200赋255，然后在把灰度在[50，200]中的像素进行灰度拉伸到[0，255]，这样达到突出图像有用信息，抑制无用信息的目的。

我觉得应该是 [0 255] 相当于 [0 1] 吧，那么 [50 200]就对应的为 [50/255 200/255]，相当于[0.196 0.784]也就是J=imadjust(I,[0.196 0.784],[])

Examples:

• Adjust Contrast of Grayscale Image

Read a low-contrast grayscale image into the workspace and display it.

imshow(I);

Adjust the contrast of the image so that 1% of the data is saturated at low and high intensities, and display it.

figure

imshow(J)

• Adjust Contrast of Grayscale Image Specifying Contrast Limits

Read a low-contrast grayscale image into the workspace and display it.

imshow(I);

Adjust the contrast of the image, specifying contrast limits.

figure

imshow(K)

•  Adjust Contrast of RGB Image

Read an RGB image into the workspace and display it.

imshow(RGB)

Adjust the contrast of the RGB image, specifying contrast limits.

RGB2 = imadjust(RGB,[.2 .3 0; .6 .7 1],[]);

figure

imshow(RGB2)

• 1
点赞
• 2
评论
• 4
收藏
• 打赏
• 扫一扫，分享海报

03-28 1万+

11-27 525
03-27 2483
10-12 1万+
10-28 464
10-25 9117
02-26 851
08-15 2906
05-15 2万+

xuexiyanjiusheng

¥2 ¥4 ¥6 ¥10 ¥20

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