cvFindChessboardCorners() приватный Метод

private cvFindChessboardCorners ( IntPtr image, Size patternSize, IntPtr corners, int &cornerCount, CvEnum flags ) : int
image IntPtr
patternSize Size
corners IntPtr
cornerCount int
flags CvEnum
Результат int
Пример #1
0
        /// <summary>
        /// Attempts to determine whether the input image is a view of the chessboard pattern and locate internal chessboard corners
        /// </summary>
        /// <param name="image">Source chessboard view</param>
        /// <param name="patternSize">The number of inner corners per chessboard row and column</param>
        /// <param name="flags">Various operation flags</param>
        /// <returns>The corners detected if the chess board pattern is found, otherwise null is returned</returns>
        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);
        }