text_OCRBeamSearchDecoder
import { text_OCRBeamSearchDecoder } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits text_BaseOCR.
OCR BeamSearch Decoder OCRBeamSearchDecoder class provides an interface for OCR using Beam Search algorithm.
Note: - (C++) An example on using OCRBeamSearchDecoder recognition combined with scene text detection can be found at the demo sample: https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/word_recognition.cpp
Constructors and members
static create
Creates an instance of the OCRBeamSearchDecoder class. Initializes HMMDecoder.
create(classifier: text_OCRBeamSearchDecoder_ClassifierCallback | null, vocabulary: EmbindString, transition_probabilities_table: Mat, emission_probabilities_table: Mat, mode: number, beam_size: number): text_OCRBeamSearchDecoder | null;3 available overloads
create(classifier: text_OCRBeamSearchDecoder_ClassifierCallback | null, vocabulary: EmbindString, transition_probabilities_table: Mat, emission_probabilities_table: Mat): text_OCRBeamSearchDecoder | null;create(classifier: text_OCRBeamSearchDecoder_ClassifierCallback | null, vocabulary: EmbindString, transition_probabilities_table: Mat, emission_probabilities_table: Mat, mode: number): text_OCRBeamSearchDecoder | null;create(classifier: text_OCRBeamSearchDecoder_ClassifierCallback | null, vocabulary: EmbindString, transition_probabilities_table: Mat, emission_probabilities_table: Mat, mode: number, beam_size: number): text_OCRBeamSearchDecoder | null;classifierThe character classifier with built in feature extractor.
vocabularyThe language vocabulary (chars when ASCII English text). vocabulary.size() must be equal to the number of classes of the classifier.
transition_probabilities_tableTable with transition probabilities between character pairs. cols == rows == vocabulary.size().
emission_probabilities_tableTable with observation emission probabilities. cols == rows == vocabulary.size().
modeHMM Decoding algorithm. Only OCR_DECODER_VITERBI is available for the moment (http://en.wikipedia.org/wiki/Viterbi_algorithm).
beam_sizeSize of the beam in Beam Search algorithm.
The text_OCRBeamSearchDecoder | null result.
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
run
aliases for scripting
run(image: Mat, min_confidence: number, component_level: number): string;2 available overloads
run(image: Mat, min_confidence: number): string;run(image: Mat, min_confidence: number, component_level: number): string;imageimage argument (Mat).
min_confidencemin confidence argument (number).
component_levelcomponent level argument (number).
The string result.
run1
aliases for scripting
run1(image: Mat, mask: Mat, min_confidence: number, component_level: number): string;2 available overloads
run1(image: Mat, mask: Mat, min_confidence: number): string;run1(image: Mat, mask: Mat, min_confidence: number, component_level: number): string;imageimage argument (Mat).
maskmask argument (Mat).
min_confidencemin confidence argument (number).
component_levelcomponent level argument (number).
The string 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.