-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Non-linear grayscale normalization for layout analyse and/or text recognition #3857
Draft
JKamlah
wants to merge
8
commits into
tesseract-ocr:main
Choose a base branch
from
JKamlah:nlbin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ea5c9b7
Add: Non-linear grayscale normalization as preprocessing based on nlb…
JKamlah 37462ac
Add three normalization modi: Only for thresholding, only for recogni…
JKamlah a09b6b4
Reformat code.
JKamlah 6dfb216
Add preprocessing parameter for grayscale normalization (preprocess_g…
JKamlah 18517a5
Fix write preprocess image with tessedit_write_images.
JKamlah c049002
Fix error warning text, delete empty lines and old parameter config.
JKamlah 5ebbb07
Merge branch 'tesseract-ocr:main' into nlbin
JKamlah 5fb2b62
Merge branch 'tesseract-ocr:main' into nlbin
JKamlah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some considerations regarding where this should be placed in the code base:
NormalizeImage
called inProcessPages
instead of merely modifying the thresholder prevents applying this on any PSM other than full pages. And on the API, you would need to addNormalizeImage
to the calling code instead of merely setting the configuration parameter.SetupForRecognition
→BestPix
) does not always usepix_original_
: afterSetRectangle()
, it usespix_grey_
or evenpix_binary_
.pix_binary_
, butLineFinder
also tries to usepix_grey_
andpix_thresholds_
.pix_
(i.e. the thresholder'sSetImage
), and that might not work on the output of Leptonica because the metadata might be lost. We still have fallback DPI estimation (which is based on the CC statistics frompix_binary_
), but that might not be as accurate.