Skip to main content

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 🚧 (unpublished)
  • data-driven segmentation (input file groups N=1, based on a statistical model, e.g. Neural Network)
    • ocrd-segment-via-model 🚧 (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.

Metadata

Release files for ocrd-segment 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocrd-segment 0.2.2
File Size Uploaded
ocrd_segment-0.2.2.tar.gz 55.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocrd-segment 0.2.2
File Interpreter ABI Platform
ocrd_segment-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 117.4 kB

Release files / ocrd_segment-0.2.2.tar.gz

Download URL ocrd_segment-0.2.2.tar.gz
Size 55.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7946db69dc838fb348851f799f45c2affd2b50af4cc62e149dfe9aadeec91ba9
BLAKE2b-256 checksum
How to use checksums
e7021dc9552d778fbe2eb848aec299bb2db75f92fc45382011611a39f22aac38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / ocrd_segment-0.2.2-py3-none-any.whl

Download URL ocrd_segment-0.2.2-py3-none-any.whl
Size 61.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cbbacad512e8f61b18b855c09e9471d3ebf4aed3666878c7cf7f36ce6a60004
BLAKE2b-256 checksum
How to use checksums
4e310817c53d5103632c5bacd792019ea8734ea08e1ca525682e3e308c2e3d4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.1.24

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page