数字图像处理实验3(HGD)—— 帮助文档

imadjust:

J = imadjust(I,[LOW_IN; HIGH_IN],[LOW_OUT; HIGH_OUT]) maps the values in intensity image I to new values in J such that values between LOW_IN and HIGH_IN map to values between LOW_OUT and HIGH_OUT. Values below LOW_IN and above HIGH_IN are clipped; that is, values below LOW_IN map to LOW_OUT, and those above HIGH_IN map to HIGH_OUT. You can use an empty matrix ([]) for [LOW_IN; HIGH_IN] or for [LOW_OUT; HIGH_OUT] to specify the default of [0 1]. If you omit the argument, [LOW_OUT; HIGH_OUT] defaults to [0 1].

J = imadjust(I,[LOW_IN; HIGH_IN],[LOW_OUT; HIGH_OUT],GAMMA) maps the values of I to new values in J as described in the previous syntax. GAMMA specifies the shape of the curve describing the relationship between the values in I and J. If GAMMA is less than 1, the mapping is weighted toward higher (brighter) output values. If GAMMA is greater than 1, the mapping is weighted toward lower (darker) output values. If you omit the argument, GAMMA defaults to 1 (linear mapping).

imadjust所实现的功能即为图像的线性灰度变换(参照北航数字图像处理与分析第三版65页),将输入图像的某个亮度值区间[a,b]扩展为输出图像的亮度值区间[c,d],其目的是有效的改善图像视觉效果。[LOW_IN; HIGH_IN]即对应着[a,b],[LOW_OUT; HIGH_OUT])即对应着[c,d](归一化),默认值为[0,1],第二个函数中多一个GAMMA参数,当其为1的时候为线性灰度变换,当其不为1的时候即非线性,如果GAMMA小于1,那么映射就会倾向于更高的输出值,更亮。如果GAMMA大于1,那么映射就会倾向于更低的输出值,更暗。默认为1(线性映射)。

im2bw:

    im2bw Convert image to binary image by thresholding.
    im2bw is not recommended. Use IMBINARIZE instead.

    BW = im2bw(I,LEVEL) converts the intensity image I to black and white.


im2bw即将图像转换为二值图像,可以设定一个门限值(归一化),高于该值时呈现白色,低于该值时呈现黑色。matlab中推荐使用imbinarize函数。

附上实验三代码(仅供参考):

%灰度级扩展
f=imread('lena.jpg');
g1=imadjust(f,[0.3 0.6],[0.1 0.9]); 
figure('NumberTitle', 'off', 'Name', 'intensitychange.m')
subplot(2,3,1);imshow(g1);title('灰度级扩展图像');

%非线性变换
J=double(f);
J1= 40*(log(J+1));
H=uint8(J1);
subplot(2,3,2),imshow(H);title('灰度级非线性变换图像');

%图像反转
J2=255-J;
H2=uint8(J2);
subplot(2,3,3),imshow(H2);title('反转图像');

%直方图阈值
F1=im2bw(f,0.3);
subplot(2,3,4);
imshow(F1);title('阈值为0.3的图像');
F2=im2bw(f,0.7);
subplot(2,3,5);
imshow(F2);title('阈值为0.7的图像');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值