C# Emgucv编写hello Word (一)

Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library. Allowing OpenCV functions to be called from .NET compatible languages. The wrapper can be compiled by Visual Studio and Unity, it can run on Windows, Linux, Mac OS, iOS and Android.

在netcore中编写hello Word

安装NUget 包
C# Emgucv编写hello Word (一)_第1张图片
编写代码

using System;
using System.Drawing;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;

namespace ConsoleApp_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            string winTest = "测试窗体(Test Windows 123)";
            CvInvoke.NamedWindow(winTest);
            Mat img = new Mat(200, 400, DepthType.Cv8U, 3);
            img.SetTo(new Bgr(255, 0, 0).MCvScalar);
            CvInvoke.PutText(img, "Hello Word", new Point(10, 80), FontFace.HersheyComplex, 1.0,new Bgr(0,255,0).MCvScalar);

            CvInvoke.Imshow(winTest, img);
            CvInvoke.WaitKey(0);
            CvInvoke.DestroyAllWindows();
        }
    }
}

运行结果:
C# Emgucv编写hello Word (一)_第2张图片

到此第一篇结束

你可能感兴趣的:(Emgucv,emgucv,OpenCV)