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

Idea: Give option to force OCR #24

Closed
opal06 opened this issue Feb 8, 2021 · 4 comments
Closed

Idea: Give option to force OCR #24

opal06 opened this issue Feb 8, 2021 · 4 comments

Comments

@opal06
Copy link

opal06 commented Feb 8, 2021

I frequently encounter PDFs downloaded from sources like JSTOR that do already have an OCR layer embedded, but which is not actually accurate. Issues can be simply bad OCR (rare), but more often layers that are not exactly overlapping with the visible text. When highlighted, it looks fine in a reader, but when extracted via tools like ZotFile or trying to copy the text, the output is different from what it should be. In these cases I like to do a run of ocrmypdf with --force-ocr flag, which drops the existing layer and creates a new one, which tends to be way more accurate. I tried to do the same thing with zotero-ocr, but it does not seem to process PDFs with existing OCR layers. This seems an efficient way to handle this, but it would be nice to have an option to enable a forcing mode, which creates a entirely new layer.

Greetings from Freiburg!

@zuphilip
Copy link
Member

zuphilip commented Feb 9, 2021

Actually, the plugin is currently processing every PDF regardless of whether it contains only images or also a text layer. Try it out yourself.

However, I would like to add an option, that PDFs with some text can be skipped (filtered out) for OCR processing. I imagine to do this as an option which can be check or not, but that is still a todo mentioned somewhere in the code.

BTW the plugin here does not use ocrmypdf.

@opal06
Copy link
Author

opal06 commented Feb 10, 2021

Thank you very much for your response.

Actually, the plugin is currently processing every PDF regardless of whether it contains only images or also a text layer. Try it out yourself.

This is true, totally my error as I didn't realise I had changed my language settings to German but was trying to process an english text.

However, I would like to add an option, that PDFs with some text can be skipped (filtered out) for OCR processing. I imagine to do this as an option which can be check or not, but that is still a todo mentioned somewhere in the code.
This seems very interesting, would really like to see it.

As I was wrong though, I will close this issue as it actually is a non-issue. Thank you for your time and the response!

@opal06 opal06 closed this as completed Feb 10, 2021
@zuphilip
Copy link
Member

@opal06 For languages with Latin letters as English, German, etc. you can also try out script/Latin which usually works quite nice. Moreover, this then overcomes the potential issues that also in a German text you find French, Spanish, ... words e.g. for names.

@opal06
Copy link
Author

opal06 commented Feb 10, 2021

This is very useful information, thank you very much. I was trying to find out if there was multi language support just earlier today.

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

No branches or pull requests

2 participants