Skip to content

HausdorffDistanceExtractor

shapeclassOpenCV 5.0.0
import { HausdorffDistanceExtractor } from '@banou/opencv-wasm'

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

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

A simple Hausdorff distance measure between shapes defined by contours

according to the paper "Comparing Images using the Hausdorff distance." by D.P. Huttenlocher, G.A. Klanderman, and W.J. Rucklidge. (PAMI 1993). :

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.

setDistanceFlag

Set the norm used to compute the Hausdorff value between two shapes. It can be L1 or L2 norm.

setDistanceFlag(distanceFlag: number): void;
distanceFlag

Flag indicating which norm is used to compute the Hausdorff distance (NORM_L1, NORM_L2).

getDistanceFlag

Read the distance flag.

Set the norm used to compute the Hausdorff value between two shapes. It can be L1 or L2 norm.

getDistanceFlag(): number;
Returns

The number result.

setRankProportion

This method sets the rank proportion (or fractional value) that establish the Kth ranked value of the partial Hausdorff distance. Experimentally had been shown that 0.6 is a good value to compare shapes.

setRankProportion(rankProportion: number): void;
rankProportion

fractional value (between 0 and 1).

getRankProportion

Read the rank proportion.

This method sets the rank proportion (or fractional value) that establish the Kth ranked value of the partial Hausdorff distance. Experimentally had been shown that 0.6 is a good value to compare shapes.

getRankProportion(): 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.