OpenCV 5.0.0
Open Source Computer Vision
読み込み中...
検索中...
見つかりません
🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
cv::text::OCRBeamSearchDecoder クラス

OCRBeamSearchDecoder クラスは、ビームサーチアルゴリズムを用いたOCRのインターフェースを提供する。 詳細...

#include <opencv2/text/ocr.hpp>

Collaboration diagram for cv::text::OCRBeamSearchDecoder:

クラス

class  ClassifierCallback
 文字分類器のコールバックはクラスとして実装される。 詳細...
 

公開メンバ関数

String run (InputArray image, InputArray mask, int min_confidence, int component_level=0)
 
String run (InputArray image, int min_confidence, int component_level=0)
 
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
 
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
 ビームサーチを用いてテキストを認識する。
 
- Public Member Functions inherited from cv::text::BaseOCR
virtual ~BaseOCR ()
 

静的公開メンバ関数

static Ptr< OCRBeamSearchDecodercreate (const Ptr< OCRBeamSearchDecoder::ClassifierCallback > classifier, const std::string &vocabulary, InputArray transition_probabilities_table, InputArray emission_probabilities_table, text::decoder_mode mode=OCR_DECODER_VITERBI, int beam_size=500)
 OCRBeamSearchDecoder クラスのインスタンスを生成する。HMMDecoder を初期化する。
 
static Ptr< OCRBeamSearchDecodercreate (const String &filename, const String &vocabulary, InputArray transition_probabilities_table, InputArray emission_probabilities_table, text::decoder_mode mode=OCR_DECODER_VITERBI, int beam_size=500)
 OCRBeamSearchDecoder クラスのインスタンスを生成する。指定したパスから HMMDecoder を初期化する。
 

限定公開変数類

int beam_size
 
Ptr< OCRBeamSearchDecoder::ClassifierCallbackclassifier
 
Mat emission_p
 
decoder_mode mode
 
Mat transition_p
 
std::string vocabulary
 

詳細説明

OCRBeamSearchDecoder クラスは、ビームサーチアルゴリズムを用いたOCRのインターフェースを提供する。

覚え書き

メンバ関数詳解

◆ create() [1/2]

static Ptr< OCRBeamSearchDecoder > cv::text::OCRBeamSearchDecoder::create ( const Ptr< OCRBeamSearchDecoder::ClassifierCallback > classifier,
const std::string & vocabulary,
InputArray transition_probabilities_table,
InputArray emission_probabilities_table,
text::decoder_mode mode = OCR_DECODER_VITERBI,
int beam_size = 500 )
static
Python:
cv.text.OCRBeamSearchDecoder.create(classifier, vocabulary, transition_probabilities_table, emission_probabilities_table[, mode[, beam_size]]) -> retval
cv.text.OCRBeamSearchDecoder_create(classifier, vocabulary, transition_probabilities_table, emission_probabilities_table[, mode[, beam_size]]) -> retval

OCRBeamSearchDecoder クラスのインスタンスを生成する。HMMDecoder を初期化する。

引数
classifier特徴抽出器を内蔵した文字分類器。
vocabulary言語の語彙(ASCII英語テキストの場合は文字)。vocabulary.size() は分類器のクラス数と等しくなければならない。
transition_probabilities_table文字ペア間の遷移確率の表。cols == rows == vocabulary.size()。
emission_probabilities_table観測出力確率の表。cols == rows == vocabulary.size()。
modeHMM デコードアルゴリズム。現時点では OCR_DECODER_VITERBI のみが利用可能(http://en.wikipedia.org/wiki/Viterbi_algorithm)。
beam_sizeビームサーチアルゴリズムにおけるビーム幅。

◆ create() [2/2]

static Ptr< OCRBeamSearchDecoder > cv::text::OCRBeamSearchDecoder::create ( const String & filename,
const String & vocabulary,
InputArray transition_probabilities_table,
InputArray emission_probabilities_table,
text::decoder_mode mode = OCR_DECODER_VITERBI,
int beam_size = 500 )
static
Python:
cv.text.OCRBeamSearchDecoder.create(classifier, vocabulary, transition_probabilities_table, emission_probabilities_table[, mode[, beam_size]]) -> retval
cv.text.OCRBeamSearchDecoder_create(classifier, vocabulary, transition_probabilities_table, emission_probabilities_table[, mode[, beam_size]]) -> retval

OCRBeamSearchDecoder クラスのインスタンスを生成する。指定したパスから HMMDecoder を初期化する。

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

◆ run() [1/4]

String cv::text::OCRBeamSearchDecoder::run ( InputArray image,
InputArray mask,
int min_confidence,
int component_level = 0 )
Python:
cv.text.OCRBeamSearchDecoder.run(image, min_confidence[, component_level]) -> retval
cv.text.OCRBeamSearchDecoder.run(image, mask, min_confidence[, component_level]) -> retval

◆ run() [2/4]

String cv::text::OCRBeamSearchDecoder::run ( InputArray image,
int min_confidence,
int component_level = 0 )
Python:
cv.text.OCRBeamSearchDecoder.run(image, min_confidence[, component_level]) -> retval
cv.text.OCRBeamSearchDecoder.run(image, mask, min_confidence[, component_level]) -> retval

◆ run() [3/4]

virtual void cv::text::OCRBeamSearchDecoder::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
Python:
cv.text.OCRBeamSearchDecoder.run(image, min_confidence[, component_level]) -> retval
cv.text.OCRBeamSearchDecoder.run(image, mask, min_confidence[, component_level]) -> retval

cv::text::BaseOCR を実装する。

◆ run() [4/4]

virtual void cv::text::OCRBeamSearchDecoder::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
Python:
cv.text.OCRBeamSearchDecoder.run(image, min_confidence[, component_level]) -> retval
cv.text.OCRBeamSearchDecoder.run(image, mask, min_confidence[, component_level]) -> retval

ビームサーチを用いてテキストを認識する。

画像を入力として受け取り、認識されたテキストを output_text 引数に返す。オプションで、見つかった個々のテキスト要素(単語など)のRectや、それらのテキスト要素とその信頼度の値のリストも提供する。

引数
image単一のテキスト行(または単語)を含む CV_8UC1 の入力二値画像。
output_text出力テキスト。HMM デコーダによって見つかった最も尤もらしい文字列。
component_rects指定された場合、このメソッドは見つかった個々のテキスト要素(例: 単語)の Rect のリストを出力する。
component_texts指定された場合、このメソッドは見つかった個々のテキスト要素(例: 単語)の認識結果のテキスト文字列のリストを出力する。
component_confidences指定された場合、このメソッドは見つかった個々のテキスト要素(例: 単語)の認識に対する信頼度値のリストを出力する。
component_levelOCR_LEVEL_WORD のみがサポートされている。

cv::text::BaseOCR を実装する。

メンバ変数詳解

◆ beam_size

int cv::text::OCRBeamSearchDecoder::beam_size
protected

◆ classifier

Ptr<OCRBeamSearchDecoder::ClassifierCallback> cv::text::OCRBeamSearchDecoder::classifier
protected

◆ emission_p

Mat cv::text::OCRBeamSearchDecoder::emission_p
protected

◆ mode

decoder_mode cv::text::OCRBeamSearchDecoder::mode
protected

◆ transition_p

Mat cv::text::OCRBeamSearchDecoder::transition_p
protected

◆ vocabulary

std::string cv::text::OCRBeamSearchDecoder::vocabulary
protected

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