-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp_numPatches.m
More file actions
69 lines (42 loc) · 1.46 KB
/
p_numPatches.m
File metadata and controls
69 lines (42 loc) · 1.46 KB
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
% Display plots showing the variability in illuminant estimate as a
% function of the number of different reflectance spectra (patches) used
% for estimation. This script reproduces Figure 5 from the manuscript.
%
% Copyright, Henryk Blasinski 2017.
close all;
clear all;
clc;
destPath = [];
% destPath = fullfile(cmfRootPath,'..','Figures');
fName = fullfile(cmfRootPath,'Results','numPatches.mat');
load(fName);
%% Display Plots
lw = 1.5;
figure;
hold on; grid on; box on;
set(gca,'TickLabelInterpreter','Latex');
set(gcf,'Units','Centimeters');
set(gca,'FontSize',6);
set(gcf,'PaperPosition',[1 1 5 2]);
selXchrom = [3];
selYchrom = [3];
selCameras = 3;
for s=1:nLedSets
data = estimationError(selXchrom,selYchrom,selCameras,s,:,:,:);
data = min(data,5);
sz = size(data);
reshapedData = reshape(data,[sz(1)*sz(2)*sz(3)*sz(4)*sz(5)*sz(6), sz(7)]);
avgErr = mean(reshapedData);
stdErr = std(reshapedData);
errorbar(numPatches,avgErr,stdErr,'LineWidth',lw);
plot(numPatches,ones(nPatchSets,1)*referenceError(selXchrom,selYchrom,s),'--','LineWidth',lw);
end
ylim([0.1 0.5]);
xlim([0 max(numPatches)+1]);
ylabel('Illuminant estimate RMS error','Interpreter','latex');
xlabel('Number of surface reflectance spectra','Interpreter','latex');
legend({'Proposed','Error bound'},'Location','NorthEast','Interpreter','latex')
if isempty(destPath) == false
fName = fullfile(destPath,'numPatches.eps');
print('-depsc',fName);
end