Struct opencv::text::OCRBeamSearchDecoder
source · pub struct OCRBeamSearchDecoder { /* private fields */ }
Expand description
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
Implementations§
source§impl OCRBeamSearchDecoder
impl OCRBeamSearchDecoder
sourcepub fn create(
classifier: Ptr<OCRBeamSearchDecoder_ClassifierCallback>,
vocabulary: &str,
transition_probabilities_table: &impl ToInputArray,
emission_probabilities_table: &impl ToInputArray,
mode: decoder_mode,
beam_size: i32
) -> Result<Ptr<OCRBeamSearchDecoder>>
pub fn create( classifier: Ptr<OCRBeamSearchDecoder_ClassifierCallback>, vocabulary: &str, transition_probabilities_table: &impl ToInputArray, emission_probabilities_table: &impl ToInputArray, mode: decoder_mode, beam_size: i32 ) -> Result<Ptr<OCRBeamSearchDecoder>>
Creates an instance of the OCRBeamSearchDecoder 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).
-
beam_size: Size of the beam in Beam Search algorithm.
§C++ default parameters
- mode: OCR_DECODER_VITERBI
- beam_size: 500
sourcepub fn create_from_file(
filename: &str,
vocabulary: &str,
transition_probabilities_table: &impl ToInputArray,
emission_probabilities_table: &impl ToInputArray,
mode: decoder_mode,
beam_size: i32
) -> Result<Ptr<OCRBeamSearchDecoder>>
pub fn create_from_file( filename: &str, vocabulary: &str, transition_probabilities_table: &impl ToInputArray, emission_probabilities_table: &impl ToInputArray, mode: decoder_mode, beam_size: i32 ) -> Result<Ptr<OCRBeamSearchDecoder>>
Creates an instance of the OCRBeamSearchDecoder class. Initializes HMMDecoder from the specified path.
Creates an instance of the OCRBeamSearchDecoder 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).
-
beam_size: Size of the beam in Beam Search algorithm.
§Overloaded parameters
§C++ default parameters
- mode: OCR_DECODER_VITERBI
- beam_size: 500
sourcepub fn create_from_file_def(
filename: &str,
vocabulary: &str,
transition_probabilities_table: &impl ToInputArray,
emission_probabilities_table: &impl ToInputArray
) -> Result<Ptr<OCRBeamSearchDecoder>>
pub fn create_from_file_def( filename: &str, vocabulary: &str, transition_probabilities_table: &impl ToInputArray, emission_probabilities_table: &impl ToInputArray ) -> Result<Ptr<OCRBeamSearchDecoder>>
Creates an instance of the OCRBeamSearchDecoder class. Initializes HMMDecoder from the specified path.
@overload
§Note
This alternative version of OCRBeamSearchDecoder::create_from_file function uses the following default values for its arguments:
- mode: OCR_DECODER_VITERBI
- beam_size: 500