ocr_simple.sh 747 B

12345678910111213141516171819202122
  1. # Usage sh ocr_simple.sh image.jpg
  2. # '${1}' passes image.jpg as an input
  3. # 'stdout' ensures that result is printed on terminal
  4. # If some other name is specified say output, tesseract
  5. # will write result in file named output.txt
  6. # '-l eng' for using the English language
  7. # '--oem 1' sets the OCR Engine Mode to LSTM only
  8. # '--psm 3' sets the Page Segmentation Mode (psm) to auto
  9. # There are four OCR Engine Mode (oem) available
  10. # 0 Legacy engine only.
  11. # 1 Neural nets LSTM engine only.
  12. # 2 Legacy + LSTM engines.
  13. # 3 Default, based on what is available.
  14. #
  15. # '--psm 3' sets the Page Segmentation Mode (psm) to auto.
  16. # Other important psm modes will be discussed in a future post.
  17. tesseract ${1} stdout -l eng --oem 1 --psm 3