Skip to content

ContourApproximationModes

Image processingclassOpenCV 5.0.0
import { ContourApproximationModes } from '@banou/opencv-wasm'

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

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

the contour approximation algorithm

Constructors and members

static CHAIN_CODE

ContourApproximationModes.CHAIN_CODE: TBD

CHAIN_CODE: ContourApproximationModesValue<0>,

static CHAIN_APPROX_NONE

stores absolutely all the contour points. That is, any 2 subsequent points (x1,y1) and (x2,y2) of the contour will be either horizontal, vertical or diagonal neighbors, that is, max(abs(x1-x2),abs(y2-y1))==1.

CHAIN_APPROX_NONE: ContourApproximationModesValue<1>,

static CHAIN_APPROX_SIMPLE

compresses horizontal, vertical, and diagonal segments and leaves only their end points. For example, an up-right rectangular contour is encoded with 4 points.

CHAIN_APPROX_SIMPLE: ContourApproximationModesValue<2>,

static CHAIN_APPROX_TC89_L1

applies one of the flavors of the Teh-Chin chain approximation algorithm [TehChin89]

CHAIN_APPROX_TC89_L1: ContourApproximationModesValue<3>,

static CHAIN_APPROX_TC89_KCOS

applies one of the flavors of the Teh-Chin chain approximation algorithm [TehChin89]

CHAIN_APPROX_TC89_KCOS: ContourApproximationModesValue<4>,

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.