OpenCV453
公開メンバ関数 | 静的公開メンバ関数 | 全メンバ一覧
cv::text::OCRTesseract クラスabstract

OCRTesseract class provides an interface with the tesseract-ocr API (v3.02.02) in C++. [詳解]

#include <ocr.hpp>

cv::text::BaseOCRを継承しています。

公開メンバ関数

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) CV_OVERRIDE
 Recognize text using the tesseract-ocr API. [詳解]
 
virtual void run (Mat &image, Mat &mask, 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) CV_OVERRIDE
 
CV_WRAP String run (InputArray image, int min_confidence, int component_level=0)
 
CV_WRAP String run (InputArray image, InputArray mask, int min_confidence, int component_level=0)
 
virtual CV_WRAP void setWhiteList (const String &char_whitelist)=0
 

静的公開メンバ関数

static CV_WRAP Ptr< OCRTesseractcreate (const char *datapath=NULL, const char *language=NULL, const char *char_whitelist=NULL, int oem=OEM_DEFAULT, int psmode=PSM_AUTO)
 Creates an instance of the OCRTesseract class. Initializes Tesseract. [詳解]
 

詳解

OCRTesseract class provides an interface with the tesseract-ocr API (v3.02.02) in C++.

Notice that it is compiled only when tesseract-ocr is correctly installed.

覚え書き

関数詳解

◆ create()

static CV_WRAP Ptr< OCRTesseract > cv::text::OCRTesseract::create ( const char *  datapath = NULL,
const char *  language = NULL,
const char *  char_whitelist = NULL,
int  oem = OEM_DEFAULT,
int  psmode = PSM_AUTO 
)
static

Creates an instance of the OCRTesseract class. Initializes Tesseract.

引数
datapaththe name of the parent directory of tessdata ended with "/", or NULL to use the system's default directory.
languagean ISO 639-3 code or NULL will default to "eng".
char_whitelistspecifies the list of characters used for recognition. NULL defaults to "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".
oemtesseract-ocr offers different OCR Engine Modes (OEM), by default tesseract::OEM_DEFAULT is used. See the tesseract-ocr API documentation for other possible values.
psmodetesseract-ocr offers different Page Segmentation Modes (PSM) tesseract::PSM_AUTO (fully automatic layout analysis) is used. See the tesseract-ocr API documentation for other possible values.

◆ run() [1/2]

virtual void cv::text::OCRTesseract::run ( Mat image,
Mat mask,
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

cv::text::BaseOCRを実装しています。

◆ run() [2/2]

virtual void cv::text::OCRTesseract::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 the tesseract-ocr API.

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.

引数
imageInput image CV_8UC1 or CV_8UC3
output_textOutput text of the tesseract-ocr.
component_rectsIf provided the method will output a list of Rects for the individual text elements found (e.g. words or text lines).
component_textsIf provided the method will output a list of text strings for the recognition of individual text elements found (e.g. words or text lines).
component_confidencesIf provided the method will output a list of confidence values for the recognition of individual text elements found (e.g. words or text lines).
component_levelOCR_LEVEL_WORD (by default), or OCR_LEVEL_TEXTLINE.

cv::text::BaseOCRを実装しています。


このクラス詳解は次のファイルから抽出されました: