Skip to main content

Page segmentation and segmentation evaluation

Project description

ocrd_segment

This repository aims to provide a number of OCR-D compliant processors for layout analysis and evaluation.

image

Installation

In your Python virtual environment, run:

pip install ocrd_segment

Usage

Contains processors for various tasks:

  • exporting segment images (including results from preprocessing like cropping/masking, deskewing, dewarping or binarization) along with polygon coordinates and metadata:
  • importing layout segmentations from other formats:
  • post-processing or repairing layout segmentations:
    • ocrd-segment-repair (validity and consistency of all coordinates; also, for regions, reduce overlaps/redundancy between neighbours, and/or simplify polygons, and/or shrink to the alpha shape of foreground contours)
    • ocrd-segment-project (remake segment coordinates into the concave hull / alpha shape of their constituents)
    • ocrd-segment-replace-original (rebase all segments on cropped+deskewed border frame as new full page)
    • ocrd-segment-replace-page (2 input fileGrps; overwrite segmentation below page of first fileGrp by all segments of second fileGrp, rebasing all coordinates; "inverse" of replace-original)
  • comparing different layout segmentations:
  • pattern-based segmentation (input file groups N=1, based on a PAGE template, e.g. from Aletheia, and some XSLT or Python to apply it to the input file group)
    • ocrd-segment-via-template :construction: (unpublished)
  • data-driven segmentation (input file groups N=1, based on a statistical model, e.g. Neural Network)
    • ocrd-segment-via-model :construction: (unpublished)

For detailed behaviour, see --help on each processor CLI. For detailed description on input/output and parameters, see ocrd-tool.json or --dump-json on each processor CLI.

Testing

None yet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocrd_segment-0.1.21.tar.gz (47.3 kB view hashes)

Uploaded source

Built Distribution

ocrd_segment-0.1.21-py3-none-any.whl (61.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page