Skip to content

text_OCRHMMDecoder_create1

textfunctionOpenCV 5.0.0
import { text_OCRHMMDecoder_create1 } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSclassifier, vocabulary, transition_probabilities_table, emission_probabilities_table
FUNCTIONtext_OCRHMMDecoder_create1
RETURN TYPEtext_OCRHMMDecoder | null
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

HMM Decoding algorithm (only Viterbi for the moment) Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path

text_OCRHMMDecoder_create1(filename: EmbindString, vocabulary: EmbindString, transition_probabilities_table: Mat, emission_probabilities_table: Mat, mode: number, classifier: number): text_OCRHMMDecoder | null;
3 available overloads
text_OCRHMMDecoder_create1(classifier: EmbindString, vocabulary: EmbindString, transition_probabilities_table: Mat, emission_probabilities_table: Mat): text_OCRHMMDecoder | null;
text_OCRHMMDecoder_create1(classifier: EmbindString, vocabulary: EmbindString, transition_probabilities_table: Mat, emission_probabilities_table: Mat, mode: number): text_OCRHMMDecoder | null;
text_OCRHMMDecoder_create1(filename: EmbindString, vocabulary: EmbindString, transition_probabilities_table: Mat, emission_probabilities_table: Mat, mode: number, classifier: number): text_OCRHMMDecoder | null;
classifier

The character classifier with built in feature extractor.

vocabulary

The language vocabulary (chars when ascii english text). vocabulary.size() must be equal to the number of classes of the classifier.

transition_probabilities_table

Table with transition probabilities between character pairs. cols == rows == vocabulary.size().

emission_probabilities_table

Table with observation emission probabilities. cols == rows == vocabulary.size().

mode

HMM Decoding algorithm. Only OCR_DECODER_VITERBI is available for the moment (http://en.wikipedia.org/wiki/Viterbi_algorithm).

filename

filename argument (EmbindString).

Returns

The text_OCRHMMDecoder | null result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.