Skip to content

Commit 426a33d

Browse files
author
Robert Sachunsky
committed
segment: avoid adding existing regions to RO group if they are not immediate children
1 parent 1abf38b commit 426a33d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ocrd_cis/ocropy/segment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def _process_element(self, element, ignore, image, coords, element_id, file_id,
552552
"region label %d has both existing regions and new lines (%s)" % (
553553
region_label, str(region_line_labels0))
554554
region = ignore[region_line_labels0[0] - 1]
555-
if rogroup and not isinstance(region, SeparatorRegionType):
555+
if rogroup and region.parent_object_ == element and not isinstance(region, SeparatorRegionType):
556556
index = page_add_to_reading_order(rogroup, region.id, index)
557557
LOG.debug('Region label %d is for ignored region "%s"',
558558
region_label, region.id)

0 commit comments

Comments
 (0)