Skip to content

How to Install via NuGet

shimat edited this page Sep 10, 2014 · 1 revision

日本語が読める方は、以下をどうぞ。

Nuget Packages

Both x86 and x64 OS are supported.

https://www.nuget.org/packages/OpenCvSharp-AnyCPU/

The NuGet package contains all native OpenCV libraries. You do not need to install OpenCV in advance.

Creating Visual Studio Project

Start Visual Studio (2012 or later). Create a new Console Application project.

Installing OpenCvSharp via Nuget

Open the NuGet Package Manager and search 'OpenCvSharp'.

NuGet Package Manager

You can also use the Package Manager Console. Type in the following command.

PM> Install-Package OpenCvSharp-AnyCPU

Execution

Type in the following code to Program.cs and execute.

using System;
using OpenCvSharp;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var img = new IplImage(@"C:\Lenna.png"))
            {
                Cv.SetImageROI(img, new CvRect(200, 200, 180, 200));
                Cv.Not(img, img);
                Cv.ResetImageROI(img);
                using (new CvWindow(img))
                {
                    Cv.WaitKey();
                }
            }
        }
    }
}

NuGet Package Manager

Clone this wiki locally