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.

CircleCI image Docker Automated build

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)
    • ocrd-segment-replace-text (insert text below page from single-segment text files; "inverse" of extract-*)
  • 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.

Development

Prerequisities

Requires libgeos-dev library for building shapely binary requirement, see Shapely Installation from source. Please ensure it's available before trying to install local requirements.

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.24.tar.gz (56.3 kB view details)

Uploaded Source

Built Distribution

ocrd_segment-0.1.24-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file ocrd_segment-0.1.24.tar.gz.

File metadata

  • Download URL: ocrd_segment-0.1.24.tar.gz
  • Upload date:
  • Size: 56.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17+

File hashes

Hashes for ocrd_segment-0.1.24.tar.gz
Algorithm Hash digest
SHA256 3de0a3d56f652044557d7de5272572f44cb16b183e55cf9c6e1be63fcd66ee2e
MD5 ea25a846502e5ce473833feaf5b982d4
BLAKE2b-256 4b01bd598397db82e075a9fcc7591d098160d1facfb3c7be55d7cfeea46e3392

See more details on using hashes here.

File details

Details for the file ocrd_segment-0.1.24-py3-none-any.whl.

File metadata

File hashes

Hashes for ocrd_segment-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 28fa5428c47761c8c602cd949859675afc007f095fc595cf6cf6f0f17d270b5d
MD5 8b20674715e28d6caa051a351f1212c9
BLAKE2b-256 66622e7bb113ff69bfeaf4525a90e393b5bcebdf86fadc74b7c498cde69a23fd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page