Table of Contents

Method Create

Namespace
OpenCvSharp.Text
Assembly
OpenCvSharp.dll

Create(OCRHMMDecoderClassifierCallback, string, InputArray, InputArray, DecoderMode)

Creates an instance of the OCRHMMDecoder class. Initializes the HMM decoder.

public static OCRHMMDecoder Create(OCRHMMDecoderClassifierCallback classifier, string vocabulary, InputArray transitionProbabilitiesTable, InputArray emissionProbabilitiesTable, DecoderMode mode = DecoderMode.Viterbi)

Parameters

classifier OCRHMMDecoderClassifierCallback

The character classifier with a built-in feature extractor.

vocabulary string

The language vocabulary (chars when ASCII English text). Its length must be equal to the number of classes of the classifier.

transitionProbabilitiesTable InputArray

Table with transition probabilities between character pairs. cols == rows == vocabulary.Length.

emissionProbabilitiesTable InputArray

Table with observation emission probabilities. cols == rows == vocabulary.Length.

mode DecoderMode

HMM decoding algorithm.

Returns

OCRHMMDecoder

Create(string, string, InputArray, InputArray, DecoderMode, ClassifierType)

Creates an instance of the OCRHMMDecoder class. Loads and initializes the HMM decoder from the specified classifier model file.

public static OCRHMMDecoder Create(string filename, string vocabulary, InputArray transitionProbabilitiesTable, InputArray emissionProbabilitiesTable, DecoderMode mode = DecoderMode.Viterbi, ClassifierType classifier = ClassifierType.Knn)

Parameters

filename string

The classifier model file.

vocabulary string

The language vocabulary (chars when ASCII English text). Its length must be equal to the number of classes of the classifier.

transitionProbabilitiesTable InputArray

Table with transition probabilities between character pairs. cols == rows == vocabulary.Length.

emissionProbabilitiesTable InputArray

Table with observation emission probabilities. cols == rows == vocabulary.Length.

mode DecoderMode

HMM decoding algorithm.

classifier ClassifierType

The character classifier type.

Returns

OCRHMMDecoder