TextDetectorCNN 类提供文本边界框检测的功能。此类用于查找给定输入图像中的文本单词的边界框。此类使用 OpenCV dnn 模块加载在 [168] 中描述的预训练模型。原始存储库包含修改后的 SSD Caffe 版本:https://github.com/MhLiao/TextBoxes。模型可以从 DropBox 下载。包含模型描述的修改后的 .prototxt 文件可以在 opencv_contrib/modules/text/samples/textbox.prototxt 中找到。更多...
#include <opencv2/text/textDetector.hpp>
TextDetectorCNN 类提供文本边界框检测的功能。此类用于查找给定输入图像中的文本单词的边界框。此类使用 OpenCV dnn 模块加载在 [168] 中描述的预训练模型。原始存储库包含修改后的 SSD Caffe 版本:https://github.com/MhLiao/TextBoxes。模型可以从 DropBox 下载。包含模型描述的修改后的 .prototxt 文件可以在 opencv_contrib/modules/text/samples/textbox.prototxt 中找到。
◆ create() [1/2]
| Python |
|---|
| cv.text.TextDetectorCNN.create( | modelArchFilename, modelWeightsFilename | ) -> | retval |
| cv.text.TextDetectorCNN_create( | modelArchFilename, modelWeightsFilename | ) -> | retval |
这是一个重载的成员函数,为了方便而提供。它与上面的函数仅在它接受的参数方面有所不同。
◆ create() [2/2]
| static Ptr< TextDetectorCNN > cv::text::TextDetectorCNN::create |
( |
const String & | modelArchFilename, |
|
|
const String & | modelWeightsFilename, |
|
|
std::vector< Size > | detectionSizes ) |
|
static |
| Python |
|---|
| cv.text.TextDetectorCNN.create( | modelArchFilename, modelWeightsFilename | ) -> | retval |
| cv.text.TextDetectorCNN_create( | modelArchFilename, modelWeightsFilename | ) -> | retval |
使用提供的参数创建 TextDetectorCNN 类的实例。
- 参数
-
| modelArchFilename | 描述分类器架构的 prototxt 文件的相对或绝对路径。 |
| modelWeightsFilename | 包含 caffe 二进制形式的模型的预训练权重的文件的相对或绝对路径。 |
| detectionSizes | 多尺度检测的大小列表。建议在 [168] 中使用值 [(300,300),(700,500),(700,300),(700,700),(1600,1600)] 以获得最佳质量。 |
◆ detect()
| virtual void cv::text::TextDetectorCNN::detect |
( |
InputArray | inputImage, |
|
|
std::vector< Rect > & | Bbox, |
|
|
std::vector< float > & | confidence ) |
|
纯虚函数 |
| Python |
|---|
| cv.text.TextDetectorCNN.detect( | inputImage | ) -> | Bbox, confidence |
这是一个重载的成员函数,为了方便而提供。它与上面的函数仅在它接受的参数方面有所不同。
- 参数
-
| inputImage | 预期为任何大小的 CV_U8C3 的图像 |
| Bbox | 将存储检测到的单词边界框的 Rect 向量 |
| confidence | 一个浮点向量,将被更新为分类器对所选边界框的置信度 |
实现 cv::text::TextDetector。
此类文档由以下文件生成