compare two folders with images visually and output mean squared error for each pair
| #!/bin/bash | |
| # Usage: | |
| # ./compare.sh folder1 folder2 | grep -v '^[0-9]\.[0-9]\+e-' | grep -v '^0 ' | sort --numeric-sort --reverse | |
| # filters out images with significant differences and sorts them by mean squared error | |
| cd "$1" | |
| for file in $(find * -type f); do | |
| # http://www.imagemagick.org/Usage/compare/ | |
| NORMALIZED_DIFFERENCE=$(compare -metric MSE "$file" ../"$2"/"$file" null: 2>&1 | cut -d '(' -f 2 | cut -d ')' -f 1) | |
| echo "$NORMALIZED_DIFFERENCE" "$file" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment