-
Notifications
You must be signed in to change notification settings - Fork 12
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
many more Ocropy improvements #17
Conversation
- common.remove_noise: in addition to ocrolib.common.remove_noise on the binary image (which removes small foreground components), run on the inverted image (removing small "background components", i.e. white specks in letters) - denoise: increase default maxsize, and re-parameterize to unit pt (points), making it independent of image resolution
- when cropping a clipped segment image from its parent image, do not use the segment's width and height in absolute coordinates (with merely the offset in relative coordinates), but instead determine the segment's bounding box only in relative coordinates - after cropping, if the segment has an orientation angle, then rotate the segment image accordingly (but subtract any higher level angle already present) (Both fixes are required to meet the expectations of the core image API; otherwise relative coordinates cannot be calculated correctly for the generated images.)
- when an AlternativeImage already exists for a TextLine and hence its coordinates must be compared to the region segmentation on the line level instead of the region level, by cropping region labels to the same bounding box, do not use the line's width and height in absolute coordinates (with merely the offset in relative coordinates), but instead determine the line's bounding box only in relative coordinates - when creating a mask array from a polygon, ensure to also fill the outline (not just the interior) - when thresholding the size of a contour's parts, re-use and respect the existing threshold parameter
- filter deskewed images only on the level of operation - respect angle already applied on parent level by * rotating from that actual to the annotated target angle * annotating the sum of both in the result - do not propagate image features deskewed and rotated-X
@finkf I updated the requirement to Do you want me to release it on PyPI as well? (I don't see any versions there yet, also for the old package name. PyPI deployment is a requirement for many kinds of use cases / users...) |
I will do that now, as v0.0.5. Happy to turn the package over to you and support you if you're unfamiliar with pypi. |
@finkf same offer from me. Also: I can help you rework the rest of the repo to get ready for core 1.0 / 2.0, and end up with a good Regarding core, I have seen a significant change for post-correction after And in case you do not already know: ocrd 1.0 was a bit premature, because the much needed image API fixes (which have already been around for a while) already break it. So we introduced a new branch |
Yes, help would be appreciated. I think, that I will merge this and add my changes to devel as well. As to the TextEquiv.conf I think that non of our post-correction python code touches the confidence value, so we should be good. |
Ok, let me know when I should take a look.
Are you quite sure? It seems you are using word confidences the same way I was using glyph confidences. That line is going to fail after conf = min([float(te0(x).conf or "1.") for x in word.region]) |
Yeah. You are right. I will fix this (after the merge). So I will merge this now, and fix TextEquiv.conf afterwards. OK? |
Whatever suits you better. (The PR adds the |
Yes. I guess you are right |
This pull request introduces 2 alerts and fixes 1 when merging 590c2f2 into a0dd028 - view on LGTM.com new alerts:
fixed alerts:
|
Note: this depends on OCR-D/core#311 and OCR-D/core#327 (which is already in core:edge but not merged to master and not released yet – except via ocrd/core:edge on Dockerhub). So merging probably does not make sense yet.