OpenCvSharp.Cv2.CornerSubPix C# (CSharp) Method

CornerSubPix() public static method

adjusts the corner locations with sub-pixel accuracy to maximize the certain cornerness criteria
public static CornerSubPix ( InputArray image, IEnumerable inputCorners, Size winSize, Size zeroZone, OpenCvSharp.TermCriteria criteria ) : Point2f[]
image InputArray Input image.
inputCorners IEnumerable Initial coordinates of the input corners and refined coordinates provided for output.
winSize Size Half of the side length of the search window.
zeroZone Size Half of the size of the dead region in the middle of the search zone /// over which the summation in the formula below is not done. It is used sometimes to avoid possible singularities /// of the autocorrelation matrix. The value of (-1,-1) indicates that there is no such a size.
criteria OpenCvSharp.TermCriteria Criteria for termination of the iterative process of corner refinement. /// That is, the process of corner position refinement stops either after criteria.maxCount iterations /// or when the corner position moves by less than criteria.epsilon on some iteration.
return Point2f[]
        public static Point2f[] CornerSubPix(InputArray image, IEnumerable<Point2f> inputCorners,
            Size winSize, Size zeroZone, TermCriteria criteria)
        {
            if (image == null)
                throw new ArgumentNullException(nameof(image));
            if (inputCorners == null)
                throw new ArgumentNullException(nameof(inputCorners));
            image.ThrowIfDisposed();

            var inputCornersSrc = EnumerableEx.ToArray(inputCorners);
            var inputCornersCopy = new Point2f[inputCornersSrc.Length];
            Array.Copy(inputCornersSrc, inputCornersCopy, inputCornersSrc.Length);
            using (var vector = new VectorOfPoint2f(inputCornersCopy))
            {
                NativeMethods.imgproc_cornerSubPix(image.CvPtr, vector.CvPtr, winSize, zeroZone, criteria);
                GC.KeepAlive(image);
                return vector.ToArray();
            }
        }
        #endregion
Cv2