Table of Contents

Method FindHomography

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

FindHomography(InputArray, InputArray, HomographyMethods, double, OutputArray, int, double)

computes the best-fit perspective transformation mapping srcPoints to dstPoints.

public static Mat FindHomography(InputArray srcPoints, InputArray dstPoints, HomographyMethods method = HomographyMethods.None, double ransacReprojThreshold = 3, OutputArray mask = default, int maxIters = 2000, double confidence = 0.995)

Parameters

srcPoints InputArray

Coordinates of the points in the original plane, a matrix of the type CV_32FC2

dstPoints InputArray

Coordinates of the points in the target plane, a matrix of the type CV_32FC2

method HomographyMethods

Method used to computed a homography matrix.

ransacReprojThreshold double

Maximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only)

mask OutputArray

Optional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored.

maxIters int

The maximum number of RANSAC iterations.

confidence double

Confidence level, between 0 and 1.

Returns

Mat

FindHomography(IEnumerable<Point2d>, IEnumerable<Point2d>, HomographyMethods, double, OutputArray, int, double)

computes the best-fit perspective transformation mapping srcPoints to dstPoints.

[SuppressMessage("Maintainability", "CA1508: Avoid dead conditional code")]
public static Mat FindHomography(IEnumerable<Point2d> srcPoints, IEnumerable<Point2d> dstPoints, HomographyMethods method = HomographyMethods.None, double ransacReprojThreshold = 3, OutputArray mask = default, int maxIters = 2000, double confidence = 0.995)

Parameters

srcPoints IEnumerable<Point2d>

Coordinates of the points in the original plane

dstPoints IEnumerable<Point2d>

Coordinates of the points in the target plane

method HomographyMethods

Method used to computed a homography matrix.

ransacReprojThreshold double

Maximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only)

mask OutputArray

Optional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored.

maxIters int

The maximum number of RANSAC iterations.

confidence double

Confidence level, between 0 and 1.

Returns

Mat

FindHomography(InputArray, InputArray, OutputArray, UsacParams?)

computes the best-fit perspective transformation mapping srcPoints to dstPoints.

public static Mat FindHomography(InputArray srcPoints, InputArray dstPoints, OutputArray mask, UsacParams? @params)

Parameters

srcPoints InputArray

Coordinates of the points in the original plane, a matrix of the type CV_32FC2

dstPoints InputArray

Coordinates of the points in the target plane, a matrix of the type CV_32FC2

mask OutputArray

Optional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored.

params UsacParams

Returns

Mat

Exceptions

ArgumentNullException