Exemple #1
0
 /// <summary>
 /// Draws text on the provided image.
 /// </summary>
 /// <param name="image">Input image.</param>
 /// <param name="text">User text.</param>
 /// <param name="font">Font.</param>
 /// <param name="botomLeftPoint">Bottom-left point.</param>
 /// <param name="color">Text color.</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, string text, Font font, Point botomLeftPoint, Bgr <byte> color, byte opacity = Byte.MaxValue)
 {
     draw(image, opacity, cvImg =>
     {
         CvCoreInvoke.cvPutText(&cvImg, text, botomLeftPoint, ref font, color.ToCvScalar());
     });
 }
Exemple #2
0
 /// <summary>
 /// Draws text on the provided image.
 /// </summary>
 /// <param name="image">Input image.</param>
 /// <param name="text">User text.</param>
 /// <param name="font">Font.</param>
 /// <param name="botomLeftPoint">Bottom-left point.</param>
 /// <param name="color">Text color.</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, string text, Font font, Point botomLeftPoint, Bgr <byte> color, byte opacity = Byte.MaxValue)
 {
     using (var img = image.Lock())
     {
         var iplImage = img.AsCvIplImage();
         CvCoreInvoke.cvPutText(&iplImage, text, botomLeftPoint, ref font, color.ToCvScalar());
     }
 }