Method FindFundamentalMat
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
FindFundamentalMat(InputArray, InputArray, FundamentalMatMethods, double, double, OutputArray)
Calculates a fundamental matrix from the corresponding points in two images.
public static Mat FindFundamentalMat(InputArray points1, InputArray points2, FundamentalMatMethods method = FundamentalMatMethods.Ransac, double param1 = 3, double param2 = 0.99, OutputArray mask = default)
Parameters
points1InputArrayArray of N points from the first image. The point coordinates should be floating-point (single or double precision).
points2InputArrayArray of the second image points of the same size and format as points1 .
methodFundamentalMatMethodsMethod for computing a fundamental matrix.
param1doubleParameter used 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.
param2doubleParameter used for the RANSAC or LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.
maskOutputArrayOutput array of N elements, every element of which is set to 0 for outliers and to 1 for the other points. The array is computed only in the RANSAC and LMedS methods. For other methods, it is set to all 1’s.
Returns
- Mat
fundamental matrix
FindFundamentalMat(IEnumerable<Point2f>, IEnumerable<Point2f>, FundamentalMatMethods, double, double, OutputArray)
Calculates a fundamental matrix from the corresponding points in two images.
[SuppressMessage("Maintainability", "CA1508: Avoid dead conditional code")]
public static Mat FindFundamentalMat(IEnumerable<Point2f> points1, IEnumerable<Point2f> points2, FundamentalMatMethods method = FundamentalMatMethods.Ransac, double param1 = 3, double param2 = 0.99, OutputArray mask = default)
Parameters
points1IEnumerable<Point2f>Array of N points from the first image. The point coordinates should be floating-point (single or double precision).
points2IEnumerable<Point2f>Array of the second image points of the same size and format as points1 .
methodFundamentalMatMethodsMethod for computing a fundamental matrix.
param1doubleParameter used 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.
param2doubleParameter used for the RANSAC or LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.
maskOutputArrayOutput array of N elements, every element of which is set to 0 for outliers and to 1 for the other points. The array is computed only in the RANSAC and LMedS methods. For other methods, it is set to all 1’s.
Returns
- Mat
fundamental matrix
FindFundamentalMat(IEnumerable<Point2d>, IEnumerable<Point2d>, FundamentalMatMethods, double, double, OutputArray)
Calculates a fundamental matrix from the corresponding points in two images.
[SuppressMessage("Maintainability", "CA1508: Avoid dead conditional code")]
public static Mat FindFundamentalMat(IEnumerable<Point2d> points1, IEnumerable<Point2d> points2, FundamentalMatMethods method = FundamentalMatMethods.Ransac, double param1 = 3, double param2 = 0.99, OutputArray mask = default)
Parameters
points1IEnumerable<Point2d>Array of N points from the first image. The point coordinates should be floating-point (single or double precision).
points2IEnumerable<Point2d>Array of the second image points of the same size and format as points1 .
methodFundamentalMatMethodsMethod for computing a fundamental matrix.
param1doubleParameter used 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.
param2doubleParameter used for the RANSAC or LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.
maskOutputArrayOutput array of N elements, every element of which is set to 0 for outliers and to 1 for the other points. The array is computed only in the RANSAC and LMedS methods. For other methods, it is set to all 1’s.
Returns
- Mat
fundamental matrix
FindFundamentalMat(InputArray, InputArray, OutputArray, UsacParams?)
Calculates a fundamental matrix from the corresponding points in two images, using the USAC robust estimation framework (OpenCV 5).
public static Mat FindFundamentalMat(InputArray points1, InputArray points2, OutputArray mask, UsacParams? @params)
Parameters
points1InputArrayArray of N points from the first image.
points2InputArrayArray of the second image points of the same size and format as points1.
maskOutputArrayOutput array of N elements; every element marks an inlier (1) or outlier (0).
paramsUsacParamsUSAC parameters. Null uses the defaults.
Returns
- Mat
The estimated fundamental matrix.