Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(diff): Fix issue when computing perceptual diff #4061

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/idiff/idiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ main(int argc, char* argv[])

int yee_failures = 0;
if (perceptual && !img0.deep()) {
ImageBufAlgo::CompareResults cr;
cr = {};
yee_failures = ImageBufAlgo::compare_Yee(img0, img1, cr);
}

Expand Down
20 changes: 15 additions & 5 deletions testsuite/diff/ref/out-fmt6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,23 @@ Computing perceptual diff of "img1.exr" vs "img1.exr"
PASS
Comparing "img1.exr" and "img2.exr"
64 x 64, 3 channels
Mean error = 0.0049235
RMS error = 0.049616
Peak SNR = 26.0876
Max error = 0.5 @ (5, 17, G) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
121 pixels (2.95%) over 0.008
Mean error = 0
RMS error = 0
Peak SNR = 0
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
0 pixels (0%) over 0.008
121 pixels (2.95%) over 0.004
121 pixels (2.9541%) failed the perceptual test
FAILURE
Comparing "img1.exr" and "img1.exr"
PASS
Comparing "img1.exr" and "img2.exr"
64 x 64, 3 channels
Mean error = 0
RMS error = 0
Peak SNR = 0
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
0 pixels (0%) over 0.008
121 pixels (2.95%) over 1.0
121 pixels (2.9541%) failed the perceptual test
FAILURE
20 changes: 15 additions & 5 deletions testsuite/diff/ref/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,23 @@ Computing perceptual diff of "img1.exr" vs "img1.exr"
PASS
Comparing "img1.exr" and "img2.exr"
64 x 64, 3 channels
Mean error = 0.0049235
RMS error = 0.049616
Peak SNR = 26.0876
Max error = 0.5 @ (5, 17, G) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
121 pixels (2.95%) over 0.008
Mean error = 0
RMS error = 0
Peak SNR = 0
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
0 pixels (0%) over 0.008
121 pixels (2.95%) over 0.004
121 pixels (2.9541%) failed the perceptual test
FAILURE
Comparing "img1.exr" and "img1.exr"
PASS
Comparing "img1.exr" and "img2.exr"
64 x 64, 3 channels
Mean error = 0
RMS error = 0
Peak SNR = 0
Max error = 1 @ (5, 17, R) values are 0.1, 0.1, 0.1 vs 0.1, 0.6, 0.1
0 pixels (0%) over 0.008
121 pixels (2.95%) over 1
121 pixels (2.9541%) failed the perceptual test
FAILURE
1 change: 1 addition & 0 deletions testsuite/diff/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
command += oiiotool("-pdiff img1.exr img1.exr")
command += diff_command("img1.exr", "img2.exr", extraargs="-p")
command += diff_command("img1.exr", "img1.exr", extraargs="-p")
command += diff_command("img1.exr", "img2.exr", extraargs="-p -fail 1")


# Outputs to check against references
Expand Down
Loading