tleyden / open-ocr

Run your own OCR-as-a-Service using Tesseract and Docker
Apache License 2.0
1.33k stars 223 forks source link

hOCR output? #38

Closed jbarlow83 closed 9 years ago

jbarlow83 commented 9 years ago

Is there a way to use the REST API to request hOCR output from Tesseract via open-ocr?

Using standalone tesseract a command to do with could be: tesseract -l eng inputfile.png output hocr tess.cfg

jbarlow83 commented 9 years ago

Found the answer:

curl -X POST -H "Content-Type: application/json" -d \
'{"img_url":"http://bit.ly/ocrimage","engine":"tesseract","engine_args":{"config_vars":{"tessedit_create_hocr":"1"}}}' \
http://$IPADDR:$PORT/ocr```
tleyden commented 9 years ago

Thanks for posting the solution!