From 00f80bd4d5b00d7ecfcfc55c31a301bb3a329a22 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Sat, 12 Mar 2022 01:53:38 +0100 Subject: [PATCH] :package: 0.1.17 --- CHANGELOG.md | 6 ++++++ README.md | 2 +- ocrd_segment/ocrd-tool.json | 2 +- ocrd_segment/repair.py | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5e013d..3d18ab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ Versioned according to [Semantic Versioning](http://semver.org/). ## Unreleased +## [0.1.17] - 2022-03-12 + +Changed: + + * project: use true alpha shape instead of convex hull + ## [0.1.16] - 2022-02-21 Fixed: diff --git a/README.md b/README.md index 0730f30..d224f30 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Contains processors for various tasks: - [ocrd-segment-from-coco](ocrd_segment/import_coco_segmentation.py) (for [MS-COCO](https://cocodataset.org/) annotation) - post-processing or repairing layout segmentations: - [ocrd-segment-repair](ocrd_segment/repair.py) (validity and consistency of coordinates, reducing overlaps/redundancy between neighbours, shrinking regions to the alpha shape of their lines) - - [ocrd-segment-project](ocrd_segment/project.py) (remake segment coordinates into the convex hull of their constituents) + - [ocrd-segment-project](ocrd_segment/project.py) (remake segment coordinates into the concave hull / alpha shape of their constituents) - [ocrd-segment-replace-original](ocrd_segment/replace_original.py) (rebase all segments on cropped+deskewed border frame as new full page) - [ocrd-segment-replace-page](ocrd_segment/replace_page.py) (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: diff --git a/ocrd_segment/ocrd-tool.json b/ocrd_segment/ocrd-tool.json index cef330c..81352c4 100644 --- a/ocrd_segment/ocrd-tool.json +++ b/ocrd_segment/ocrd-tool.json @@ -1,5 +1,5 @@ { - "version": "0.1.16", + "version": "0.1.17", "git_url": "https://github.com/OCR-D/ocrd_segment", "tools": { "ocrd-segment-repair": { diff --git a/ocrd_segment/repair.py b/ocrd_segment/repair.py index 90ad4d0..a51424e 100644 --- a/ocrd_segment/repair.py +++ b/ocrd_segment/repair.py @@ -88,7 +88,7 @@ def process(self): Furthermore, if ``sanitize``, then for each text region, update the coordinates to become the minimal convex hull of its constituent - text lines. + text lines. (But consider running ocrd-segment-project instead.) Finally, produce new output files by serialising the resulting hierarchy. """ @@ -254,6 +254,7 @@ def plausibilize_page(self, page, page_id): def sanitize_page(self, page, page_id): """Shrink each region outline to become the minimal convex hull of its constituent textlines.""" + # FIXME: should probably be removed in favour of ocrd-segment-project entirely LOG = getLogger('processor.RepairSegmentation') regions = page.get_AllRegions(classes=['Text']) page_image, page_coords, _ = self.workspace.image_from_page(