Skip to content

Commit 4e9e70f

Browse files
authored
fix(IBA): IBA::compare_Yee() accessed the wrong channel (#4976)
The GaussianPyramid::value() method used by IBA::compare_Yee() was incorrectly accessing channel 1 instead of channel 0. This fix corrects the channel access to properly retrieve the luminance value from the single-channel pyramid levels. One oddity this led to is that `idiff -p` would appear to PASS for some clearly different images if they had different data windows. Update reference outputs to reflect the corrected perceptual diff results (Max error changes from 1 to 10 for the test images). Fixes #4948 Signed-off-by: pmady <[email protected]>
1 parent f5022d7 commit 4e9e70f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/libOpenImageIO/imagebufalgo_yee.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class GaussianPyramid {
5252
if (lev >= PYRAMID_MAX_LEVELS)
5353
return 0.0f;
5454
else
55-
return level[lev].getchannel(x, y, 0, 1);
55+
return level[lev].getchannel(x, y, 0, 0);
5656
}
5757

5858
#if 0 /* unused */
@@ -65,7 +65,7 @@ class GaussianPyramid {
6565
float operator()(int x, int y, int lev) const
6666
{
6767
OIIO_DASSERT(lev < PYRAMID_MAX_LEVELS);
68-
return level[lev].getchannel(x, y, 0, 1);
68+
return level[lev].getchannel(x, y, 0, 0);
6969
}
7070
#endif
7171

testsuite/diff/ref/out-fmt6.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Computing diff of "img1.exr" vs "img2.exr"
1616
121 pixels (2.95%) over 1e-06
1717
FAILURE
1818
Computing perceptual diff of "img1.exr" vs "img2.exr"
19-
Max error = 1.0 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
19+
Max error = 10.0 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
2020
121 pixels (2.95%) failed the perceptual test
2121
FAILURE
2222
Computing perceptual diff of "img1.exr" vs "img1.exr"
@@ -26,7 +26,7 @@ Comparing "img1.exr" and "img2.exr"
2626
Mean error = 0
2727
RMS error = 0
2828
Peak SNR = 0
29-
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
29+
Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
3030
0 pixels (0%) over 0.008
3131
121 pixels (2.95%) over 0.004
3232
121 pixels (2.9541%) failed the perceptual test
@@ -38,7 +38,7 @@ Comparing "img1.exr" and "img2.exr"
3838
Mean error = 0
3939
RMS error = 0
4040
Peak SNR = 0
41-
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
41+
Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
4242
0 pixels (0%) over 0.008
4343
121 pixels (2.95%) over 1.0
4444
121 pixels (2.9541%) failed the perceptual test

testsuite/diff/ref/out.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Computing diff of "img1.exr" vs "img2.exr"
1616
121 pixels (2.95%) over 1e-06
1717
FAILURE
1818
Computing perceptual diff of "img1.exr" vs "img2.exr"
19-
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
19+
Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
2020
121 pixels (2.95%) failed the perceptual test
2121
FAILURE
2222
Computing perceptual diff of "img1.exr" vs "img1.exr"
@@ -26,7 +26,7 @@ Comparing "img1.exr" and "img2.exr"
2626
Mean error = 0
2727
RMS error = 0
2828
Peak SNR = 0
29-
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
29+
Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
3030
0 pixels (0%) over 0.008
3131
121 pixels (2.95%) over 0.004
3232
121 pixels (2.9541%) failed the perceptual test
@@ -38,7 +38,7 @@ Comparing "img1.exr" and "img2.exr"
3838
Mean error = 0
3939
RMS error = 0
4040
Peak SNR = 0
41-
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
41+
Max error = 10 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
4242
0 pixels (0%) over 0.008
4343
121 pixels (2.95%) over 1
4444
121 pixels (2.9541%) failed the perceptual test

0 commit comments

Comments
 (0)