OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models.
More...
|
string | run (Mat image, int min_confidence, int component_level) |
| Recognize text using HMM.
|
|
string | run (Mat image, int min_confidence) |
| Recognize text using HMM.
|
|
string | run (Mat image, Mat mask, int min_confidence, int component_level) |
|
string | run (Mat image, Mat mask, int min_confidence) |
|
IntPtr | getNativeObjAddr () |
|
void | Dispose () |
|
void | ThrowIfDisposed () |
|
|
static new OCRHMMDecoder | __fromPtr__ (IntPtr addr) |
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
static BaseOCR | __fromPtr__ (IntPtr addr) |
|
static IntPtr | ThrowIfNullIntPtr (IntPtr ptr) |
|
OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models.
- Note
-
◆ __fromPtr__()
static new OCRHMMDecoder OpenCVForUnity.TextModule.OCRHMMDecoder.__fromPtr__ |
( |
IntPtr | addr | ) |
|
|
static |
◆ create() [1/5]
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>). |
◆ create() [2/5]
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>). |
◆ create() [3/5]
static OCRHMMDecoder OpenCVForUnity.TextModule.OCRHMMDecoder.create |
( |
string | filename, |
|
|
string | vocabulary, |
|
|
Mat | transition_probabilities_table, |
|
|
Mat | emission_probabilities_table ) |
|
static |
Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ create() [4/5]
static OCRHMMDecoder OpenCVForUnity.TextModule.OCRHMMDecoder.create |
( |
string | filename, |
|
|
string | vocabulary, |
|
|
Mat | transition_probabilities_table, |
|
|
Mat | emission_probabilities_table, |
|
|
int | mode ) |
|
static |
Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ create() [5/5]
static OCRHMMDecoder OpenCVForUnity.TextModule.OCRHMMDecoder.create |
( |
string | filename, |
|
|
string | vocabulary, |
|
|
Mat | transition_probabilities_table, |
|
|
Mat | emission_probabilities_table, |
|
|
int | mode, |
|
|
int | classifier ) |
|
static |
Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ Dispose()
override void OpenCVForUnity.TextModule.OCRHMMDecoder.Dispose |
( |
bool | disposing | ) |
|
|
protectedvirtual |
◆ run() [1/4]
string OpenCVForUnity.TextModule.OCRHMMDecoder.run |
( |
Mat | image, |
|
|
int | min_confidence ) |
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). |
mask | Input binary image CV_8UC1 same size as input image. Each connected component in mask corresponds to a segmented character in the input image. |
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. |
◆ run() [2/4]
string OpenCVForUnity.TextModule.OCRHMMDecoder.run |
( |
Mat | image, |
|
|
int | min_confidence, |
|
|
int | component_level ) |
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). |
mask | Input binary image CV_8UC1 same size as input image. Each connected component in mask corresponds to a segmented character in the input image. |
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. |
◆ run() [3/4]
string OpenCVForUnity.TextModule.OCRHMMDecoder.run |
( |
Mat | image, |
|
|
Mat | mask, |
|
|
int | min_confidence ) |
◆ run() [4/4]
string OpenCVForUnity.TextModule.OCRHMMDecoder.run |
( |
Mat | image, |
|
|
Mat | mask, |
|
|
int | min_confidence, |
|
|
int | component_level ) |
The documentation for this class was generated from the following file: