OpenCV  5.0.0alpha
Open Source Computer Vision
Loading...
Searching...
No Matches

Detailed Description

Classes

class  cv::text::BaseOCR
 
class  cv::text::OCRBeamSearchDecoder
 OCRBeamSearchDecoder class provides an interface for OCR using Beam Search algorithm. More...
 
class  cv::text::OCRHMMDecoder
 OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models. More...
 
class  cv::text::OCRHolisticWordRecognizer
 OCRHolisticWordRecognizer class provides the functionallity of segmented wordspotting. Given a predefined vocabulary , a DictNet is employed to select the most probable word given an input image. More...
 
class  cv::text::OCRTesseract
 OCRTesseract class provides an interface with the tesseract-ocr API (v3.02.02) in C++. More...
 

Enumerations

enum  {
  cv::text::OCR_LEVEL_WORD ,
  cv::text::OCR_LEVEL_TEXTLINE
}
 
enum  cv::text::classifier_type {
  cv::text::OCR_KNN_CLASSIFIER = 0 ,
  cv::text::OCR_CNN_CLASSIFIER = 1
}
 
enum  cv::text::decoder_mode { cv::text::OCR_DECODER_VITERBI = 0 }
 
enum  cv::text::ocr_engine_mode {
  cv::text::OEM_TESSERACT_ONLY ,
  cv::text::OEM_CUBE_ONLY ,
  cv::text::OEM_TESSERACT_CUBE_COMBINED ,
  cv::text::OEM_DEFAULT
}
 Tesseract.OcrEngineMode Enumeration. More...
 
enum  cv::text::page_seg_mode {
  cv::text::PSM_OSD_ONLY ,
  cv::text::PSM_AUTO_OSD ,
  cv::text::PSM_AUTO_ONLY ,
  cv::text::PSM_AUTO ,
  cv::text::PSM_SINGLE_COLUMN ,
  cv::text::PSM_SINGLE_BLOCK_VERT_TEXT ,
  cv::text::PSM_SINGLE_BLOCK ,
  cv::text::PSM_SINGLE_LINE ,
  cv::text::PSM_SINGLE_WORD ,
  cv::text::PSM_CIRCLE_WORD ,
  cv::text::PSM_SINGLE_CHAR
}
 Tesseract.PageSegMode Enumeration. More...
 

Functions

Mat cv::text::createOCRHMMTransitionsTable (const String &vocabulary, std::vector< cv::String > &lexicon)
 
void cv::text::createOCRHMMTransitionsTable (std::string &vocabulary, std::vector< std::string > &lexicon, OutputArray transition_probabilities_table)
 Utility function to create a tailored language model transitions table from a given list of words (lexicon).
 
Ptr< OCRBeamSearchDecoder::ClassifierCallbackcv::text::loadOCRBeamSearchClassifierCNN (const String &filename)
 Allow to implicitly load the default character classifier when creating an OCRBeamSearchDecoder object.
 
Ptr< OCRHMMDecoder::ClassifierCallbackcv::text::loadOCRHMMClassifier (const String &filename, int classifier)
 Allow to implicitly load the default character classifier when creating an OCRHMMDecoder object.
 
Ptr< OCRHMMDecoder::ClassifierCallbackcv::text::loadOCRHMMClassifierCNN (const String &filename)
 Allow to implicitly load the default character classifier when creating an OCRHMMDecoder object.
 
Ptr< OCRHMMDecoder::ClassifierCallbackcv::text::loadOCRHMMClassifierNM (const String &filename)
 Allow to implicitly load the default character classifier when creating an OCRHMMDecoder object.
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

#include <opencv2/text/ocr.hpp>

Enumerator
OCR_LEVEL_WORD 
Python: cv.text.OCR_LEVEL_WORD
OCR_LEVEL_TEXTLINE 
Python: cv.text.OCR_LEVEL_TEXTLINE

◆ classifier_type

#include <opencv2/text/ocr.hpp>

Enumerator
OCR_KNN_CLASSIFIER 
Python: cv.text.OCR_KNN_CLASSIFIER
OCR_CNN_CLASSIFIER 
Python: cv.text.OCR_CNN_CLASSIFIER

◆ decoder_mode

#include <opencv2/text/ocr.hpp>

Enumerator
OCR_DECODER_VITERBI 
Python: cv.text.OCR_DECODER_VITERBI

◆ ocr_engine_mode

#include <opencv2/text/ocr.hpp>

Tesseract.OcrEngineMode Enumeration.

Enumerator
OEM_TESSERACT_ONLY 
Python: cv.text.OEM_TESSERACT_ONLY
OEM_CUBE_ONLY 
Python: cv.text.OEM_CUBE_ONLY
OEM_TESSERACT_CUBE_COMBINED 
Python: cv.text.OEM_TESSERACT_CUBE_COMBINED
OEM_DEFAULT 
Python: cv.text.OEM_DEFAULT

◆ page_seg_mode

#include <opencv2/text/ocr.hpp>

Tesseract.PageSegMode Enumeration.

