Code sample using TextDetectorCNN
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,198 times
Last updated: Jun 29 '18