Emgu.CV.CameraCalibration.FindChessboardCorners C# (CSharp) Метод

FindChessboardCorners() публичный статический Метод

Attempts to determine whether the input image is a view of the chessboard pattern and locate internal chessboard corners
public static FindChessboardCorners ( Byte>.Image image, Size patternSize, CvEnum flags ) : System.Drawing.PointF[]
image Byte>.Image Source chessboard view
patternSize System.Drawing.Size The number of inner corners per chessboard row and column
flags CvEnum Various operation flags
Результат System.Drawing.PointF[]
        public static PointF[] FindChessboardCorners(
         Image<Gray, Byte> image,
         Size patternSize,
         CvEnum.CALIB_CB_TYPE flags)
        {
            int cornerCount = 0;

             PointF[] corners = new PointF[patternSize.Width * patternSize.Height];
             GCHandle handle = GCHandle.Alloc(corners, GCHandleType.Pinned);

             bool patternFound =
            CvInvoke.cvFindChessboardCorners(
               image.Ptr,
               patternSize,
               handle.AddrOfPinnedObject(),
               ref cornerCount,
               flags) != 0;

             handle.Free();

             if (cornerCount != corners.Length)
            Array.Resize(ref corners, cornerCount);

             return patternFound ? corners : null;
        }