A New Tone Mapping Operator Based on Twolayer Model(matlab)
程序员文章站
2024-03-04 08:01:29
...
%%
%2019-A New Tone Mapping Operator Based on Twolayer Model
%2020年6月28日-2020年6月28日
clc
clear
img=hdrread('Bottles_Small.hdr');
[m,n,channel]=size(img);
%Luminance Layer Acquisition
Lave=exp(mean2(log(0.001+img)));
Lwa=img./Lave;
L_wmax=max(max(img));
Lwa_max=L_wmax/Lave;
L=1./(log10(Lwa_max+1)).*((log(Lwa+1)./log(5))./(1+exp(-(log(Lwa)./log(5)))));
%Contrast Layer Acquisition
f=fspecial('average',5);
Ladapted=imfilter(img,f,'conv','replicate');
V=exp(-(1/1.44).*(img./Ladapted));
alpha=1.1;
C=(img./Lave)./(alpha.*V+img./Lave);
%Operator Fusion
Ld=L.*C;
%gamma校正
gamma=0.4;
outimg=Ld.^gamma;
figure;imshow(outimg);
上一篇: 使用linux命令 根据序列ID快速提取fastq序列
下一篇: 转:代码审查“思维导图”