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
srcPointsInputArrayCoordinates of the points in the original plane, a matrix of the type CV_32FC2
dstPointsInputArrayCoordinates of the points in the target plane, a matrix of the type CV_32FC2
methodHomographyMethodsMethod used to computed a homography matrix.
ransacReprojThresholddoubleMaximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only)
maskOutputArrayOptional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored.
maxItersintThe maximum number of RANSAC iterations.
confidencedoubleConfidence level, between 0 and 1.
Returns
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
srcPointsIEnumerable<Point2d>Coordinates of the points in the original plane
dstPointsIEnumerable<Point2d>Coordinates of the points in the target plane
methodHomographyMethodsMethod used to computed a homography matrix.
ransacReprojThresholddoubleMaximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only)
maskOutputArrayOptional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored.
maxItersintThe maximum number of RANSAC iterations.
confidencedoubleConfidence level, between 0 and 1.
Returns
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
srcPointsInputArrayCoordinates of the points in the original plane, a matrix of the type CV_32FC2
dstPointsInputArrayCoordinates of the points in the target plane, a matrix of the type CV_32FC2
maskOutputArrayOptional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored.
paramsUsacParams