コード例 #1
0
ファイル: Drawing.cs プロジェクト: valerysntx/dot-imaging
 /// <summary>
 /// Draws ellipse.
 /// </summary>
 /// <param name="image">Input image.</param>
 /// <param name="ellipse">Ellipse.</param>
 /// <param name="color">Object's color.</param>
 /// <param name="thickness">Border thickness (-1 to fill the object).</param>
 /// <param name="opacity">Sets alpha channel where 0 is transparent and 255 is full opaque.</param>
 public unsafe static void Draw(this Bgr <byte>[,] image, Ellipse ellipse, Bgr <byte> color, int thickness, byte opacity = Byte.MaxValue)
 {
     draw(image, opacity, cvImg =>
     {
         CvCoreInvoke.cvEllipse(&cvImg, ellipse.Center.Round(), Size.Round(ellipse.Size), ellipse.Angle,
                                0, 360, color.ToCvScalar(), thickness, LineTypes.EightConnected, 0);
     });
 }
コード例 #2
0
ファイル: Drawing.cs プロジェクト: kthulhu/dot-imaging
 /// <summary>
 /// Draws ellipse.
 /// </summary>
 /// <param name="image">Input image.</param>
 /// <param name="ellipse">Ellipse.</param>
 /// <param name="color">Object's color.</param>
 /// <param name="thickness">Border thickness.</param>
 public unsafe static void Draw(this Bgr <byte>[,] image, Ellipse ellipse, Bgr <byte> color, int thickness)
 {
     using (var img = image.Lock())
     {
         var iplImage = img.AsCvIplImage();
         CvCoreInvoke.cvEllipse(&iplImage, ellipse.Center.Round(), Size.Round(ellipse.Size), ellipse.Angle,
                                0, 2 * System.Math.PI, color.ToCvScalar(), thickness, LineTypes.EightConnected, 0);
     }
 }