Enumerator
PSM_OSD_ONLY 
Python: cv.text.PSM_OSD_ONLY
PSM_AUTO_OSD 
Python: cv.text.PSM_AUTO_OSD
PSM_AUTO_ONLY 
Python: cv.text.PSM_AUTO_ONLY
PSM_AUTO 
Python: cv.text.PSM_AUTO
PSM_SINGLE_COLUMN 
Python: cv.text.PSM_SINGLE_COLUMN
PSM_SINGLE_BLOCK_VERT_TEXT 
Python: cv.text.PSM_SINGLE_BLOCK_VERT_TEXT
PSM_SINGLE_BLOCK 
Python: cv.text.PSM_SINGLE_BLOCK
PSM_SINGLE_LINE 
Python: cv.text.PSM_SINGLE_LINE
PSM_SINGLE_WORD 
Python: cv.text.PSM_SINGLE_WORD
PSM_CIRCLE_WORD 
Python: cv.text.PSM_CIRCLE_WORD
PSM_SINGLE_CHAR 
Python: cv.text.PSM_SINGLE_CHAR

Function Documentation

◆ createOCRHMMTransitionsTable() [1/2]

Mat cv::text::createOCRHMMTransitionsTable ( const String & vocabulary,
std::vector< cv::String > & lexicon )
Python:
cv.text.createOCRHMMTransitionsTable(vocabulary, lexicon) -> retval

◆ createOCRHMMTransitionsTable() [2/2]

void cv::text::createOCRHMMTransitionsTable ( std::string & vocabulary,
std::vector< std::string > & lexicon,
OutputArray transition_probabilities_table )
Python:
cv.text.createOCRHMMTransitionsTable(vocabulary, lexicon) -> retval

#include <opencv2/text/ocr.hpp>

Utility function to create a tailored language model transitions table from a given list of words (lexicon).

Parameters
vocabularyThe language vocabulary (chars when ASCII English text).
lexiconThe list of words that are expected to be found in a particular image.
transition_probabilities_tableOutput 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

◆ loadOCRBeamSearchClassifierCNN()

Ptr< OCRBeamSearchDecoder::ClassifierCallback > cv::text::loadOCRBeamSearchClassifierCNN ( const String & filename)
Python:
cv.text.loadOCRBeamSearchClassifierCNN(filename) -> retval

#include <opencv2/text/ocr.hpp>

Allow to implicitly load the default character classifier when creating an OCRBeamSearchDecoder object.

Parameters
filenameThe XML or YAML file with the classifier model (e.g. OCRBeamSearch_CNN_model_data.xml.gz)

The CNN default classifier is based in the scene text recognition method proposed by Adam Coates & Andrew NG in [Coates11a]. The character classifier consists in a Single Layer Convolutional Neural Network and a linear classifier. It is applied to the input image in a sliding window fashion, providing a set of recognitions at each window location.

◆ loadOCRHMMClassifier()

Ptr< OCRHMMDecoder::ClassifierCallback > cv::text::loadOCRHMMClassifier ( const String & filename,
int classifier )
Python:
cv.text.loadOCRHMMClassifier(filename, classifier) -> retval

#include <opencv2/text/ocr.hpp>

Allow to implicitly load the default character classifier when creating an OCRHMMDecoder object.

Parameters
filenameThe XML or YAML file with the classifier model (e.g. OCRBeamSearch_CNN_model_data.xml.gz)
classifierCan be one of classifier_type enum values.

◆ loadOCRHMMClassifierCNN()

Ptr< OCRHMMDecoder::ClassifierCallback > cv::text::loadOCRHMMClassifierCNN ( const String & filename)
Python:
cv.text.loadOCRHMMClassifierCNN(filename) -> retval

#include <opencv2/text/ocr.hpp>

Allow to implicitly load the default character classifier when creating an OCRHMMDecoder object.

Parameters
filenameThe XML or YAML file with the classifier model (e.g. OCRBeamSearch_CNN_model_data.xml.gz)

The CNN default classifier is based in the scene text recognition method proposed by Adam Coates & Andrew NG in [Coates11a]. The character classifier consists in a Single Layer Convolutional Neural Network and a linear classifier. It is applied to the input image in a sliding window fashion, providing a set of recognitions at each window location.

Deprecated
use loadOCRHMMClassifier instead

◆ loadOCRHMMClassifierNM()

Ptr< OCRHMMDecoder::ClassifierCallback > cv::text::loadOCRHMMClassifierNM ( const String & filename)
Python:
cv.text.loadOCRHMMClassifierNM(filename) -> retval

#include <opencv2/text/ocr.hpp>

Allow to implicitly load the default character classifier when creating an OCRHMMDecoder object.

Parameters
filenameThe XML or YAML file with the classifier model (e.g. OCRHMM_knn_model_data.xml)

The KNN default classifier is based in the scene text recognition method proposed by Lukás Neumann & Jiri Matas in [Neumann11b]. Basically, the region (contour) in the input image is normalized to a fixed size, while retaining the centroid and aspect ratio, in order to extract a feature vector based on gradient orientations along the chain-code of its perimeter. Then, the region is classified using a KNN model trained with synthetic data of rendered characters with different standard font types.

Deprecated
loadOCRHMMClassifier instead