From 84d10962f3382fd912ca5acef7fcb3d395aad41a Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Fri, 28 Nov 2025 18:04:12 +0100 Subject: [PATCH] return_boxes_of_images_by_order_of_reading_new: improve - when searching for multi-col box makers, pick the right-most allowable column, not the left-most --- src/eynollah/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eynollah/utils/__init__.py b/src/eynollah/utils/__init__.py index bf2ec15..2ebf48a 100644 --- a/src/eynollah/utils/__init__.py +++ b/src/eynollah/utils/__init__.py @@ -1796,7 +1796,7 @@ def return_boxes_of_images_by_order_of_reading_new( # "box height", (y_bot - y_top), # "label height", sum(regions_without_separators[ # y_top: y_bot, peaks_neg_tot[start + 1]])) - return min((last for last, l_top, l_bot, l_count in labelcolmap.get(start, []) + return max((last for last, l_top, l_bot, l_count in labelcolmap.get(start, []) # yield the right-most column that does not cut through # any regions in this horizontal span if y_top < l_bot and y_bot > l_top