mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-30 11:09:29 +08:00
Add support for unsigned integer label images
This commit is contained in:
@@ -470,8 +470,6 @@ def regionprops(label_image, properties=None,
|
||||
>>> props[0].centroid # centroid of first labelled object
|
||||
>>> props[0]['centroid'] # centroid of first labelled object
|
||||
"""
|
||||
if not np.issubdtype(label_image.dtype, 'int'):
|
||||
raise TypeError('Labelled image must be of integer dtype.')
|
||||
|
||||
if properties is not None:
|
||||
warnings.warn('The ``properties`` argument is deprecated and is '
|
||||
|
||||
@@ -28,7 +28,9 @@ def test_all_props():
|
||||
regions[prop]
|
||||
|
||||
|
||||
def test_unsupported_dtype():
|
||||
def test_dtype():
|
||||
regionprops(np.zeros((10, 10), dtype=np.int))
|
||||
regionprops(np.zeros((10, 10), dtype=np.uint))
|
||||
assert_raises(TypeError, regionprops, np.zeros((10, 10), dtype=np.double))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user