Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Optical Character Recognition » RecognizeCharacters


Module: OCR

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

Name Type Range Description
inCharacterRegions RegionArray Array of character regions to recognize
inOcrModel OcrModel Trained OcrMlpModel used to recognize characters
inCharacterSize Size* Size of single monospaced character if needed
inDotPrint Bool Dot-printed characters preprocessing
inCharacterSorting CharacterSortingOrder Sorting order of input characters
inMinScore Real* 0.0 - 1.0 Minimal value of accepted result. Otherwise char '*' will be placed.
inMinSpaceWidth Integer* 0 - Minimal distance between characters where space character will be inserted
outCharacters String Result of characters recognition
outScores RealArray Classification result score
outCandidates OcrCandidateArrayArray Array of a character classification results and their score
diagNormalizedCharacters ImageArray Images of normalized characters used in character recognition
diagCharactersBoxes BoxArray Bounding boxes of characters


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


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.


Description of usage of this filter can be found in examples and tutorial: OCR Read Number (MLP), OCR Read Number (SVM), Using the OCR model.


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


This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

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

Complexity Level

This filter is available on Basic Complexity Level.

See Also

  • TrainOcr_SVM – Trains an OCR support vector machines classifier.
  • TrainOcr_MLP – Trains an OCR multilayer perceptron classifier.