Пример #1
0
        public static void DrawEllipse(IInputOutputArray image,
                                       RotatedRect box,
                                       MCvScalar color,
                                       int thickness     = 1,
                                       LineType lineType = LineType.EightConnected,
                                       int shift         = 0)
        {
            int   width    = (int)Math.Round(box.Size.Height * 0.5F);
            int   height   = (int)Math.Round(box.Size.Width * 0.5F);
            Size  axesSize = new Size(width, height);
            Point center   = Point.Round(box.Center);

            DrawEllipse(image, center, axesSize, box.Angle, 0.0D, 360.0D, color, thickness, lineType, shift);
        }
Пример #2
0
        public static PointF[] BoxPoints(RotatedRect box)
        {
            PointF[] pointsArray = new PointF[4];

            using (DisposableHandle arrayHandle = DisposableHandle.Alloc(pointsArray))
            {
                using (Mat arrayMat = new Mat(4, 2, DepthType.Cv32F, 1, arrayHandle, 8))
                {
                    using (OutputArray outArray = arrayMat.GetOutputArray())
                    {
                        cveBoxPoints(ref box, outArray);
                    }
                }
            }

            return(pointsArray);
        }
Пример #3
0
 private static extern void cveBoxPoints(ref RotatedRect box, IntPtr arrayPtr);