fixed typo and improved example in doc string

This commit is contained in:
Johannes Schönberger
2012-05-11 21:33:59 +02:00
parent 1b2bed7501
commit 4eb3028a64
+3 -2
View File
@@ -42,14 +42,14 @@ PROPS = (
def regionprops(image, properties='all'):
"""Measure properties of labeled image regions.
"""Measure properties of labelled image regions.
Parameters
----------
image : NxM ndarray
Labelled input image.
properties : {'all', list, tuple}
Shape measurements to be determined for each labeled image region.
Shape measurements to be determined for each labelled image region.
Default is 'all'. The following properties can be determined:
* Area : int
Number of pixels of region.
@@ -131,6 +131,7 @@ def regionprops(image, properties='all'):
>>> img = coins() > 110
>>> label_img = label(img)
>>> props = regionprops(label_img)
>>> props[0]['Centroid'] # centroid of first labelled object
"""
if not np.issubdtype(image.dtype, 'int'):
raise TypeError('labelled image must be of integer dtype')