public class TextDetectionModel extends Model
Modifier | Constructor and Description |
---|---|
protected |
TextDetectionModel(long addr) |
Modifier and Type | Method and Description |
---|---|
static TextDetectionModel |
__fromPtr__(long addr) |
void |
detect(Mat frame,
List<MatOfPoint> detections) |
void |
detect(Mat frame,
List<MatOfPoint> detections,
MatOfFloat confidences)
Performs detection
Given the input
frame , prepare network input, run network inference, post-process network output and return result detections. |
void |
detectTextRectangles(Mat frame,
MatOfRotatedRect detections) |
void |
detectTextRectangles(Mat frame,
MatOfRotatedRect detections,
MatOfFloat confidences)
Performs detection
Given the input
frame , prepare network input, run network inference, post-process network output and return result detections. |
protected void |
finalize() |
enableWinograd, getNativeObjAddr, predict, setInputCrop, setInputMean, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputScale, setInputSize, setInputSize, setInputSwapRB, setPreferableBackend, setPreferableTarget
public static TextDetectionModel __fromPtr__(long addr)
public void detect(Mat frame, List<MatOfPoint> detections, MatOfFloat confidences)
frame
, prepare network input, run network inference, post-process network output and return result detections.
Each result is quadrangle's 4 points in this order:
- bottom-left
- top-left
- top-right
- bottom-right
Use cv::getPerspectiveTransform function to retrieve image region without perspective transformations.
Note: If DL model doesn't support that kind of output then result may be derived from detectTextRectangles() output.frame
- The input imagedetections
- array with detections' quadrangles (4 points per result)confidences
- array with detection confidencespublic void detect(Mat frame, List<MatOfPoint> detections)
public void detectTextRectangles(Mat frame, MatOfRotatedRect detections, MatOfFloat confidences)
frame
, prepare network input, run network inference, post-process network output and return result detections.
Each result is rotated rectangle.
Note: Result may be inaccurate in case of strong perspective transformations.frame
- the input imagedetections
- array with detections' RotationRect resultsconfidences
- array with detection confidencespublic void detectTextRectangles(Mat frame, MatOfRotatedRect detections)
Copyright © 2024. All rights reserved.