image.regions
result =image.regions(labeled, [pixel_size=], [unit=], [intensity_image=])(import image)
Input: labeled, pixel_size, unit, intensity_image · Output: result
What it is
labeled is a Model from bwlabel/label_blobs.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = image.regions(labeled, [pixel_size=], [unit=], [intensity_image=]) (import image) | labeled Modellabeled is a Model from bwlabel/label_blobs.pixel_size optionalarea, centroid_x, centroid_y, bbox_width, bbox_height (all suffixed _px/_px2 with no pixel_size=, or _<unit>/_<unit>2 when both pixel_size= and unit= are given — a unit with no scale, or unit="px" alongside a scale, is refused).unit optionalarea, centroid_x, centroid_y, bbox_width, bbox_height (all suffixed _px/_px2 with no pixel_size=, or _<unit>/_<unit>2 when both pixel_size= and unit= are given — a unit with no scale, or unit="px" alongside a scale, is refused).intensity_image Image, optionalintensity_image= is an optional Image, the ORIGINAL (non-labeled) image to measure — when given, an intensity_mean column (BT.601 luma mean per region) is appended. | bbox_height —all suffixed _px/_px2 with no pixel_size=, or _<unit>/_<unit>2 when both pixel_size= and unit= are given — a unit with no scale, or unit="px" alongside a scale, is refusedextent —area / bbox_area, unitless, the scale cancelsperimeter —suffixed like the other lengthseccentricity —0–1, from an equivalent ellipse fit to the region's second central moments — 0 for a circle/square, approaching 1 for a thin line | Returns a Table, one row per non-empty label, ordered by label id — the regionprops-shaped measurement but as columns rather than a List of Records, so a measurement can be filtered/grouped/joined/plotted with the language's ordinary table verbs. Columns: label; area, centroid_x, centroid_y, bbox_width, bbox_height (all suffixed _px/_px2 with no pixel_size=, or _<unit>/_<unit>2 when both pixel_size= and unit= are given — a unit with no scale, or unit="px" alongside a scale, is refused); extent (area / bbox_area, unitless, the scale cancels); perimeter (suffixed like the other lengths) — the region's outer boundary walked pixel-centre to pixel-centre (8-connected), summed and closed into a loop; a solid axis-aligned WxH rectangle measures 2*(W+H-2), NOT the 2*(W+H) edge-crossing count some other tools report, because the border ring of a solid block is all orthogonal steps; eccentricity (0–1, from an equivalent ellipse fit to the region's second central moments — 0 for a circle/square, approaching 1 for a thin line); orientation (radians, (-pi/2, pi/2], the equivalent ellipse's major-axis angle from +x, positive rotating towards +y — which is DOWN the image, i.e. clockwise on screen, not the counter-clockwise math-plot convention; 0 for an isotropic region by convention); solidity (area / convex_hull_area, unitless — the hull is built from every boundary pixel's four corners rather than its centre, so a solid convex region's hull area equals its own pixel-count area exactly and solidity is 1.0, never slightly above it). intensity_image= is an optional Image, the ORIGINAL (non-labeled) image to measure — when given, an intensity_mean column (BT.601 luma mean per region) is appended; when omitted, no such column appears at all, rather than one filled with a placeholder. The perimeter/eccentricity/orientation/solidity columns and the intensity_image= keyword were added in v0.4.0. |
Examples
No documentation example calls this form yet. The Images chapter is where one belongs.