get_marginals: exit early if no peaks found to avoid spurious overlap mask

This commit is contained in:
Robert Sachunsky 2025-08-29 12:37:44 +02:00
parent 57821662b9
commit 741aa7867c

View file

@ -94,6 +94,8 @@ def get_marginals(text_with_lines, text_regions, num_col, slope_deskew, light_ve
except:
point_left=first_nonzero
if point_left == first_nonzero and point_right == last_nonzero:
return text_regions
if point_right>=mask_marginals.shape[1]: