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

preprocessing: various fixes and improvements #16

Merged
merged 5 commits into from
Sep 24, 2019
Merged

Conversation

bertsky
Copy link
Collaborator

@bertsky bertsky commented Sep 24, 2019

Please don't squash, just (rebase and) merge – thanks!

do not always fill with white; instead, determine the
background color by median, and only use white for
binary images; moreover, add a transparency channel
if the input mode allows it
- clip/denoise/deskew/dewarp/resegment: try to split given
  output file grp into PAGE and image result
- use fixed OCR-D-IMG-* only as fallback
- parse the parameter member only when in appropriate contexts
  (because Processor.__init__ does not initialize this when
   -J or --help is requested)
- clip/deskew: put mask into the alpha channel,
  create one if not already existing
- deskew: do not rotate the page image when deskewing
  on the region level (but ignore page-level orientation;
  region-level orientation is not additive but alternative)
- common.pil2array/ocrolib.common.pil2array:
  handle extra layers correctly (only average over RGB channels)
  `alpha=1` – not used currently (since most functions already
   use segment masks anyway)
- ocrolib.common.array2pil: allow passing alpha channels into
  greyscale (LA) and colour (RGBA) images
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

Successfully merging this pull request may close these issues.

2 participants