From fa8fec5a1a018cf573448189b47b219c5ea196f9 Mon Sep 17 00:00:00 2001 From: saiprabhath2002 Date: Tue, 2 Jul 2024 14:49:58 +0530 Subject: [PATCH] corrected mask of patch --- kraken/lib/segmentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kraken/lib/segmentation.py b/kraken/lib/segmentation.py index 44ec18b30..0eb7f0bdc 100644 --- a/kraken/lib/segmentation.py +++ b/kraken/lib/segmentation.py @@ -523,7 +523,7 @@ def _calc_seam(baseline, polygon, angle, im_feats, bias=150): mask[line_locs] = 0 dist_bias = distance_transform_cdt(mask) # absolute mask - mask = np.array(make_polygonal_mask(polygon-(r_min, c_min), patch.shape[::-1])) > 128 + mask = np.array(make_polygonal_mask(polygon-(c_min, r_min), patch.shape[::-1])) <= 128 # dilate mask to compensate for aliasing during rotation mask = binary_erosion(mask, border_value=True, iterations=2) # combine weights with features