skimage 0.17.2

NotesParametersReturnsBackRef
regionprops(label_image, intensity_image=None, cache=True, coordinates=None)

Notes

The following properties can be accessed as attributes or keys:

area

area

bbox

bbox

bbox_area

bbox_area

centroid

centroid

convex_area

convex_area

convex_image

convex_image

coords

coords

eccentricity

eccentricity

equivalent_diameter

equivalent_diameter

euler_number

euler_number

extent

extent

filled_area

filled_area

filled_image

filled_image

image

image

inertia_tensor

inertia_tensor

inertia_tensor_eigvals

inertia_tensor_eigvals

intensity_image

intensity_image

label

label

local_centroid

local_centroid

major_axis_length

major_axis_length

max_intensity

max_intensity

mean_intensity

mean_intensity

min_intensity

min_intensity

minor_axis_length

minor_axis_length

moments

moments

moments_central

moments_central

moments_hu

moments_hu

moments_normalized

moments_normalized

orientation

orientation

perimeter

perimeter

slice

slice

solidity

solidity

weighted_centroid

weighted_centroid

weighted_local_centroid

weighted_local_centroid

weighted_moments

weighted_moments

weighted_moments_central

weighted_moments_central

weighted_moments_hu

weighted_moments_hu

weighted_moments_normalized

weighted_moments_normalized

Each region also supports iteration, so that you can do:

for prop in region:
    print(prop, region[prop])

Parameters

label_image : (N, M) ndarray

Labeled input image. Labels with value 0 are ignored.

versionchanged

Previously, label_image was processed by numpy.squeeze and so any number of singleton dimensions was allowed. This resulted in inconsistent handling of images with singleton dimensions. To recover the old behaviour, use regionprops(np.squeeze(label_image), ...) .

intensity_image : (N, M) ndarray, optional

Intensity (i.e., input) image with same size as labeled image. Default is None.

cache : bool, optional

Determine whether to cache calculated properties. The computation is much faster for cached properties, whereas the memory consumption increases.

coordinates : DEPRECATED

This argument is deprecated and will be removed in a future version of scikit-image.

See Coordinate conventions <numpy-images-coordinate-conventions> for more details.

deprecated

Use "rc" coordinates everywhere. It may be sufficient to call numpy.transpose on your label image to get the same values as 0.15 and earlier. However, for some properties, the transformation will be less trivial. For example, the new orientation is :None:math:`\frac{\pi}{2}` plus the old orientation.

Returns

properties : list of RegionProperties

Each item describes one labeled region, and can be accessed using the attributes listed below.

Measure properties of labeled image regions.

See Also

label

Examples

This example is valid syntax, but we were not able to check execution
>>> from skimage import data, util
... from skimage.measure import label
... img = util.img_as_ubyte(data.coins()) > 110
... label_img = label(img, connectivity=img.ndim)
... props = regionprops(label_img)
... # centroid of first labeled object
... props[0].centroid (22.72987986048314, 81.91228523446583)
This example is valid syntax, but we were not able to check execution
>>> # centroid of first labeled object
... props[0]['centroid'] (22.72987986048314, 81.91228523446583)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.measure._label.label skimage.measure._moments.inertia_tensor skimage.measure._regionprops.regionprops skimage.measure._regionprops.RegionProperties

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/measure/_regionprops.py#643
type: <class 'function'>
Commit: