TextDetectorCNN
Objective-C
@interface TextDetectorCNN : TextDetector
Swift
class TextDetectorCNN : TextDetector
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 CITE: LiaoSBWL17.
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 of Text
-
Declaration
Objective-C
+ (TextDetectorCNN*)create:(NSString*)modelArchFilename modelWeightsFilename:(NSString*)modelWeightsFilename NS_SWIFT_NAME(create(modelArchFilename:modelWeightsFilename:));
Swift
class func create(modelArchFilename: String, modelWeightsFilename: String) -> TextDetectorCNN
-
Declaration
Objective-C
- (void)detect:(nonnull Mat *)inputImage Bbox:(nonnull NSMutableArray<Rect2i *> *)Bbox confidence:(nonnull FloatVector *)confidence;
Swift
func detect(inputImage: Mat, Bbox: NSMutableArray, confidence: FloatVector)
Parameters
inputImage
an image expected to be a CV_U8C3 of any size
Bbox
a vector of Rect that will store the detected word bounding box
confidence
a vector of float that will be updated with the confidence the classifier has for the selected bounding box