伽马变换曲线及伽马增强

x = linspace(0, 1);
y1 = x.^0.3; 
y2 = x.^0.5; 
y3 = x.^1; 
y4 = x.^2; 
y5 = x.^3.5; 
 
 
figure; 
hold on; 
xlabel('灰度输入值(相对值:R=I(i,j)/255)'); 
ylabel('灰度输出值(相对值)'); 
plot(x, y1, 'color',[124 187 50]/255); %0.3
set(0,'DefaultLineLineWidth',1.5);%设置线宽
hold on;
plot(x, y2, 'color',[0.00 0.45 0.74]); %0.5
set(0,'DefaultLineLineWidth',1.5);
hold on;
plot(x, y3,'color',[0.85 0.33 0.1]); %1
set(0,'DefaultLineLineWidth',1.5);
hold on;
plot(x, y4,'color',[255 174 0]/255); %2
set(0,'DefaultLineLineWidth',1.5);
hold on;
plot(x, y5,'color',[0.49 0.18 0.56]); %3.5
set(0,'DefaultLineLineWidth',1.5);
legend('γ = 0.3','γ = 0.5','γ = 1', 'γ = 2','γ = 3.5'); 

结果曲线图像:坐标框、坐标刻度值、字体可以在图像框中的  编辑→坐标轴属性  中设置

 伽马增强代码:

I = imread('F:\enhancement\images\SIRE_01.jpg');
I_gamma = im2double(I).^1.5;
figure; imshow(I_gamma);
imwrite(I_gamma, 'F:\load\gamma_1.5.jpg');

结果:gamma值在0-01之间是可以实现提升亮度的效果,等于1与原图像相同,大于1变暗

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值