3 ms·
I was using something like this for awhile, but I found tesseract did poorly quite often. That resize trick didn't seem to affect much. I'm not sure what pre-pr
by dsp_person 3y ago
I was using something like this for awhile, but I found tesseract did poorly quite often. That resize trick didn't seem to affect much. I'm not sure what pre-processing would make it better.
I'd love to if TextSnatcher does anything to improve on this. The github page is opaque.
- mappu 3y agoThe source is pretty straightforward - it's calling `scrot -s -o` to a temp file, and then `tessaract` with no further preprocessing. https://github.com/RajSolai/TextSnatcher/blob/master/src/services/TesseractTrigger.vala#L61 https://github.com/RajSolai/TextSnatcher/blob/master/src/ser...
- stevesimmons 3y ago> I found tesseract did poorly quite often The script calls Tesseract in default page segmentation mode (PSM 3). [1] Depending on the input text, PSM mode 11 for disconnected text would probably work much better. That uses the flag "--psm 11". [1] From the original repo: string tess_command = "tesseract " + file_path + " " + out_path + @" -l $lang" ;
- aidenn0 3y agoHaving used Tesseract for OCR for other things, getting the right PSM helps but it's still rather terrible, especially for sans-serif fonts, which are common in UIs. Granted there's a lot of ambiguity in sans serif fonts, lower-case "L", vertical bar, and upper-case "i" can even be pixel-identical, but I've seen tesseract turn Chapter III into Chapter |l1 which really surprises me. In fact, for books, I run it through sed to replace vertical bar with upper-case "i" and it significantly improved recognition.