Skip to content

findFundamentalMat1

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

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

ARGUMENTSpoints1, points2, method, ransacReprojThreshold
FUNCTIONfindFundamentalMat1
RETURN TYPEMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

example: samples/cpp/snippets/epipolar_lines.cpp An example using the findFundamentalMat function Calculates a fundamental matrix from the corresponding points in two images.

    // Example. Estimation of fundamental matrix using the RANSAC algorithm
    int point_count = 100;
    vector<Point2f> points1(point_count);
    vector<Point2f> points2(point_count);

    // initialize the points here ...
    for( int i = 0; i < point_count; i++ )
    {
        points1[i] = ...;
        points2[i] = ...;
    }

    Mat fundamental_matrix =
     findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);
findFundamentalMat1(points1: Mat, points2: Mat, method: number, ransacReprojThreshold: number, confidence: number, mask: Mat): Mat;
5 available overloads
findFundamentalMat1(points1: Mat, points2: Mat): Mat;
findFundamentalMat1(points1: Mat, points2: Mat, method: number): Mat;
findFundamentalMat1(points1: Mat, points2: Mat, method: number, ransacReprojThreshold: number): Mat;
findFundamentalMat1(points1: Mat, points2: Mat, method: number, ransacReprojThreshold: number, confidence: number): Mat;
findFundamentalMat1(points1: Mat, points2: Mat, method: number, ransacReprojThreshold: number, confidence: number, mask: Mat): Mat;
points1

Array of N points from the first image. The point coordinates should be floating-point (single or double precision).

points2

Array of the second image points of the same size and format as points1 .

method

Method for computing a fundamental matrix.

  • FM_7POINT for a 7-point algorithm. N = 7
  • FM_8POINT for an 8-point algorithm. N \ge 8
  • FM_RANSAC for the RANSAC algorithm. N \ge 8
  • FM_LMEDS for the LMedS algorithm. N \ge 8
ransacReprojThreshold

Parameter used only for RANSAC. It is the maximum distance from a point to an epipolar line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise.

confidence

Parameter used for the RANSAC and LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.

mask

Output destination, filled by the native operation. optional output mask

Returns

The Mat result. Release returned native handles with using or delete(), including handles nested in results.

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.