You are here: Start » AVL.NET » AVL.SplitRegionIntoExactlyNComponents(AvlNet.Region, int, int?, float, float?, int?, int?, bool, AvlNet.Region[])
AVL.SplitRegionIntoExactlyNComponents(AvlNet.Region, int, int?, float, float?, int?, int?, bool, AvlNet.Region[])
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void SplitRegionIntoExactlyNComponents( AvlNet.Region inRegion, int inComponentCount, int? inMaxDistance, float inDistanceBalance, float? inMaxJointDiameter, int? inMaxJointWidth, int? inMaxJointHeight, bool inRemoveBoundaryBlobs, out AvlNet.Region[] outComponents )
Parameters
- inRegion
- Type: AvlNet.Region
- inComponentCount
- Type: System.Int32
- inMaxDistance
- Type: System.Nullable<System.Int32>
- inDistanceBalance
- Type: System.Single
- inMaxJointDiameter
- Type: System.Nullable<System.Single>
- inMaxJointWidth
- Type: System.Nullable<System.Int32>
- inMaxJointHeight
- Type: System.Nullable<System.Int32>
- inRemoveBoundaryBlobs
- Type: System.Boolean
- outComponents
- Type: AvlNet.Region
Description
The filter splits the input region into blobs and iteratively joins some of them into bigger components until
only inComponentCount components remain. Only blobs that are distant from each other by at most inMaxDistance
can be joined. The joining order is determined based on modified distance between two blobs, so the closest ones are joined first.
This modified distance between two blobs is computed as follows:
- The shortest segment connecting two blobs is computed.
- The segment is scaled by \[ 0.5 \cdot (1 + inDistanceBalance) \] along the X axis and by \[ 0.5 \cdot (1 - inDistanceBalance) \] along the Y axis.
- Finally the length of the so scaled segment is computed.
Examples
![]() |
![]() |
SplitRegionIntoExactlyNComponents used with inComponentCount = 4.
Remarks
This filter is mostly used in Blob Analysis Technique please refer to our Machine Vision Guide - Blob Analysis article.


