OpenCV for Unity 2.6.3
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.TextModule.OCRHMMDecoder Class Reference

OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models. More...

Inheritance diagram for OpenCVForUnity.TextModule.OCRHMMDecoder:
OpenCVForUnity.TextModule.BaseOCR OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

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)
 
- Public Member Functions inherited from OpenCVForUnity.TextModule.BaseOCR
IntPtr getNativeObjAddr ()
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

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 Public Member Functions inherited from OpenCVForUnity.TextModule.BaseOCR
static BaseOCR __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.TextModule.BaseOCR
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Package Functions inherited from OpenCVForUnity.TextModule.BaseOCR
- Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models.

Note

Member Function Documentation

◆ __fromPtr__()

static new OCRHMMDecoder OpenCVForUnity.TextModule.OCRHMMDecoder.__fromPtr__ ( IntPtr addr)
static

◆ create() [1/5]

static OCRHMMDecoder OpenCVForUnity.TextModule.OCRHMMDecoder.create ( OCRHMMDecoder_ClassifierCallback classifier,
string vocabulary,
Mat transition_probabilities_table,
Mat emission_probabilities_table )
static

Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.

Parameters
classifierThe character classifier with built in feature extractor.
vocabularyThe language vocabulary (chars when ascii english text). vocabulary.size() must be equal to the number of classes of the classifier.
transition_probabilities_tableTable with transition probabilities between character pairs. cols == rows == vocabulary.size().
emission_probabilities_tableTable with observation emission probabilities. cols == rows == vocabulary.size().
modeHMM Decoding algorithm. Only OCR_DECODER_VITERBI is available for the moment (<http://en.wikipedia.org/wiki/Viterbi_algorithm&gt;).

◆ create() [2/5]

static OCRHMMDecoder OpenCVForUnity.TextModule.OCRHMMDecoder.create ( OCRHMMDecoder_ClassifierCallback classifier,
string vocabulary,
Mat transition_probabilities_table,
Mat emission_probabilities_table,
int mode )
static

Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.

Parameters
classifierThe character classifier with built in feature extractor.
vocabularyThe language vocabulary (chars when ascii english text). vocabulary.size() must be equal to the number of classes of the classifier.
transition_probabilities_tableTable with transition probabilities between character pairs. cols == rows == vocabulary.size().
emission_probabilities_tableTable with observation emission probabilities. cols == rows == vocabulary.size().
modeHMM Decoding algorithm. Only OCR_DECODER_VITERBI is available for the moment (<http://en.wikipedia.org/wiki/Viterbi_algorithm&gt;).

◆ 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

Reimplemented from OpenCVForUnity.TextModule.BaseOCR.

◆ 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
imageInput image CV_8UC1 or CV_8UC3 with a single text line (or word).
maskInput binary image CV_8UC1 same size as input image. Each connected component in mask corresponds to a segmented character in the input image.
output_textOutput text. Most likely character sequence found by the HMM decoder.
component_rectsIf provided the method will output a list of Rects for the individual text elements found (e.g. words).
component_textsIf provided the method will output a list of text strings for the recognition of individual text elements found (e.g. words).
component_confidencesIf provided the method will output a list of confidence values for the recognition of individual text elements found (e.g. words).
component_levelOnly 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
imageInput image CV_8UC1 or CV_8UC3 with a single text line (or word).
maskInput binary image CV_8UC1 same size as input image. Each connected component in mask corresponds to a segmented character in the input image.
output_textOutput text. Most likely character sequence found by the HMM decoder.
component_rectsIf provided the method will output a list of Rects for the individual text elements found (e.g. words).
component_textsIf provided the method will output a list of text strings for the recognition of individual text elements found (e.g. words).
component_confidencesIf provided the method will output a list of confidence values for the recognition of individual text elements found (e.g. words).
component_levelOnly 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: