Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
RenderToolbox4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
RenderToolbox4
Commits
8cad3132
Commit
8cad3132
authored
8 years ago
by
Ben Heasly
Browse files
Options
Downloads
Patches
Plain Diff
refactor plot of comparisons between folders to separate function
parent
68ef34cb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Test/Interactive/rtbPlotManyRecipeComparisons.m
+129
-0
129 additions, 0 deletions
Test/Interactive/rtbPlotManyRecipeComparisons.m
Test/Interactive/rtbPlotRenderingComparison.m
+2
-1
2 additions, 1 deletion
Test/Interactive/rtbPlotRenderingComparison.m
with
131 additions
and
1 deletion
Test/Interactive/rtbPlotManyRecipeComparisons.m
0 → 100644
+
129
−
0
View file @
8cad3132
function
fig
=
rtbPlotManyRecipeComparisons
(
comparisons
,
varargin
)
%% Plot a many recipe comparisons from rtbCompareManyRecipes().
%
% fig = fig = rtbPlotManyRecipeComparisons(comparisons) makes a plot to
% visualize the given struct array of comparison results, as produced by
% rtbCompareManyRecipes().
%
%%% RenderToolbox4 Copyright (c) 2012-2017 The RenderToolbox Team.
%%% About Us://github.com/RenderToolbox/RenderToolbox4/wiki/About-Us
%%% RenderToolbox4 is released under the MIT License. See LICENSE file.
parser
=
inputParser
();
parser
.
KeepUnmatched
=
true
;
parser
.
addRequired
(
'comparisons'
,
@
isstruct
);
parser
.
addParameter
(
'fig'
,
figure
());
parser
.
addParameter
(
'nRows'
,
25
,
@
isnumeric
);
parser
.
addParameter
(
'correlationMin'
,
0.8
,
@
isnumeric
);
parser
.
addParameter
(
'correlationStep'
,
0.05
,
@
isnumeric
);
parser
.
addParameter
(
'errorMax'
,
3
,
@
isnumeric
);
parser
.
addParameter
(
'errorStep'
,
0.5
,
@
isnumeric
);
parser
.
parse
(
comparisons
,
varargin
{:});
comparisons
=
parser
.
Results
.
comparisons
;
fig
=
parser
.
Results
.
fig
;
nRows
=
parser
.
Results
.
nRows
;
correlationMin
=
parser
.
Results
.
correlationMin
;
correlationStep
=
parser
.
Results
.
correlationStep
;
errorMax
=
parser
.
Results
.
errorMax
;
errorStep
=
parser
.
Results
.
errorStep
;
%% Summarize only good comparisons.
goodComparisons
=
comparisons
([
comparisons
.
isGoodComparison
]);
figureName
=
sprintf
(
'Summary of %d rendering comparisons'
,
...
numel
(
goodComparisons
));
set
(
fig
,
...
'Name'
,
figureName
,
...
'NumberTitle'
,
'off'
);
%% Sort the summary by size of error.
relNormDiff
=
[
goodComparisons
.
relNormDiff
];
errorStat
=
[
relNormDiff
.
max
];
[
~
,
order
]
=
sort
(
errorStat
);
goodComparisons
=
goodComparisons
(
order
);
%% Summary of correlation coefficients.
correlationTicks
=
correlationMin
:
correlationStep
:
1
;
correlationTickLabels
=
num2cell
(
correlationTicks
);
correlationTickLabels
{
1
}
=
'<='
;
correlation
=
[
goodComparisons
.
corrcoef
];
correlation
(
correlation
<
correlationMin
)
=
correlationMin
;
renderingsA
=
[
goodComparisons
.
renderingA
];
names
=
{
renderingsA
.
identifier
};
nLines
=
numel
(
names
);
ax
(
1
)
=
subplot
(
1
,
3
,
2
,
...
'Parent'
,
fig
,
...
'YTick'
,
1
:
nLines
,
...
'YTickLabel'
,
names
,
...
'YGrid'
,
'on'
,
...
'XLim'
,
[
correlationTicks
(
1
),
correlationTicks
(
end
)],
...
'XTick'
,
correlationTicks
,
...
'XTickLabel'
,
correlationTickLabels
);
line
(
correlation
,
1
:
nLines
,
...
'Parent'
,
ax
(
1
),
...
'LineStyle'
,
'none'
,
...
'Marker'
,
'o'
,
...
'Color'
,
[
0
0
1
])
title
(
ax
(
1
),
'correlation'
);
%% Summary of mean and max subpixel differences.
errorTicks
=
0
:
errorStep
:
errorMax
;
errorTickLabels
=
num2cell
(
errorTicks
);
errorTickLabels
{
end
}
=
'>='
;
relNormDiff
=
[
goodComparisons
.
relNormDiff
];
maxes
=
[
relNormDiff
.
max
];
means
=
[
relNormDiff
.
mean
];
maxes
(
maxes
>
errorMax
)
=
errorMax
;
means
(
means
>
errorMax
)
=
errorMax
;
ax
(
2
)
=
subplot
(
1
,
3
,
3
,
...
'Parent'
,
fig
,
...
'YTick'
,
1
:
nLines
,
...
'YTickLabel'
,
1
:
nLines
,
...
'YAxisLocation'
,
'right'
,
...
'YGrid'
,
'on'
,
...
'XLim'
,
[
errorTicks
(
1
),
errorTicks
(
end
)],
...
'XTick'
,
errorTicks
,
...
'XTickLabel'
,
errorTickLabels
);
line
(
maxes
,
1
:
nLines
,
...
'Parent'
,
ax
(
2
),
...
'LineStyle'
,
'none'
,
...
'Marker'
,
'+'
,
...
'Color'
,
[
1
0
0
])
line
(
means
,
1
:
nLines
,
...
'Parent'
,
ax
(
2
),
...
'LineStyle'
,
'none'
,
...
'Marker'
,
'o'
,
...
'Color'
,
[
0
0
0
])
legend
(
ax
(
2
),
'max'
,
'mean'
,
'Location'
,
'northeast'
);
title
(
ax
(
2
),
'relative diff'
);
%% Let the user scroll both axes at the same time.
scrollerData
.
axes
=
ax
;
scrollerData
.
nLinesAtATime
=
nRows
;
scroller
=
uicontrol
(
...
'Parent'
,
fig
,
...
'Units'
,
'normalized'
,
...
'Position'
,
[
.
95
0
.
05
1
],
...
'Callback'
,
@
scrollAxes
,
...
'Min'
,
1
,
...
'Max'
,
max
(
2
,
nLines
),
...
'Value'
,
nLines
,
...
'Style'
,
'slider'
,
...
'SliderStep'
,
[
1
2
],
...
'UserData'
,
scrollerData
);
scrollAxes
(
scroller
,
[]);
%% Scroll summary axes together.
function
scrollAxes
(
object
,
event
)
scrollerData
=
get
(
object
,
'UserData'
);
topLine
=
get
(
object
,
'Value'
);
yLimit
=
topLine
+
[
-
scrollerData
.
nLinesAtATime
1
];
set
(
scrollerData
.
axes
,
'YLim'
,
yLimit
);
This diff is collapsed.
Click to expand it.
Test/Interactive/rtbPlotRenderingComparison.m
+
2
−
1
View file @
8cad3132
...
...
@@ -39,7 +39,8 @@ name = sprintf('%s isScale %d toneMapFactor %.2f', ...
comparison
.
renderingA
.
identifier
,
...
isScale
,
...
toneMapFactor
);
set
(
fig
,
'Name'
,
name
,
...
set
(
fig
,
...
'Name'
,
name
,
...
'NumberTitle'
,
'off'
);
ax
=
subplot
(
2
,
2
,
2
,
'Parent'
,
fig
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment