-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathlime.m
More file actions
25 lines (19 loc) · 695 Bytes
/
lime.m
File metadata and controls
25 lines (19 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function [output,ini_map] = lime(input_image,alpha,mu,rho,gamma)
%obtaining illumination map
%input_image is raw image
%alpha, mu, rho are constant parameters for the solver
%gamma is parameter for gamma correction
%output is three-channel refined illumination map
%ini_map is single-channel initial illumination map
B_norm = im2double(input_image);
ini_map = initial_map(B_norm);
%single-channel refined illumination map
[ref_map] = lime_trial(ini_map, alpha, mu, rho);
abs_ref_map = abs(ref_map);
T_gamma = gamma_corr(abs_ref_map, gamma);
%mapping ref_map to three channels
Topt(:,:,1) = T_gamma;
Topt(:,:,2) = T_gamma;
Topt(:,:,3) = T_gamma;
output = Topt;
end