Package org.opencv.text
Class OCRHMMDecoder
java.lang.Object
org.opencv.text.BaseOCR
org.opencv.text.OCRHMMDecoder
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>
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OCRHMMDecoder
__fromPtr__
(long addr) static OCRHMMDecoder
create
(String filename, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table) Creates an instance of the OCRHMMDecoder class.static OCRHMMDecoder
create
(String filename, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, int mode) Creates an instance of the OCRHMMDecoder class.static OCRHMMDecoder
create
(String filename, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, int mode, int classifier) Creates an instance of the OCRHMMDecoder class.static OCRHMMDecoder
create
(OCRHMMDecoder_ClassifierCallback classifier, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table) Creates an instance of the OCRHMMDecoder class.static OCRHMMDecoder
create
(OCRHMMDecoder_ClassifierCallback classifier, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, int mode) Creates an instance of the OCRHMMDecoder class.protected void
finalize()
Recognize text using HMM.Recognize text using HMM.Methods inherited from class org.opencv.text.BaseOCR
getNativeObjAddr
-
Constructor Details
-
OCRHMMDecoder
protected OCRHMMDecoder(long addr)
-
-
Method Details
-
__fromPtr__
-
run
Recognize text using HMM. Takes an image and a mask (where each connected component corresponds to a segmented character) on input and returns recognized text in the output_text parameter. Optionally provides also the Rects for individual text elements found (e.g. words), and the list of those text elements with their confidence values.- Parameters:
image
- Input image CV_8UC1 or CV_8UC3 with a single text line (or word). text elements found (e.g. words). recognition of individual text elements found (e.g. words). for the recognition of individual text elements found (e.g. words).component_level
- Only OCR_LEVEL_WORD is supported.min_confidence
- automatically generated- Returns:
- automatically generated
-
run
Recognize text using HMM. Takes an image and a mask (where each connected component corresponds to a segmented character) on input and returns recognized text in the output_text parameter. Optionally provides also the Rects for individual text elements found (e.g. words), and the list of those text elements with their confidence values.- Parameters:
image
- Input image CV_8UC1 or CV_8UC3 with a single text line (or word). text elements found (e.g. words). recognition of individual text elements found (e.g. words). for the recognition of individual text elements found (e.g. words).min_confidence
- automatically generated- Returns:
- automatically generated
-
run
-
run
-
create
public static OCRHMMDecoder create(OCRHMMDecoder_ClassifierCallback classifier, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, int mode) 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>).- Returns:
- automatically generated
-
create
public static OCRHMMDecoder create(OCRHMMDecoder_ClassifierCallback classifier, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table) 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(). (<http://en.wikipedia.org/wiki/Viterbi_algorithm>).- Returns:
- automatically generated
-
create
public static OCRHMMDecoder create(String filename, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, int mode, int classifier) Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path- Parameters:
filename
- automatically generatedvocabulary
- automatically generatedtransition_probabilities_table
- automatically generatedemission_probabilities_table
- automatically generatedmode
- automatically generatedclassifier
- automatically generated- Returns:
- automatically generated
-
create
public static OCRHMMDecoder create(String filename, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, int mode) Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path- Parameters:
filename
- automatically generatedvocabulary
- automatically generatedtransition_probabilities_table
- automatically generatedemission_probabilities_table
- automatically generatedmode
- automatically generated- Returns:
- automatically generated
-
create
public static OCRHMMDecoder create(String filename, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table) Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path- Parameters:
filename
- automatically generatedvocabulary
- automatically generatedtransition_probabilities_table
- automatically generatedemission_probabilities_table
- automatically generated- Returns:
- automatically generated
-
finalize
-