OpenCV 4.10.0-dev
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::text::TextDetectorCNN Class Referenceabstract

TextDetectorCNN class provides the functionallity of text bounding box detection. This class is representing to find bounding boxes of text words given an input image. This class uses OpenCV dnn module to load pre-trained model described in [166]. The original repository with the modified SSD Caffe version: https://github.com/MhLiao/TextBoxes. Model can be downloaded from DropBox. Modified .prototxt file with the model description can be found in opencv_contrib/modules/text/samples/textbox.prototxt. More...

#include <opencv2/text/textDetector.hpp>

Collaboration diagram for cv::text::TextDetectorCNN:

Public Member Functions

virtual void detect (InputArray inputImage, std::vector< Rect > &Bbox, std::vector< float > &confidence) CV_OVERRIDE=0
 
- Public Member Functions inherited from cv::text::TextDetector
virtual ~TextDetector ()
 

Static Public Member Functions

static Ptr< TextDetectorCNNcreate (const String &modelArchFilename, const String &modelWeightsFilename)
 
static Ptr< TextDetectorCNNcreate (const String &modelArchFilename, const String &modelWeightsFilename, std::vector< Size > detectionSizes)
 Creates an instance of the TextDetectorCNN class using the provided parameters.
 

Detailed Description

TextDetectorCNN class provides the functionallity of text bounding box detection. This class is representing to find bounding boxes of text words given an input image. This class uses OpenCV dnn module to load pre-trained model described in [166]. The original repository with the modified SSD Caffe version: https://github.com/MhLiao/TextBoxes. Model can be downloaded from DropBox. Modified .prototxt file with the model description can be found in opencv_contrib/modules/text/samples/textbox.prototxt.

Member Function Documentation

◆ create() [1/2]

static Ptr< TextDetectorCNN > cv::text::TextDetectorCNN::create ( const String & modelArchFilename,
const String & modelWeightsFilename )
static
Python:
cv.text.TextDetectorCNN.create(modelArchFilename, modelWeightsFilename) -> retval
cv.text.TextDetectorCNN_create(modelArchFilename, modelWeightsFilename) -> retval

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ 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

Creates an instance of the TextDetectorCNN class using the provided parameters.

Parameters
modelArchFilenamethe relative or absolute path to the prototxt file describing the classifiers architecture.
modelWeightsFilenamethe relative or absolute path to the file containing the pretrained weights of the model in caffe-binary form.
detectionSizesa list of sizes for multiscale detection. The values[(300,300),(700,500),(700,300),(700,700),(1600,1600)] are recommended in [166] to achieve the best quality.

◆ detect()

virtual void cv::text::TextDetectorCNN::detect ( InputArray inputImage,
std::vector< Rect > & Bbox,
std::vector< float > & confidence )
pure virtual
Python:
cv.text.TextDetectorCNN.detect(inputImage) -> Bbox, confidence

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
inputImagean image expected to be a CV_U8C3 of any size
Bboxa vector of Rect that will store the detected word bounding box
confidencea vector of float that will be updated with the confidence the classifier has for the selected bounding box

Implements cv::text::TextDetector.


The documentation for this class was generated from the following file: