Skip to content

Commit

Permalink
add low_threshold dtype fix in _nonmaximum_suppression kernel for canny
Browse files Browse the repository at this point in the history
  • Loading branch information
grlee77 committed Jun 19, 2023
1 parent 91ad7ef commit 4e246bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/cucim/src/cucim/skimage/feature/_canny.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ def _nonmaximum_suppression_bilinear(
kernel = _get_nonmax_kernel(large_int=large_int)

out = cp.empty_like(magnitude)

if isinstance(low_threshold, cp.ndarray):
# if array scalar was provided, make sure dtype matches other arrays
low_threshold = low_threshold.astype(out.dtype, copy=False)

kernel(isobel, jsobel, magnitude, eroded_mask, low_threshold, out)
return out

Expand Down

0 comments on commit 4e246bb

Please sign in to comment.