Package org.opencv.dnn

## Class TextDetectionModel

- java.lang.Object
- - org.opencv.dnn.Model
  - - org.opencv.dnn.TextDetectionModel

- Direct Known Subclasses:
    `TextDetectionModel_DB`, `TextDetectionModel_EAST`

      public class TextDetectionModel
      extends Model

  Base class for text detection networks

- - ### Field Summary

    - ### Fields inherited from class org.opencv.dnn.Model

      `nativeObj`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `TextDetectionModel​(long addr)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static TextDetectionModel` | `__fromPtr__​(long addr)` |
    `void` | `detect​(Mat frame, java.util.List<MatOfPoint> detections)` |
    `void` | `detect​(Mat frame, java.util.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()` |

    - ### Methods inherited from class org.opencv.dnn.Model

      `enableWinograd, getNativeObjAddr, predict, setInputCrop, setInputMean, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputScale, setInputSize, setInputSize, setInputSwapRB, setOutputNames, setPreferableBackend, setPreferableTarget`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TextDetectionModel

          protected TextDetectionModel​(long addr)

  - ### Method Detail

    - #### __fromPtr__

          public static TextDetectionModel __fromPtr__​(long addr)

    - #### detect

          public void detect​(Mat frame,
                             java.util.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. 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.
      Parameters:
        `frame` - The input image
        `detections` - array with detections' quadrangles (4 points per result)
        `confidences` - array with detection confidences

    - #### detect

          public void detect​(Mat frame,
                             java.util.List<MatOfPoint> detections)

    - #### detectTextRectangles

          public 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. Each result is rotated rectangle. Note: Result may be inaccurate in case of strong perspective transformations.
      Parameters:
        `frame` - the input image
        `detections` - array with detections' RotationRect results
        `confidences` - array with detection confidences

    - #### detectTextRectangles

          public void detectTextRectangles​(Mat frame,
                                           MatOfRotatedRect detections)

    - #### finalize

          protected void finalize()
                           throws java.lang.Throwable

      Overrides:
        `finalize` in class `Model`
      Throws:
        `java.lang.Throwable`