Skip to content

correctMatches

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

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

ARGUMENTSF, points1, points2, newPoints1
FUNCTIONcorrectMatches
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Refines coordinates of corresponding points.

correctMatches(F: Mat, points1: Mat, points2: Mat, newPoints1: Mat, newPoints2: Mat): void;
F

3x3 fundamental matrix.

points1

1xN array containing the first set of points.

points2

1xN array containing the second set of points.

newPoints1

Output destination, filled by the native operation. The optimized points1.

newPoints2

Output destination, filled by the native operation. The optimized points2.

The function implements the Optimal Triangulation Method (see Multiple View Geometry [HartleyZ00] for details). For each given point correspondence points1[i] <-> points2[i], and a fundamental matrix F, it computes the corrected correspondences newPoints1[i] <-> newPoints2[i] that minimize the geometric error d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2 (where d(a,b) is the geometric distance between points a and b ) subject to the epipolar constraint newPoints2^T \cdot F \cdot newPoints1 = 0 .

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.