diff options
author | José Fonseca <jfonseca@vmware.com> | 2013-09-16 14:59:33 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2013-09-16 14:59:33 +0100 |
commit | a0708b02018902497da4df6c9be05cd053374afc (patch) | |
tree | 90e918f0ecaf5b8aa80c9a810a8a3fc598b7c242 /scripts | |
parent | a06b851d9e29f51bd194ac15d50abc302ac27cd0 (diff) |
retracediff: Dump mismtached float images to stdout.
Should have an option in the future, as it will be too verbose in general.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/retracediff.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/retracediff.py b/scripts/retracediff.py index 71e9f064..18a97f63 100755 --- a/scripts/retracediff.py +++ b/scripts/retracediff.py @@ -179,6 +179,17 @@ def read_pnm(stream): return image, comment +def dumpNumpyImage(output, pixels): + height, width, channels = pixels.shape + for y in range(height): + output.write(' ') + for x in range(width): + for c in range(channels): + output.write('%0.9g,' % pixels[y, x, c]) + output.write(' ') + output.write('\n') + + def parse_env(optparser, entries): '''Translate a list of NAME=VALUE entries into an environment dictionary.''' @@ -328,6 +339,10 @@ def main(): highligher.normal() if mismatch: + if numpyImages: + dumpNumpyImage(output, refImage) + output.write("->\n") + dumpNumpyImage(output, srcImage) if options.diff_prefix and not numpyImages: prefix = os.path.join(options.diff_prefix, '%010u' % callNo) prefix_dir = os.path.dirname(prefix) |