Code sample using TextDetectorCNN
Is there an actual sample using TextDetectorCNN it seems that I cannot find any. How to implement this class?
Is there an actual sample using TextDetectorCNN it seems that I cannot find any. How to implement this class?
there is a c++ sample here , also docs and javadocs
assuming, you're using opencv3.x, and you have build opencv libs with the opencv_contrib repo,
download the model and the prototxt , then something similar to this:
TextDetector detector = TextDetectorCNN.create(prototxt, weights);
Mat image = ...
MatOfRect boxes = new MatOfRect();
MatOfFloat confidences = new MatOfFloat();
detector.detect(image, boxes, confidences);
float thresh = ???; // heuristic value
Rect[] rects = boxes.toArray();
float[] conf = confidences.toArray();
for (int i=0; i<rects.length; i++)
if (conf[i] >= thresh)
// assume rects[i] is valid
should get you started in java. good luck !
Asked: 2018-06-29 04:33:51 -0600
Seen: 1,237 times
Last updated: Jun 29 '18
How to translate this to Java?
OpenCV Tutorial 1 - Add OpenCV on API 8
Unresolved inclusion in OpenCV+Android tutorial
Area of a single pixel object in OpenCV
build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04
How to convert Floating point image to 32-bit single-channel?
OpenCV DescriptorMatcher matches
Can't compile .cu file when including opencv.hpp
Using OpenCV's stitching module, strange error when compositing images