Table of Contents

Method Create

Namespace
OpenCvSharp.Text
Assembly
OpenCvSharp.dll

Create(OCRBeamSearchDecoderClassifierCallback, string, InputArray, InputArray, DecoderMode, int)

Creates an instance of the OCRBeamSearchDecoder class. Initializes the decoder.

public static OCRBeamSearchDecoder Create(OCRBeamSearchDecoderClassifierCallback classifier, string vocabulary, InputArray transitionProbabilitiesTable, InputArray emissionProbabilitiesTable, DecoderMode mode = DecoderMode.Viterbi, int beamSize = 500)

Parameters

classifier OCRBeamSearchDecoderClassifierCallback

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.

beamSize int

Size of the beam in the Beam Search algorithm.

Returns

OCRBeamSearchDecoder

Create(string, string, InputArray, InputArray, DecoderMode, int)

Creates an instance of the OCRBeamSearchDecoder class. Initializes the decoder from the specified classifier model file.

public static OCRBeamSearchDecoder Create(string filename, string vocabulary, InputArray transitionProbabilitiesTable, InputArray emissionProbabilitiesTable, DecoderMode mode = DecoderMode.Viterbi, int beamSize = 500)

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.

beamSize int

Size of the beam in the Beam Search algorithm.

Returns

OCRBeamSearchDecoder