-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdrawRetinex.m
79 lines (68 loc) · 2.44 KB
/
drawRetinex.m
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
im = '8gray';
s = 35;
f = 3;
lr = 1;
scale = 1/2;
% input '/home/csjunxu/Paper/Enhancement/Dataset/Images_LowLight/'
image = imread([ im '.png']);
[hh, ww, cc] = size(image);
ll = min(hh,ww);
ii = 101;
image = imresize(image(1:ll,ii:ll+ii-1,:), scale);
%[ outputimage ] = boxandresize( image, h,w,s, f,lr);
imname = sprintf('%s_%s.png','rs',im);
imwrite(image,imname,'png');
%% illumiance
h = 160;
w = 80;
% baseline
image = imread([im '_I_RGB_STAR_pI1.7_pR0.1.png']);
illuminance = imresize(image(1:ll,ii:ll+ii-1,:), scale);
[ outputimage ] = boxandresize( illuminance, h,w,s, f,lr);
imname = sprintf('%s_%s_I_STAR.png','rs',im);
imwrite(outputimage,imname,'png');
% STAR
image = imread([im '_I_RGB_STAR_pI1.7_pR0.1.png']);
illuminance = imresize(image(1:ll,ii:ll+ii-1,:), scale);
[ outputimage ] = boxandresize( illuminance, h,w,s, f,lr);
imname = sprintf('%s_%s_I_STAR.png','rs',im);
imwrite(outputimage,imname,'png');
% JieP ICCV 2017
image = imread([im '_I_RGB_JieP.png']);
illuminance = imresize(image(1:ll,ii:ll+ii-1,:), scale);
[ outputimage ] = boxandresize( illuminance, h,w,s, f,lr);
imname = sprintf('%s_%s_I_JieP.png','rs',im);
imwrite(outputimage,imname,'png');
% WVM CVPR 2016
image = imread([im '_I_RGB_WVM.png']);
illuminance = imresize(image(1:ll,ii:ll+ii-1,:), scale);
[ outputimage ] = boxandresize( illuminance, h,w,s, f,lr);
imname = sprintf('%s_%s_I_WVM.png','rs',im);
imwrite(outputimage,imname,'png');
%% reflectance
h = 60;
w = 50;
% baseline
image = imread([im '_I_RGB_STAR_pI1.7_pR0.1.png']);
illuminance = imresize(image(1:ll,ii:ll+ii-1,:), scale);
[ outputimage ] = boxandresize( illuminance, h,w,s, f,lr);
imname = sprintf('%s_%s_I_STAR.png','rs',im);
imwrite(outputimage,imname,'png');
% STAR
image = imread([im '_R_RGB_STAR_pI1.7_pR0.1.png']);
reflectance = imresize(image(1:ll,ii:ll+ii-1,:), scale);
[ outputimage ] = boxandresize( reflectance, h,w,s, f,lr);
imname = sprintf('%s_%s_R_STAR.png','rs',im);
imwrite(outputimage,imname,'png');
% JieP ICCV 2017
image = imread([im '_R_RGB_JieP.png']);
reflectance = imresize(image(1:ll,ii:ll+ii-1,:), scale);
[ outputimage ] = boxandresize( reflectance, h,w,s, f,lr);
imname = sprintf('%s_%s_R_JieP.png','rs',im);
imwrite(outputimage,imname,'png');
% WVM CVPR 2016
image = imread([im '_R_RGB_WVM.png']);
reflectance = imresize(image(1:ll,ii:ll+ii-1,:), scale);
[ outputimage ] = boxandresize( reflectance, h,w,s, f,lr);
imname = sprintf('%s_%s_R_WVM.png','rs',im);
imwrite(outputimage,imname,'png');