Method EstimateAffinePartial2D
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
EstimateAffinePartial2D(InputArray, InputArray, OutputArray, RobustEstimationAlgorithms, double, ulong, double, ulong)
Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
public static Mat? EstimateAffinePartial2D(InputArray from, InputArray to, OutputArray inliers = default, RobustEstimationAlgorithms method = RobustEstimationAlgorithms.RANSAC, double ransacReprojThreshold = 3, ulong maxIters = 2000, double confidence = 0.99, ulong refineIters = 10)
Parameters
fromInputArrayFirst input 2D point set.
toInputArraySecond input 2D point set.
inliersOutputArrayOutput vector indicating which points are inliers.
methodRobustEstimationAlgorithmsRobust method used to compute transformation.
ransacReprojThresholddoubleMaximum reprojection error in the RANSAC algorithm to consider a point as an inlier.Applies only to RANSAC.
maxItersulongThe maximum number of robust method iterations.
confidencedoubleConfidence level, between 0 and 1, for the estimated transformation. Anything between 0.95 and 0.99 is usually good enough.Values too close to 1 can slow down the estimation significantly.Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.
refineItersulong
Returns
- Mat
Output 2D affine transformation (4 degrees of freedom) matrix 2x3 or empty matrix if transformation could not be estimated.