Live data from Hacker News

Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

github.com

51–60 of 62 posts

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#51
post #42

I'm surprised that seemingly there are no other major FOSS OCRs than Tesseract and Tesseract is quite frankly horrible. I once tried to use it on a high-resolution screenshot of a Discord message containing only the characters "0" and "1". I cropped it to only have the text, restricted character sets, tried fiddling with the images contrast and what not and the result was still quite poor, with many characters mistak…

> I once tried to use it on a high-resolution screenshot of a Discord message containing only the characters "0" and "1". I cropped it to only have the text, restricted character sets, tried fiddling with the images contrast and what not and the result was still quite poor, with many characters mistaken or straight up ignored.

I had the opposite experience.

My partner was doing a project for the Army Core of Engineers and they only provided information via some system called ProjNet that, best I can tell, exported PDFs of Web Pages in pure vector format so they were unsearchable. Of course they needed to search 10000 pages of documents to answer questions for the ACoE.

I was able to feed the PDFs into Tesseract and produce 1:1 text document per page of PDF and then marry it back up to the PDF so they could search the PDFs. It worked astonishingly well and took about a half an hour using the cringiest of shell scripts.

I did something similar with SDGE's published rate tables to convert their screenshots of XLS files back into tablur data. It didn't work as well but still got the job done.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#52
post #8
post #5

Can I do OCR all-in-browser with this, without involving any backend? Not much familiar with OCR accuracy metrics, how much accurate is Tesseract?

> Can I do OCR all-in-browser with this Literally third sentence of the description: > It works in the browser using webpack or plain script tags with a CDN and on the server with Node.js.

To be honest it is a confusing sentence. If it requires node js server then the answer should be no. Also, its confusing to me why it requires nodejs server ...

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#53
post #49

Earlier quoted context omitted.

Wait, how so? WASM isn't an interface or a wrapper, it's a language/format. Having trouble understanding what you mean by this, unless you're arguing that the WASM VM itself is the FFI?

It is FFI from JavaScript point of view, a way to call multiple native languages from JavaScript, requires import and export definitions, a wasm file is no different than a .o, .a, .obj, .lib, other than not using instructions of a real CPU on the market.

I can sort of see this, in the sense that the style of code I'm writing when I use WASM is similar to the style of code when calling into an FFI.

I think the implications of that code are different, but yeah, I see your point and I think it's fairly reasonable.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#54
Related:

Tesseract.js – A Javascript port of the Tesseract OCR engine - https://news.ycombinator.com/item?id=28105850 - Aug 2021 (37 comments)

Tesseract OCR - https://news.ycombinator.com/item?id=27876383 - July 2021 (65 comments)

Tesseract Teaser - https://news.ycombinator.com/item?id=26400168 - March 2021 (7 comments)

Tesseract.js: Pure JavaScript OCR for 100 Languages - https://news.ycombinator.com/item?id=21843713 - Dec 2019 (77 comments)

A guide to OCR with Tesseract, OpenCV and Python - https://news.ycombinator.com/item?id=21843342 - Dec 2019 (12 comments)

Using Tesseract OCR with Python - https://news.ycombinator.com/item?id=14741124 - July 2017 (47 comments)

Show HN: Tesseract.js – Pure JavaScript OCR for 60 Languages - https://news.ycombinator.com/item?id=12694004 - Oct 2016 (97 comments)

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#56
post #42

I'm surprised that seemingly there are no other major FOSS OCRs than Tesseract and Tesseract is quite frankly horrible. I once tried to use it on a high-resolution screenshot of a Discord message containing only the characters "0" and "1". I cropped it to only have the text, restricted character sets, tried fiddling with the images contrast and what not and the result was still quite poor, with many characters mistak…

It's amazing to me that there's so little in the OSS world about handwriting recognition. From an OCR perspective, I understand it's much harder than printed text, but there's not really anything for "online" handwriting recognition either (written on a screen/vectorized strokes). From my understanding online recognition should be easier than scanning printed text, and yet there aren't any tools out there that I can find.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#57
post #42

I'm surprised that seemingly there are no other major FOSS OCRs than Tesseract and Tesseract is quite frankly horrible. I once tried to use it on a high-resolution screenshot of a Discord message containing only the characters "0" and "1". I cropped it to only have the text, restricted character sets, tried fiddling with the images contrast and what not and the result was still quite poor, with many characters mistak…

I've had good results with EasyOCR, much better than Tesseract. I agree with you, Tesseract has performed very poorly in my experience.

https://github.com/JaidedAI/EasyOCR

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#58

I tried to use Tesseract for a personal hobby project and found it very lacking. The OCR was not very accurate. I ended up switching to Azure Vision services which gives you 500 free OCR API calls a day (or some similar limit). This was perfect for my needs.

Sadly one of small hobby is to convert my own movies (Blu-Ray) into a digital file for my home server, and the subtitles are all image-based. The app I use (SubtitleEdit) relies on Tesseract for conversion, but it's far from perfect. :(

Sure, I could use someone else's subtitle file from the Internet, but that's not as fun than doing it yourself.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#59
post #5

Can I do OCR all-in-browser with this, without involving any backend? Not much familiar with OCR accuracy metrics, how much accurate is Tesseract?

Yes, but Tesseract is very inaccurate. Think "early 2000s speech recognition" accuracy.

Re: Tesseract.js wraps an Emscripten port of the Tesseract OCR Engine

#60
post #30

Earlier quoted context omitted.

In my experience "pure JS" is normally used to differentiate projects from those using NodeJS FFI - the important part is the target / executing runtime (which would be the JS runtime for WASM), rather than the project source. For my own purposes, the priority for me when reading "pure" is that the core runtime I'm using (the JS runtime) is the only runtime dependency - I'm not depending on external binaries and exec…

WASM is a form of FFI.

This is actually a decent way of framing it.

> A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written in another.

https://en.m.wikipedia.org/wiki/Foreign_function_interface

Post reply on HN