You are here: Start » AVL.NET » Function Reference » Computer Vision » Optical Character Recognition » AVL.RecognizeCharacters

AVL.RecognizeCharacters

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

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void RecognizeCharacters
(
	IList<AvlNet.Region> inCharacterRegions,
	AvlNet.OcrModel inOcrModel,
	AvlNet.Size? inCharacterSize,
	bool inDotPrint,
	AvlNet.CharacterSortingOrder inCharacterSorting,
	float? inMinScore,
	int? inMinSpaceWidth,
	out string outCharacters,
	IList<float> outScores,
	IList<List<AvlNet.OcrCandidate>> outCandidates,
	IList<AvlNet.Image> diagNormalizedCharacters,
	IList<AvlNet.Box> diagCharactersBoxes
)

Parameters

Name Type Range Default Description
inCharacterRegionsSystem.Collections.Generic.IList<AvlNet.Region>Array of character regions to recognize.
inOcrModelAvlNet.OcrModelTrained OcrMlpModel used to recognize characters.
inCharacterSizeAvlNet.Size?Size of single monospaced character if needed. Default value: atl::NIL.
inDotPrintboolDot-printed characters preprocessing.
inCharacterSortingAvlNet.CharacterSortingOrderLeftToRightSorting order of input characters. Default value: LeftToRight.
inMinScorefloat?<0.0f, 1.0f>Minimal value of accepted result. Otherwise char '*' will be placed. Default value: atl::NIL.
inMinSpaceWidthint?<0, INF>Minimal distance between characters where space character will be inserted. Default value: atl::NIL.
outCharactersstringResult of characters recognition.
outScoresSystem.Collections.Generic.IList<float>Classification result score.
outCandidatesSystem.Collections.Generic.IList<System.Collections.Generic.List<AvlNet.OcrCandidate>>Array of a character classification results and their score.
diagNormalizedCharactersSystem.Collections.Generic.IList<AvlNet.Image>Images of normalized characters used in character recognition.
diagCharactersBoxesSystem.Collections.Generic.IList<AvlNet.Box>Bounding boxes of characters.

Description

This operation performs reading a text from a set of regions. This operation requires a trained OCR classifier, which can be created using the TrainOcr_MLP or TrainOcr_SVM filter.

Filter requires regions specified in the inCharacterRegions. Each of the input region must contain single character. To get regions from an image use filter ExtractText.

The inCharacterSorting parameter defines the sorting order of the input characters provided in inCharacterRegions.

The parameter inDotPrint turns on the dedicated smoothing for characters printed using a jet printer in a dot-matrix form.

The parameter inCharacterSize defines size of monospaced (fixed-width) font. This size defines the cutting character bounding box.

Image shows extracted character cutting boxes with different cutting size.

If the parameter is set to auto character will be recognized as proportional font. For further information about font types please refer to the documentation of filters TrainOcr_SVM or TrainOcr_MLP.

Characters boxes with inCharacterSize set to Auto.

The input inMinSpaceWidth value indicates a minimal distance between characters where space character will be inserted to result string. When the value is marked as Auto no spaces will be inserted. Distance is presented in pixels.

If inMinScore is set, the characters with smaller score will be replaced with *

The output outCharacters contains recognized characters. The recognition score of each recognized character is stored in the outScores.

Remarks

To read more about how to use OCR technique, refer to Machine Vision Guide: Optical Character Recognition

Errors

List of possible exceptions:

Error type Description
DomainError Uninitialized OCR model in RecognizeCharacters. OCR model must be trained before use.

Function Overrides

See also