Skip to content

Instantly share code, notes, and snippets.

@AbeHandler
Last active August 29, 2015 14:08
Show Gist options
  • Save AbeHandler/fe4bf30d75eab36b52e3 to your computer and use it in GitHub Desktop.
Save AbeHandler/fe4bf30d75eab36b52e3 to your computer and use it in GitHub Desktop.
tesseract-er
#!/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