🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

ocrd-segment

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ocrd-segment

Page segmentation and segmentation evaluation in the OCR-D framework

pipPyPI
Version
0.2.2
Maintainers
2

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.

Keywords

ocr

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts