图像增强(1) 灰度变换强度(matlab)

灰度变强增强

imadjust()

J = imadjust(I,[low_in,high_in],[low_out,high_out],gamma)
RGB2 = imadjust(RGB1,[low_in,high_in],[low_out,high_out],gamma)
I:输入图像;
[low_in,high_in]:原图像中要变换的灰度范围;
[low_out,high_out]:变后的灰度范围;
gamma:映射方式,默认为1,即为线性映射,不等于1即为非线性变换。

调整灰度图像范围:

>> I=imread('E:\persional\matlab\images\ba.tif');
>> J = imadjust(I,[0 1],[0.8 0.2]);
>> figure,
>> subplot(121),imshow(I);
>> subplot(122),imshow(J);

在这里插入图片描述

调整图像亮度:

>> I=imread('E:\persional\matlab\images\ba.tif');
>> J = imadjust(I,[0.2 0.8],[0 1],0.3);
>> K = imadjust(I,[0.2 0.8],[0 1],3);
>> figure,
>> subplot(131),imshow(I);
>> subplot(132),imshow(J);
>> subplot(133),imshow(K);

在这里插入图片描述
对彩色图片进行增强:

>> I=imread('E:\persional\matlab\images\ad1.tif');
>> J = imadjust(I,[0.2 0.3 0;0.7 0.8 1],[]);
>> figure,
>> subplot(121),imshow(I);
>> subplot(122),imshow(J);

在这里插入图片描述

brighten()

brighten(h,beta)
h:对句柄为h的图像进行操作
beta:大于0小于1图像变亮,小于0大于-1图像变暗

>> I=imread('E:\persional\matlab\images\ba.tif');
>> figure,imshow(I);
>> brighten(0.6);
>> figure,imshow(I);
>> brighten(-0.6);
>> figure,imshow(I);

在这里插入图片描述

stretchlim()

获取最佳区间

>> I=imread('E:\persional\matlab\images\ba.tif');
>> M = stretchlim(I);%获取最佳区间
>> J = imadjust(I,M,[]);
>> figure,
>> subplot(121),imshow(I);
>> subplot(122),imshow(J);

在这里插入图片描述

imcomplement()

对灰度图像进行反转

>> I=imread('E:\persional\matlab\images\ba.tif');
>> J = imcomplement(I);
>> figure,
>> subplot(121),imshow(I);
>> subplot(122),imshow(J);

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值