Re:Tesseract.js: Pure JavaScript OCR for 100 Languages
by dstroot on Friday December 20, 2019 @10:47AM
(#21844974)
Can you share more information about how you created an HTTP endpoint? Or code? Glancing at the docs I only saw a command line or C bindings.
[ Parent
| on HN ]
Re:Tesseract.js: Pure JavaScript OCR for 100 Languages
by crazygringo on Friday December 20, 2019 @11:27AM
(#21845276)
Oh sure, on my webserver I just wrote the POSTed image to a temp file, called the command-line utility itself from within my code, and captured the stdout to return back. The command-line utility initializes very quickly so the performance was fine.
The only semi-tricky bits were parsing stderr if anything went wrong (distinguish warnings from actual errors), and the fact that Tesseract doesn't respect the JPEG orientation bit (big problem with iPhone camera images), so checking that and manually rotating the JPEG first if necessary (gibberish otherwise).