Skip to content

matchShapes

geometryfunctionOpenCV 5.0.0
import { matchShapes } from '@banou/opencv-wasm'

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

Compares two shapes.

The function compares two shapes. All three implemented methods use the Hu invariants (see #HuMoments)

matchShapes(contour1: Mat, contour2: Mat, method: number, parameter: number): number;
contour1

First contour or grayscale image.

contour2

Second contour or grayscale image.

method

Comparison method, see #ShapeMatchModes

parameter

Method-specific parameter (not supported now).

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.