GroupRegionsByLines


Splits an array of blobs by distance to computed base lines.

Syntax

C++
C#
Python
 
def GroupRegionsByLines(
	inRegions: list[Region],
	inRoi: Rectangle2D,
	/,
	*,
	inRoiAlignment: CoordinateSystem2D | None = None,
	inLinesCount: int = 1,
	inLineWidth: float = 1.0,
	inRemoveOutliers: bool = False
)
-> (
	outLines: list[ list[Region] ],
	outLine0: list[Region],
	outLine1: list[Region],
	outLine2: list[Region],
	outLine3: list[Region],
	outAlignedRoi: Rectangle2D,
	diagLines: list[Segment2D],
	diagLineRanges: list[Rectangle2D],
	diagRegionPoints: list[Point2D]
)

Parameters

Name Type Range Default Description
Input value inRegions list[Region] Input regions (parts of characters)
Input value inRoi Rectangle2D Range of character classification
Input value inRoiAlignment CoordinateSystem2D | None None
Input value inLinesCount int 0 - 1 ROI is divided into inLinesCount lines
Input value inLineWidth float 0.0 - 1.0 Value of line range used if inRemoveOutliers is set to TRUE
Input value inRemoveOutliers bool False If this flag is set blobs with distance greater than inLineWidth are removed.
Output value outLines list[ list[Region] ] Lines in single Array
Output value outLine0 list[Region]
Output value outLine1 list[Region]
Output value outLine2 list[Region]
Output value outLine3 list[Region]
Output value outAlignedRoi Rectangle2D
Diagnostic input diagLines list[Segment2D] Segments which indicates the position of lines
Diagnostic input diagLineRanges list[Rectangle2D] Rectangles represents range of lines which are included if inRemoveOutliers is set
Diagnostic input diagRegionPoints list[Point2D] Point which indicates region position