findFundamentalMat1
import { findFundamentalMat1 } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;points1Array of N points from the first image. The point coordinates should be floating-point (single or double precision).
points2Array of the second image points of the same size and format as points1 .
methodMethod for computing a fundamental matrix.
FM_7POINTfor a 7-point algorithm.N = 7FM_8POINTfor an 8-point algorithm.N \ge 8FM_RANSACfor the RANSAC algorithm.N \ge 8FM_LMEDSfor the LMedS algorithm.N \ge 8
ransacReprojThresholdParameter 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.
confidenceParameter used for the RANSAC and LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.
maskOutput destination, filled by the native operation. optional output mask
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.