regionprops(label_image, intensity_image=None, cache=True, coordinates=None)
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])
Labeled input image. Labels with value 0 are ignored.
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 (i.e., input) image with same size as labeled image. Default is None.
Determine whether to cache calculated properties. The computation is much faster for cached properties, whereas the memory consumption increases.
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.
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.
Each item describes one labeled region, and can be accessed using the attributes listed below.
Measure properties of labeled image regions.
>>> from skimage import data, utilThis example is valid syntax, but we were not able to check execution
... 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)
>>> # centroid of first labeled objectSee :
... props[0]['centroid'] (22.72987986048314, 81.91228523446583)
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
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