欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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);

A New Tone Mapping Operator Based on Twolayer Model(matlab)