[−][src]Function opencv::text::create_ocrhmm_transitions_table
pub fn create_ocrhmm_transitions_table(
vocabulary: &mut String,
lexicon: &mut Vector<String>,
transition_probabilities_table: &mut dyn ToOutputArray
) -> Result<()>
Utility function to create a tailored language model transitions table from a given list of words (lexicon).
Parameters
-
vocabulary: The language vocabulary (chars when ASCII English text).
-
lexicon: The list of words that are expected to be found in a particular image.
-
transition_probabilities_table: Output table with transition probabilities between character pairs. cols == rows == vocabulary.size().
The function calculate frequency statistics of character pairs from the given lexicon and fills the output transition_probabilities_table with them. The transition_probabilities_table can be used as input in the OCRHMMDecoder::create() and OCRBeamSearchDecoder::create() methods.
Note:
- (C++) An alternative would be to load the default generic language transition table provided in the text module samples folder (created from ispell 42869 english words list) : https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/OCRHMM_transitions_table.xml