textline_contours_postprocessing: do not catch arbitrary exceptions

This commit is contained in:
Robert Sachunsky 2025-10-06 16:53:59 +02:00
parent fe603188f4
commit 6e57ab3741

View file

@ -1344,7 +1344,7 @@ def textline_contours_postprocessing(textline_mask, slope,
textline_mask = cv2.morphologyEx(textline_mask, cv2.MORPH_CLOSE, kernel)
textline_mask = cv2.erode(textline_mask, kernel, iterations=2)
# textline_mask = cv2.erode(textline_mask, kernel, iterations=1)
try:
x_help = 30
y_help = 2
@ -1387,8 +1387,6 @@ def textline_contours_postprocessing(textline_mask, slope,
else:
_, contours_rotated_clean = separate_lines(
dst, contours_text_rot[ind_big_con], slope, x_help, y_help)
except:
contours_rotated_clean = []
return contours_rotated_clean