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 |
|
保护 |
该类的文档是从以下文件生成的