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
classifierOCRBeamSearchDecoderClassifierCallbackThe character classifier with a built-in feature extractor.
vocabularystringThe language vocabulary (chars when ASCII English text). Its length must be equal to the number of classes of the classifier.
transitionProbabilitiesTableInputArrayTable with transition probabilities between character pairs. cols == rows == vocabulary.Length.
emissionProbabilitiesTableInputArrayTable with observation emission probabilities. cols == rows == vocabulary.Length.
modeDecoderModeHMM decoding algorithm.
beamSizeintSize of the beam in the Beam Search algorithm.
Returns
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
filenamestringThe classifier model file.
vocabularystringThe language vocabulary (chars when ASCII English text). Its length must be equal to the number of classes of the classifier.
transitionProbabilitiesTableInputArrayTable with transition probabilities between character pairs. cols == rows == vocabulary.Length.
emissionProbabilitiesTableInputArrayTable with observation emission probabilities. cols == rows == vocabulary.Length.
modeDecoderModeHMM decoding algorithm.
beamSizeintSize of the beam in the Beam Search algorithm.