Skip to content

dnn_TextDetectionModel

Deep neural networksclassOpenCV 5.0.0
import { dnn_TextDetectionModel } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSdnn_TextDetectionModel
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits dnn_Model.

Base class for text detection networks

Constructors and members

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

detect

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.

detect(frame: Mat, detections: PointVectorVector, confidences: FloatVector): void;
frame

The input image

detections

Output destination, filled by the native operation. array with detections' quadrangles (4 points per result)

confidences

Output destination, filled by the native operation. array with detection confidences

detect1

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.

detect1(frame: Mat, detections: PointVectorVector): void;
frame

The input image

detections

Output destination, filled by the native operation. array with detections' quadrangles (4 points per result)

detectTextRectangles

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.

detectTextRectangles(frame: Mat, detections: RotatedRectVector, confidences: FloatVector): void;
frame

the input image

detections

Output destination, filled by the native operation. array with detections' RotationRect results

confidences

Output destination, filled by the native operation. array with detection confidences

detectTextRectangles1

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.

detectTextRectangles1(frame: Mat, detections: RotatedRectVector): void;
frame

the input image

detections

Output destination, filled by the native operation. array with detections' RotationRect results

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.