OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models.
More...
#include "ocr.hpp"
|
virtual void | run (Mat &image, std::string &output_text, std::vector< Rect > *component_rects=NULL, std::vector< std::string > *component_texts=NULL, std::vector< float > *component_confidences=NULL, int component_level=0) |
| Recognize text using HMM. More...
|
|
virtual | ~BaseOCR () |
|
OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models.
- Note
-
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). |
virtual void cv::text::OCRHMMDecoder::run |
( |
Mat & |
image, |
|
|
std::string & |
output_text, |
|
|
std::vector< Rect > * |
component_rects = NULL , |
|
|
std::vector< std::string > * |
component_texts = NULL , |
|
|
std::vector< float > * |
component_confidences = NULL , |
|
|
int |
component_level = 0 |
|
) |
| |
|
virtual |
Recognize text using HMM.
Takes image 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 with a single text line (or word). |
output_text | Output text. Most likely character sequence found by the HMM decoder. |
component_rects | If provided the method will output a list of Rects for the individual text elements found (e.g. words). |
component_texts | If provided the method will output a list of text strings for the recognition of individual text elements found (e.g. words). |
component_confidences | If provided the method will output a list of confidence values for the recognition of individual text elements found (e.g. words). |
component_level | Only OCR_LEVEL_WORD is supported. |
Implements cv::text::BaseOCR.
Mat cv::text::OCRHMMDecoder::emission_p |
|
protected |
Mat cv::text::OCRHMMDecoder::transition_p |
|
protected |
std::string cv::text::OCRHMMDecoder::vocabulary |
|
protected |
The documentation for this class was generated from the following file:
- /Users/build/test/opencv_contrib/modules/text/include/opencv2/text/ocr.hpp