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

"segment-line" produces "GeometryCollection" (which has no coords) #119

Closed
wrznr opened this issue Mar 5, 2020 · 2 comments · Fixed by #120
Closed

"segment-line" produces "GeometryCollection" (which has no coords) #119

wrznr opened this issue Mar 5, 2020 · 2 comments · Fixed by #120
Labels
bug Something isn't working

Comments

@wrznr
Copy link
Contributor

wrznr commented Mar 5, 2020

I receive the following error when running segment-line:

Traceback (most recent call last):
  File "/home/kmw/OCR-D/env/bin/ocrd-tesserocr-segment-line", line 8, in <module>
    sys.exit(ocrd_tesserocr_segment_line())
  File "/home/kmw/OCR-D/env/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/kmw/OCR-D/env/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/kmw/OCR-D/env/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/kmw/OCR-D/env/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/kmw/OCR-D/env/lib/python3.7/site-packages/ocrd_tesserocr/cli.py", line 26, in ocrd_tesserocr_segment_line
    return ocrd_cli_wrap_processor(TesserocrSegmentLine, *args, **kwargs)
  File "/home/kmw/OCR-D/env/lib/python3.7/site-packages/ocrd/decorators.py", line 54, in ocrd_cli_wrap_processor
    run_processor(processorClass, ocrd_tool, mets, workspace=workspace, **kwargs)
  File "/home/kmw/OCR-D/env/lib/python3.7/site-packages/ocrd/processor/base.py", line 57, in run_processor
    processor.process()
  File "/home/kmw/OCR-D/env/lib/python3.7/site-packages/ocrd_tesserocr/segment_line.py", line 115, in process
    line_polygon = line_poly.exterior.coords
AttributeError: 'GeometryCollection' object has no attribute 'exterior'

on the image
FILE_0024_ORIGINAL

@wrznr wrznr added the bug Something isn't working label Mar 5, 2020
@bertsky
Copy link
Collaborator

bertsky commented Mar 5, 2020

Are you sure this image is the one processed by segment-line? It should be a (binarized) region image. Maybe you want to run ocrd-segment-extract-regions on that (page of the) workspace...

@bertsky
Copy link
Collaborator

bertsky commented Mar 5, 2020

I could reproduce, but please try #120 yourself, there might be more cases.

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 a pull request may close this issue.

2 participants