Last active
March 5, 2016 21:40
-
-
Save catichenor/fc0d89e6cde4a1b20680 to your computer and use it in GitHub Desktop.
Compare two images and return whether or not they match
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
THRESHOLD="15000" # You'll need to do some testing to come up with this number. | |
# Requires ImageMagick, also using PNG format since JPEG adds too much noise | |
echo "`compare -metric RMSE clean_webcam_image.png corrupt_webcam_image.png NULL: 2>&1 | awk '{print $1}'` > ${THRESHOLD}" | bc # Returns 1 if the difference is greater than 15000, 0 otherwise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment