RecognizeCharacters


Classifies input regions into characters. Based on the Multi-Layer Perceptron model.

Applications:Usually the last, yet the most important step of optical character recognition or verification.

Syntax

C++
C#
Python
 
def RecognizeCharacters(
	inCharacterRegions: list[Region],
	inOcrModel: OcrModel,
	/,
	*,
	inCharacterSize: Size | None = None,
	inDotPrint: bool = False,
	inCharacterSorting: CharacterSortingOrder = CharacterSortingOrder.LeftToRight,
	inMinScore: float | None = None,
	inMinSpaceWidth: int | None = None
)
-> (
	outCharacters: str,
	outScores: list[float],
	outCandidates: list[ list[OcrCandidate] ],
	diagNormalizedCharacters: list[Image],
	diagCharactersBoxes: list[Box]
)

Parameters

Name Type Range Default Description
Input value inCharacterRegions list[Region] Array of character regions to recognize
Input value inOcrModel OcrModel Trained OcrMlpModel used to recognize characters
Input value inCharacterSize Size | None None Size of single monospaced character if needed
Input value inDotPrint bool False Dot-printed characters preprocessing
Input value inCharacterSorting CharacterSortingOrder CharacterSortingOrder.LeftToRight Sorting order of input characters
Input value inMinScore float | None 0.0 - 1.0 None Minimal value of accepted result. Otherwise char '*' will be placed.
Input value inMinSpaceWidth int | None 0 - None Minimal distance between characters where space character will be inserted
Output value outCharacters str Result of characters recognition
Output value outScores list[float] Classification result score
Output value outCandidates list[ list[OcrCandidate] ] Array of a character classification results and their score
Diagnostic input diagNormalizedCharacters list[Image] Images of normalized characters used in character recognition
Diagnostic input diagCharactersBoxes list[Box] Bounding boxes of characters