Search code examples
command-line-interfacetesseract

Tesseract CLI hocr and tessdata-dir options not working together


I'm getting an error when trying to run this command

tesseract orig.jpg stdout --tessdata-dir dev/ -oem 4 hocr
read_params_file: Can't open hocr

However the following two examples work fine

  1. Without tessdata-dir

    tesseract orig.jpg stdout -oem 4 hocr

  2. Without hocr

    tesseract orig.jpg stdout --tessdata-dir dev/ -oem 4

I tried putting options in different orders, it doesn't help. I'm using tesseract 4.00.00alpha on Mac


Solution

  • I had to specify a full path to hocr config to make it work

    tesseract orig.jpg stdout --tessdata-dir dev/ -oem 4 dev/tessdata/configs/hocr