-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathColorConstancyDemo.m
More file actions
36 lines (28 loc) · 997 Bytes
/
ColorConstancyDemo.m
File metadata and controls
36 lines (28 loc) · 997 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
26
27
28
29
30
31
32
33
34
35
36
% shows example of illuminant estimation based on Grey-World, Shades of
% Gray, max-RGB, and Grey-Edge algorithm
%some example images
input_im=double(imread('building1.jpg'));
%input_im=double(imread('cow2.jpg'));
%input_im=double(imread('dog3.jpg'));
figure(1);imshow(uint8(input_im));
title('input image');
% Grey-World
[wR,wG,wB,out1]=general_cc(input_im,0,1,0);
figure(2);imshow(uint8(out1));
title('Grey-World');
% max-RGB
[wR,wG,wB,out2]=general_cc(input_im,0,-1,0);
figure(3);imshow(uint8(out2));
title('max-RGB');
% Shades of Grey
mink_norm=5; % any number between 1 and infinity
[wR,wG,wB,out3]=general_cc(input_im,0,mink_norm,0);
figure(4);imshow(uint8(out3));
title('Shades of Grey');
% Grey-Edge
mink_norm=5; % any number between 1 and infinity
sigma=2; % sigma
diff_order=1; % differentiation order (1 or 2)
[wR,wG,wB,out4]=general_cc(input_im,diff_order,mink_norm,sigma);
figure(5);imshow(uint8(out4));
title('Grey-Edge');