OCRBeamSearchDecoder クラスは、ビームサーチアルゴリズムを用いたOCRのインターフェースを提供する。 詳細...
#include <opencv2/text/ocr.hpp>
|
| 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 |
| | ビームサーチを用いてテキストを認識する。
|
| |
| virtual | ~BaseOCR () |
| |
|
| static Ptr< 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) |
| | OCRBeamSearchDecoder クラスのインスタンスを生成する。HMMDecoder を初期化する。
|
| |
| static Ptr< 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) |
| | OCRBeamSearchDecoder クラスのインスタンスを生成する。指定したパスから HMMDecoder を初期化する。
|
| |
OCRBeamSearchDecoder クラスは、ビームサーチアルゴリズムを用いたOCRのインターフェースを提供する。
- 覚え書き
-
◆ create() [1/2]
| 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()。 |
| mode | HMM デコードアルゴリズム。現時点では OCR_DECODER_VITERBI のみが利用可能(http://en.wikipedia.org/wiki/Viterbi_algorithm)。 |
| beam_size | ビームサーチアルゴリズムにおけるビーム幅。 |
◆ create() [2/2]
| 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]
| 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 |
◆ 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_level | OCR_LEVEL_WORD のみがサポートされている。 |
cv::text::BaseOCR を実装する。
◆ beam_size
| int cv::text::OCRBeamSearchDecoder::beam_size |
|
protected |
◆ classifier
◆ emission_p
| Mat cv::text::OCRBeamSearchDecoder::emission_p |
|
protected |
◆ mode
◆ transition_p
| Mat cv::text::OCRBeamSearchDecoder::transition_p |
|
protected |
◆ vocabulary
| std::string cv::text::OCRBeamSearchDecoder::vocabulary |
|
protected |
このクラス詳解は次のファイルから抽出されました: