mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-03 11:45:29 +08:00
BUG: Recast label output to satisfy ndimage on 32-bit platforms.
This commit is contained in:
@@ -214,4 +214,8 @@ def label(input, DTYPE_t neighbors=8, DTYPE_t background=-1):
|
||||
else:
|
||||
data[i, j] = data_p[forest[i, j]]
|
||||
|
||||
return data
|
||||
# Work around a bug in ndimage's type checking on 32-bit platforms
|
||||
if data.dtype == np.int32:
|
||||
return data.view(np.int32)
|
||||
else:
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user