Skip to content

saliency_StaticSaliency

saliencyclassOpenCV 5.0.0
import { saliency_StaticSaliency } from '@banou/opencv-wasm'

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

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

Static Saliency Base Class ***********************************

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.

computeBinaryMap

This function perform a binary map of given saliency map. This is obtained in this way:

In a first step, to improve the definition of interest areas and facilitate identification of
targets, a segmentation by clustering is performed, using *K-means algorithm*. Then, to gain a
binary representation of clustered saliency map, since values of the map can vary according to
the characteristics of frame under analysis, it is not convenient to use a fixed threshold. So,

Otsu's algorithm* is used, which assumes that the image to be thresholded contains two classes of pixels or bi-modal histograms (e.g. foreground and back-ground pixels); later on, the algorithm calculates the optimal threshold separating those two classes, so that their intra-class variance is minimal.

computeBinaryMap(_saliencyMap: Mat, _binaryMap: Mat): boolean;
_saliencyMap

the saliency map obtained through one of the specialized algorithms

_binaryMap

Output destination, filled by the native operation. the binary map

Returns

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