diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-12-11 19:48:52 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-12-11 19:49:59 +0000 |
commit | 58aee9864c193acfd03fa196af399d0659ba506d (patch) | |
tree | 070742819505c1974b866ec83ca96539491e7063 /scripts | |
parent | a3e4614c7fb0a6ffa8c748bf5d49b34612c9d6d4 (diff) |
retracediff: Prevent math domain error when comparing float images.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/retracediff.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/retracediff.py b/scripts/retracediff.py index e1958126..bb5aa7f5 100755 --- a/scripts/retracediff.py +++ b/scripts/retracediff.py @@ -350,6 +350,7 @@ def main(): height, width, channels = diffImage.shape square_error = numpy.sum(diffImage) + square_error += numpy.finfo(numpy.float32).eps rel_error = square_error / float(height*width*channels) bits = -math.log(rel_error)/math.log(2.0) precision = bits |