Skip to content

dnn_KeypointsModel

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

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

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

This class represents high-level API for keypoints models

KeypointsModel allows to set params for preprocessing input image. KeypointsModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and returns the x and y coordinates of each detected keypoint

Constructors and members

static new

Create keypoints 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_KeypointsModel;
2 available overloads
new(network: EmbindString): dnn_KeypointsModel;
new(model: EmbindString, config: EmbindString): dnn_KeypointsModel;
network

Net object.

model

Binary file contains trained weights.

config

Text file contains network configuration.

Returns

The dnn_KeypointsModel result.

static from1

Create an owned dnn_KeypointsModel instance with the supplied configuration.

This class represents high-level API for keypoints models

from1(_0: dnn_Net): dnn_KeypointsModel | null;
_0

0 argument (dnn_Net).

Returns

The dnn_KeypointsModel | 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.

estimate

Given the input frame, create input blob, run net

estimate(frame: Mat, thresh: number): Point2fVector;
2 available overloads
estimate(frame: Mat): Point2fVector;
estimate(frame: Mat, thresh: number): Point2fVector;
frame

The input image.

thresh

minimum confidence threshold to select a keypoint

Returns

a vector holding the x and y coordinates of each detected keypoint Release returned native handles with using or delete(), including handles nested in 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.