Skip to content

Commit

Permalink
Merge pull request #1 from cmehlmann/master
Browse files Browse the repository at this point in the history
Makes the lkf_detection routines python 3 compatible.

changes: 1.print_lkf_detection (line401) 2. def cut_neighbours divide…
  • Loading branch information
nhutter authored Oct 23, 2020
2 parents 1bda0a4 + ad234d8 commit 4f431a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lkf_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def cut_neighbours(img):
X, Y = img.shape
x, y = (1,1)
overlap = 1
shape = (((X-2*overlap)/x), ((Y-2*overlap)/y), x+2*overlap, y+2*overlap) # number of patches, patch_shape
shape = (((X-2*overlap)//x), ((Y-2*overlap)//y), x+2*overlap, y+2*overlap) # number of patches, patch_shape
strides = img.itemsize*np.array([Y*x, y, Y, 1])
return np.lib.stride_tricks.as_strided(img, shape=shape, strides=strides)

Expand Down Expand Up @@ -398,8 +398,8 @@ def detect_segments(lkf_thin,eps_thres=0.1):
lkf_thin[1:-1,1:-1].shape),
return_counts=True)
if np.any(new_starts_counts > 1):
print 'Warning: %i starting points arises maximum %i-times' %(np.sum(new_starts_counts>1),
np.max(new_starts_counts))
print ('Warning: %i starting points arises maximum %i-times' %(np.sum(new_starts_counts>1),
np.max(new_starts_counts)))

# Append new positions of this detection step
num_new_starts = new_starts.shape[0]
Expand Down

0 comments on commit 4f431a6

Please sign in to comment.