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 | 帶有內建特徵提取器的字元分類器。 |
| 詞彙表 | 語言詞彙表(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 |
◆ 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 引數中返回識別的文字。 可選擇性地提供找到的各個文字元素(例如,單詞)的 Rects,以及具有其置信度值的那些文字元素的列表。
- 引數
-
| image | 輸入二進位制影像 CV_8UC1,帶有單個文字行(或單詞)。 |
| output_text | 輸出文字。 HMM 解碼器找到的最可能的字元序列。 |
| component_rects | 如果提供,該方法將輸出找到的各個文字元素(例如,單詞)的 Rects 列表。 |
| component_texts | 如果提供,該方法將輸出找到的各個文字元素(例如,單詞)的識別文字字串列表。 |
| component_confidences | 如果提供,該方法將輸出找到的各個文字元素(例如,單詞)的識別置信度值列表。 |
| component_level | 僅支援 OCR_LEVEL_WORD。 |
實現 cv::text::BaseOCR。
◆ beam_size
| int cv::text::OCRBeamSearchDecoder::beam_size |
|
保護 |
◆ classifier
◆ emission_p
| Mat cv::text::OCRBeamSearchDecoder::emission_p |
|
保護 |
◆ mode
◆ transition_p
| Mat cv::text::OCRBeamSearchDecoder::transition_p |
|
保護 |
◆ vocabulary
| std::string cv::text::OCRBeamSearchDecoder::vocabulary |
|
保護 |
該類的文件是從以下檔案生成的