Last active
August 29, 2015 14:08
-
-
Save AbeHandler/fe4bf30d75eab36b52e3 to your computer and use it in GitHub Desktop.
tesseract-er
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 | |
docsplit images "$1" | |
base=$(basename $1 .pdf) | |
IMAGES="$base"*png | |
for i in $IMAGES | |
do | |
FOUND=$(tesseract "$i" out -psm 0 |& grep -ci 'Orientation in degrees: [^0]') | |
if (("$FOUND" == "1")) | |
then | |
mv "$i" examples | |
else | |
rm "$i" | |
fi | |
echo "$1"','"$FOUND"','"$i" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment