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
classifierOCRHMMDecoderClassifierCallbackThe 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.
Returns
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
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.
classifierClassifierTypeThe character classifier type.