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