Skip to content

dnn_TextDetectionModel_DB

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

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

ARGUMENTSConstructor or factory
CLASSdnn_TextDetectionModel_DB
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_TextDetectionModel.

This class represents high-level API for text detection DL networks compatible with DB model.

Related publications: [liao2020real] Paper: https://arxiv.org/abs/1911.08947 For more information about the hyper-parameters setting, please refer to https://github.com/MhLiao/DB

Configurable parameters:

  • (float) binaryThreshold - The threshold of the binary map. It is usually set to 0.3.
  • (float) polygonThreshold - The threshold of text polygons. It is usually set to 0.5, 0.6, and 0.7. Default is 0.5f
  • (double) unclipRatio - The unclip ratio of the detected text region, which determines the output size. It is usually set to 2.0.
  • (int) maxCandidates - The max number of the output results.

Constructors and members

static new

Create text detection model from network represented in one of the supported formats. An order of model and config arguments does not matter.

new(model: EmbindString, config: EmbindString): dnn_TextDetectionModel_DB;
2 available overloads
new(network: dnn_Net): dnn_TextDetectionModel_DB;
new(model: EmbindString, config: EmbindString): dnn_TextDetectionModel_DB;
network

Net object.

model

Binary file contains trained weights.

config

Text file contains network configuration.

Returns

The dnn_TextDetectionModel_DB result.

static from1

Create an owned dnn_TextDetectionModel_DB instance with the supplied configuration.

This class represents high-level API for text detection DL networks compatible with DB model.

from1(_0: EmbindString): dnn_TextDetectionModel_DB | null;
_0

0 argument (EmbindString).

Returns

The dnn_TextDetectionModel_DB | null result.

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.

setBinaryThreshold

Set the binary threshold used by this dnn_TextDetectionModel_DB object.

setBinaryThreshold(binaryThreshold: number): dnn_TextDetectionModel_DB;
binaryThreshold

binary threshold argument (number).

Returns

The dnn_TextDetectionModel_DB result.

getBinaryThreshold

Return the binary threshold configured on this dnn_TextDetectionModel_DB object.

getBinaryThreshold(): number;
Returns

The number result.

setPolygonThreshold

Set the polygon threshold used by this dnn_TextDetectionModel_DB object.

setPolygonThreshold(polygonThreshold: number): dnn_TextDetectionModel_DB;
polygonThreshold

polygon threshold argument (number).

Returns

The dnn_TextDetectionModel_DB result.

getPolygonThreshold

Return the polygon threshold configured on this dnn_TextDetectionModel_DB object.

getPolygonThreshold(): number;
Returns

The number result.

setUnclipRatio

Set the unclip ratio used by this dnn_TextDetectionModel_DB object.

setUnclipRatio(unclipRatio: number): dnn_TextDetectionModel_DB;
unclipRatio

unclip ratio argument (number).

Returns

The dnn_TextDetectionModel_DB result.

getUnclipRatio

Return the unclip ratio configured on this dnn_TextDetectionModel_DB object.

getUnclipRatio(): number;
Returns

The number result.

setMaxCandidates

Set the max candidates used by this dnn_TextDetectionModel_DB object.

setMaxCandidates(maxCandidates: number): dnn_TextDetectionModel_DB;
maxCandidates

max candidates argument (number).

Returns

The dnn_TextDetectionModel_DB result.

getMaxCandidates

Return the max candidates configured on this dnn_TextDetectionModel_DB object.

getMaxCandidates(): number;
Returns

The number result.

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.