Skip to content

Commit

Permalink
fix: NaN error for python3.9+
Browse files Browse the repository at this point in the history
  • Loading branch information
MehmedGIT committed Aug 27, 2024
1 parent 1d7e9a0 commit 224e86f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocrd_cis/ocropy/ocrolib/morph.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def select_regions(binary,f,min=0,nbest=100000):
return keep[labels]

@checks(SEGMENTATION)
def all_neighbors(image, dist=1, bg=NaN):
def all_neighbors(image, dist=1, bg=float('nan')):
"""Given an image with labels, find all pairs of labels
that are directly (up to ``dist``) neighboring each other, ignoring the label ``bg``."""
q = 100000
Expand Down

0 comments on commit 224e86f

Please sign in to comment.