Struct opencv::text::OCRHMMDecoder
source · pub struct OCRHMMDecoder { /* private fields */ }
Expand description
OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models.
Note:
- (C++) An example on using OCRHMMDecoder recognition combined with scene text detection can be found at the webcam_demo sample: https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/webcam_demo.cpp
Implementations§
source§impl OCRHMMDecoder
impl OCRHMMDecoder
sourcepub fn create(
classifier: Ptr<OCRHMMDecoder_ClassifierCallback>,
vocabulary: &str,
transition_probabilities_table: &impl ToInputArray,
emission_probabilities_table: &impl ToInputArray,
mode: i32
) -> Result<Ptr<OCRHMMDecoder>>
pub fn create( classifier: Ptr<OCRHMMDecoder_ClassifierCallback>, vocabulary: &str, transition_probabilities_table: &impl ToInputArray, emission_probabilities_table: &impl ToInputArray, mode: i32 ) -> Result<Ptr<OCRHMMDecoder>>
Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.
Parameters
-
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).
C++ default parameters
- mode: OCR_DECODER_VITERBI
sourcepub fn create_def(
classifier: Ptr<OCRHMMDecoder_ClassifierCallback>,
vocabulary: &str,
transition_probabilities_table: &impl ToInputArray,
emission_probabilities_table: &impl ToInputArray
) -> Result<Ptr<OCRHMMDecoder>>
pub fn create_def( classifier: Ptr<OCRHMMDecoder_ClassifierCallback>, vocabulary: &str, transition_probabilities_table: &impl ToInputArray, emission_probabilities_table: &impl ToInputArray ) -> Result<Ptr<OCRHMMDecoder>>
Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.
Parameters
-
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).
Note
This alternative version of [create] function uses the following default values for its arguments:
- mode: OCR_DECODER_VITERBI
sourcepub fn create_from_file(
filename: &str,
vocabulary: &str,
transition_probabilities_table: &impl ToInputArray,
emission_probabilities_table: &impl ToInputArray,
mode: i32,
classifier: i32
) -> Result<Ptr<OCRHMMDecoder>>
pub fn create_from_file( filename: &str, vocabulary: &str, transition_probabilities_table: &impl ToInputArray, emission_probabilities_table: &impl ToInputArray, mode: i32, classifier: i32 ) -> Result<Ptr<OCRHMMDecoder>>
Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path
Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.
Parameters
-
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).
Overloaded parameters
C++ default parameters
- mode: OCR_DECODER_VITERBI
- classifier: OCR_KNN_CLASSIFIER
sourcepub fn create_from_file_def(
filename: &str,
vocabulary: &str,
transition_probabilities_table: &impl ToInputArray,
emission_probabilities_table: &impl ToInputArray
) -> Result<Ptr<OCRHMMDecoder>>
pub fn create_from_file_def( filename: &str, vocabulary: &str, transition_probabilities_table: &impl ToInputArray, emission_probabilities_table: &impl ToInputArray ) -> Result<Ptr<OCRHMMDecoder>>
Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path
@overload
Note
This alternative version of [create_from_file] function uses the following default values for its arguments:
- mode: OCR_DECODER_VITERBI
- classifier: OCR_KNN_CLASSIFIER