Back to FabImage Library website

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

SplitRegionIntoExactlyNCharacters


Header: FIL.h
Namespace: fil
Module: OCR

Splits the input region into a fixed-size array of regions corresponding to individual characters.

Applications: Text segmentation when the number of characters is known, usually followed by a RecognizeCharacters filter.

Syntax

C++
C#
 
void fil::SplitRegionIntoExactlyNCharacters
(
	const fil::Region& inRegion,
	const int inCharacterCount,
	const int inCharacterSpacing,
	const float inProjectionSmooth,
	ftl::Conditional<ftl::Array<fil::Region> >& outRegions,
	ftl::Array<fil::Region>& diagClasses,
	fil::Profile& diagProjection
)

Parameters

Name Type Range Default Description
Input value
inRegion const Region& Region which contains characters
Input value
inCharacterCount const int 1 - Character count in provided region
Input value
inCharacterSpacing const int 0 - Spacing size between characters
Input value
inProjectionSmooth const float 0.0 - 1.0f Projection smoothing value used to remove noises from character region
Output value
outRegions Conditional<Array<Region> >& Output array of regions containing separated characters
Diagnostic input
diagClasses Array<Region>& Regions that contain location of split characters
Diagnostic input
diagProjection Profile& Profile of region projection used to distinguish characters

Examples

Input region.

Result of the filter's usage.

Errors

List of possible exceptions:

Error type Description
DomainError Value of inCharacterCount is greater than inRegion frame width.
DomainError Value of inCharactersSpacing is greater than single character width.