Project ↗ | Documentation ↗ | — | Tutorials ↗ | How To's ↗ | Explanations ↗ | References |
Entry ↗ | — | Sections ↘ | Permuted Sections ↘ | Names ↘ | Permuted Names ↘ | Strict ↘ | Implementations ↘ |
Documentation -- Reference Pages -- accessor morphology
Table Of Contents
- accessor ↗
Operators
Operators
↑ aktive op connected-components get
Syntax: aktive op connected-components get src [→ definition]
Returns a dictionary describing all the connected components of the single-band input.
The input is expected to be binary. If not, all values > 0
are treated as the foreground searched for components.
The components are identified by integer numbers.
The data of each component is a dictionary providing the component's area
, bounding box
, centroid
location, and parts
list. Note that the centroid is not the same as the center of the bounding box.
The area
value is an unsigned integer number indicating the number of pixels covered by the component.
The bounding box
value is a 4-element list holding the x- and y-coordinates of the upper-left and lower-right points of the bounding box, in this order. In other words the x- and y- min coordinates followed by the x- and y- max coordinates.
The centroid
value is a 2-element list holding the x- and y-coordinates of the point, in this order.
The parts
value is an unordered list of the row ranges the component consists of. A single range value is a 3-element list holding the y-coordinate of the range, followed by the min and max x-coordinates the range covers.
See "aktive op connected-components labeled" for a transformer command built on top of this.
Note that this operation can also be used to determine the perimeters of the connected components. Instead of using the image with the regions directly as the operation's input pre-process it with "aktive op morph gradient internal" (radius 1) to highlight the region boundaries and feed that result in. The boundary components are the desired perimeters of the original regions. See the second example. Beware, there is currently a mismatch here. The morphological gradient is based on a 8-neighbourhood. Connected components on the other hand uses a 4-neighourhood.
Input | Description |
---|---|
src | Source image |
Examples
@1
|
aktive op connected-components get @1
| ||||
---|---|---|---|---|---|
|
|
@1
|
@2
|
aktive op connected-components get @2
| ||||||
---|---|---|---|---|---|---|---|---|
|
|
|