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

more robust intersection with parent #152

Merged
merged 7 commits into from
Sep 15, 2020

Conversation

bertsky
Copy link
Collaborator

@bertsky bertsky commented Sep 13, 2020

Fix #151

- cover zero area intersections
  (treating them like empty)
- cover heterogeneous intersections
  (removing zero area shapes)
@codecov
Copy link

codecov bot commented Sep 13, 2020

Codecov Report

Merging #152 into master will decrease coverage by 0.07%.
The diff coverage is 32.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #152      +/-   ##
==========================================
- Coverage   37.64%   37.57%   -0.08%     
==========================================
  Files           9        9              
  Lines        1004     1022      +18     
  Branches      214      215       +1     
==========================================
+ Hits          378      384       +6     
- Misses        558      566       +8     
- Partials       68       72       +4     
Impacted Files Coverage Δ
ocrd_tesserocr/binarize.py 23.33% <0.00%> (+0.38%) ⬆️
ocrd_tesserocr/crop.py 13.63% <0.00%> (+0.12%) ⬆️
ocrd_tesserocr/deskew.py 17.52% <0.00%> (+0.17%) ⬆️
ocrd_tesserocr/segment_table.py 0.00% <0.00%> (ø)
ocrd_tesserocr/segment_region.py 49.14% <22.72%> (-3.09%) ⬇️
ocrd_tesserocr/recognize.py 46.89% <33.33%> (-0.87%) ⬇️
ocrd_tesserocr/segment_line.py 72.30% <50.00%> (+8.67%) ⬆️
ocrd_tesserocr/segment_word.py 72.72% <55.55%> (-3.94%) ⬇️

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 5761661...40008e4. Read the comment docs.

@bertsky
Copy link
Collaborator Author

bertsky commented Sep 14, 2020

Fix #149

@stweil
Copy link
Contributor

stweil commented Sep 14, 2020

A test with the first commit and urn:nbn:de:bsz:180-digad-35210 passed without failures.

- cover invalid paths on input side
  (from rounding; via repeated simplification)
- cover invalid path on output side
  (from rounding; via repeated simplification)
(re-use function from segment-region)
@bertsky bertsky force-pushed the fix-polygon-for-parent-again branch from 6aa44c5 to c7bc33b Compare September 14, 2020 08:51
- cover invalid paths which cannot be repaired
  through simplification directly
  (find a new starting point in the point sequence)
Copy link
Contributor

@stweil stweil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test case now passes (mostly, see #153). Therefore I suggest to merge this.

@stweil
Copy link
Contributor

stweil commented Sep 14, 2020

@kba (or whoever has merge rights), can this PR be merged? I'd like to have a working ocrd_all again, and this seems to be one required component.

@bertsky
Copy link
Collaborator Author

bertsky commented Sep 14, 2020

@kba (or whoever has merge rights), can this PR be merged? I'd like to have a working ocrd_all again, and this seems to be one required component.

#153 is really the same thing for the other processors, so we should first incorporate the same logic there. It will be more consistent here (with 0.9.3 to fix all currently known segmentation bugs), but also in ocrd_all (all affected modules joining in one commit, no extra delay for deploying the next patch wave).

Copy link
Member

@kba kba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bertsky you have the best overview on how the PR work together, merge at will :)

Copy link
Contributor

@stweil stweil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge.

@bertsky bertsky merged commit f54b866 into OCR-D:master Sep 15, 2020
@bertsky bertsky deleted the fix-polygon-for-parent-again branch September 15, 2020 07:32
@bertsky bertsky restored the fix-polygon-for-parent-again branch September 15, 2020 07:32
@bertsky bertsky deleted the fix-polygon-for-parent-again 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ocrd-tesserocr-segment-region fails with AttributeError: 'LineString' object has no attribute 'exterior'
3 participants