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

fix deskewing #80

Closed
wants to merge 4 commits into from
Closed

fix deskewing #80

wants to merge 4 commits into from

Conversation

bertsky
Copy link
Collaborator

@bertsky bertsky commented Oct 15, 2019

depends on (and abides by) the new image API from OCR-D/core#327

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
- use transposition/reflection for multiples of 90°
- use rotation and transposition from core
- 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
- expose confidence threshold for OSD orientation as parameter
  (min_orientation_confidence) and lower from 10 to 1.5
@bertsky bertsky added the bug Something isn't working label Oct 15, 2019
@bertsky bertsky requested review from kba and wrznr October 15, 2019 19:30
- segment-region/line/word: instead of offset calculations,
  convert relative to absolute coordinates via core's
  coordinates_for_segment
- segment-region: do not create image data anymore when using
  crop_polygons (i.e. only get polygons instead of bboxes)
@bertsky
Copy link
Collaborator Author

bertsky commented Oct 18, 2019

Tests fail because OCR-D/core#311 and OCR-D/core#327 are not merged yet.

@bertsky
Copy link
Collaborator Author

bertsky commented Oct 26, 2019

I relaxed the requirements – tesserocr==2.5.0 has not been published yet. What we really need is core, though.

@codecov
Copy link

codecov bot commented Oct 26, 2019

Codecov Report

Merging #80 into master will increase coverage by 23.87%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #80       +/-   ##
===========================================
+ Coverage   22.65%   46.53%   +23.87%     
===========================================
  Files           8        8               
  Lines         715      692       -23     
  Branches      134      129        -5     
===========================================
+ Hits          162      322      +160     
+ Misses        545      338      -207     
- Partials        8       32       +24
Impacted Files Coverage Δ
ocrd_tesserocr/segment_line.py 80% <100%> (+54.5%) ⬆️
ocrd_tesserocr/segment_word.py 80.76% <100%> (+56.24%) ⬆️
ocrd_tesserocr/deskew.py 17.34% <5.26%> (+1.5%) ⬆️
ocrd_tesserocr/segment_region.py 75.22% <80%> (+26.41%) ⬆️
ocrd_tesserocr/recognize.py 52.5% <0%> (+41.5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b935c7...b9d1fa6. Read the comment docs.

@bertsky
Copy link
Collaborator Author

bertsky commented Oct 26, 2019

@kba you can release on PyPI now I think. As for merging... maybe in a (short-lived) extra branch here, too?

@kba
Copy link
Member

kba commented Oct 26, 2019

Thanks!

maybe in a (short-lived) extra branch here, too?

Yeah, I had an edge branch prepared but apparently forgot to push it... Will do now.

@kba
Copy link
Member

kba commented Oct 26, 2019

Released as https://pypi.org/project/ocrd-tesserocr/0.5.0/, keeping changes in https://github.com/OCR-D/ocrd_tesserocr/tree/edge as long as ocrd 2.0.0 is pre-release.

#83 supersedes this.

@kba kba closed this Oct 26, 2019
@bertsky bertsky mentioned this pull request Oct 29, 2019
@bertsky bertsky deleted the new-rotation-api branch October 2, 2020 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants