Skip to content

Commit 4673d9b

Browse files
author
Robert Sachunsky
committed
re/segment join_polygons: fix rare case of adjacent rings
1 parent 1d2e858 commit 4673d9b

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
@@ -908,7 +908,7 @@ def join_polygons(polygons, loc='', scale=20):
908908
dists = np.eye(npoly, dtype=float)
909909
for i, j in pairs:
910910
dist = polygons[i].distance(polygons[j])
911-
if dist == 0:
911+
if dist < 1e-5:
912912
dist = 1e-5 # if pair merely touches, we still need to get an edge
913913
dists[i, j] = dist
914914
dists[j, i] = dist

0 commit comments

Comments
 (0)