Back to Adaptive Vision Library website

You are here: Start » Function Reference » Computer Vision » Optical Character Recognition » GroupRegionsByLines

GroupRegionsByLines


Header: AVL.h
Namespace: avl
Module: OCR

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

Syntax

C++
C#
 
void avl::GroupRegionsByLines
(
	const atl::Array<avl::Region>& inRegions,
	const avl::Rectangle2D& inRoi,
	const atl::Optional<avl::CoordinateSystem2D>& inRoiAlignment,
	const int inLinesCount,
	const float inLineWidth,
	const bool inRemoveOutliers,
	atl::Array<atl::Array<avl::Region>>& outLines,
	atl::Array<avl::Region>& outLine0,
	atl::Array<avl::Region>& outLine1,
	atl::Array<avl::Region>& outLine2,
	atl::Array<avl::Region>& outLine3,
	avl::Rectangle2D& outAlignedRoi,
	atl::Array<avl::Segment2D>& diagLines,
	atl::Array<avl::Rectangle2D>& diagLineRanges,
	atl::Array<avl::Point2D>& diagRegionPoints
)

Parameters

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

Examples

As you can see in the below picture, the filter's task is to divide the input region into several sub-regions by its placement in a line. As a result, each line represents a separate region.

Exemplary result of the filter's usage.