Emgu.CV.CvInvoke.cvMinAreaRect2 C# (CSharp) Метод

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

private cvMinAreaRect2 ( IntPtr points, IntPtr storage ) : MCvBox2D
points IntPtr
storage IntPtr
Результат MCvBox2D
        public static extern MCvBox2D cvMinAreaRect2(IntPtr points, IntPtr storage);

Usage Example

Пример #1
0
        /// <summary>
        /// Find the bounding rectangle for the specific array of points
        /// </summary>
        /// <param name="points">The collection of points</param>
        /// <returns>The bounding rectangle for the array of points</returns>
        public static MCvBox2D MinAreaRect(PointF[] points)
        {
            IntPtr   seq    = Marshal.AllocHGlobal(StructSize.MCvContour);
            IntPtr   block  = Marshal.AllocHGlobal(StructSize.MCvSeqBlock);
            GCHandle handle = GCHandle.Alloc(points, GCHandleType.Pinned);

            CvInvoke.cvMakeSeqHeaderForArray(
                CvInvoke.CV_MAKETYPE((int)CvEnum.MAT_DEPTH.CV_32F, 2),
                StructSize.MCvSeq,
                StructSize.PointF,
                handle.AddrOfPinnedObject(),
                points.Length,
                seq,
                block);
            MCvBox2D rect = CvInvoke.cvMinAreaRect2(seq, IntPtr.Zero);

            handle.Free();
            Marshal.FreeHGlobal(seq);
            Marshal.FreeHGlobal(block);
            return(rect);
        }
All Usage Examples Of Emgu.CV.CvInvoke::cvMinAreaRect2
CvInvoke