Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poor OCR detection, optimizations with 'jbig2' or 'pngquant' possible? #588

Open
Chavell3 opened this issue Feb 1, 2024 · 3 comments
Open

Comments

@Chavell3
Copy link

Chavell3 commented Feb 1, 2024

Hi,

I did uploaded an PDF to papermerge and searched for some text.
Curiously after the OCR finished, it couldn't find the following string "Edelberg" from the following text:

FoxitPDFReader_02012024_213038

Although that is from a original PDF document, it's not scanned or something like that, I was not able to find the text above.
So it can't be an issue of poor document quality.
Would it be possible to install and additionally scan with 'jbig2' or 'pngquant' to improve text recognition?

Thanks

@ciur
Copy link
Owner

ciur commented Feb 2, 2024

I don't understand your request. I've never heard of jbig2/pngquant. Could you please detail on jbig2/pngquant, specifically how can I enable them and why may that improve OCR output?

@Chavell3
Copy link
Author

Chavell3 commented Feb 2, 2024

Hi,

well within the worker node, when I manually started the scan process, I got the following message:

worker-1  | [2024-02-01 20:58:39,350: WARNING/ForkPoolWorker-2] [tesseract] lots of diacritics - possibly poor OCR
worker-1  | [2024-02-01 21:18:38,969: WARNING/ForkPoolWorker-2] The output file size is 10.71× larger than the input file.
worker-1  | Possible reasons for this include:
worker-1  | --force-ocr was issued, causing transcoding.
worker-1  | --deskew was issued, causing transcoding.
worker-1  | The optional dependency 'jbig2' was not found, so some image optimizations could not be attempted.
worker-1  | The optional dependency 'pngquant' was not found, so some image optimizations could not be attempted.
worker-1  | Plugins were used.

There is a documentation from OCRmyPDF which mentions both tools - https://buildmedia.readthedocs.org/media/pdf/ocrmypdf/latest/ocrmypdf.pdf -
Statement from OCRmyPDF document: "Optimization is improved when a JBIG2 encoder is available and when pngquant is installed. If either of these components are missing, then some types of images cannot be optimized."

@ciur
Copy link
Owner

ciur commented Feb 3, 2024

Thank you for references. I will investigate if those libs improve OCR quality. Not sure what to say else now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants