My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

OpenCvSharp

Description

OpenCvSharpは、OpenCVをC#やVB.NETなどの.NET Frameworkの言語から利用するためのクロスプラットフォームで動作するラッパーです。大部分はC#によって書かれています。OpenCvSharpを使うと、C#やVB.NETといった言語から、簡単に、かつ高速な画像処理プログラムを作成できます。

OpenCvSharp is a cross platform wrapper of OpenCV for .NET Framework written in C#. You can use many popular image processing and computer vision algorithms from C#, VB.NET, etc.

Please correct, when I use wrong English!!

Features

  • OpenCvSharpはSharperCVOpenCVDotNetといった他のOpenCVのラッパーよりも多くの関数を実装しています。
  • 多くのクラスがIDisposableインターフェイスを実装しているので、usingを使ってスタイリッシュなコードを記述できます。
  • オブジェクト指向な書き方を強制しません。OpenCVのネイティブの関数をそのままの形式で呼べます。
  • GDI+やWPFとの相互利用が可能です。OpenCVのIplImageとGDI+のBitmapやWPFのWriteableBitmapとの相互変換機能があります。
  • Monoに対応しています。LinuxやBSD, Mac OS X等のクロスプラットフォームで動作します。
  •  
  • OpenCvSharp wraps more OpenCV's functions than SharperCV and OpenCVDotNet.
  • Many classes of OpenCvSharp implement IDisposable. You can write stylish code by "using" statement.
  • OpenCvSharp does not force object-oriented programming style on you. You can also call native-style OpenCV functions.
  • OpenCvSharp provides functions for converting from IplImage into Bitmap(GDI+) or WriteableBitmap(WPF).
  • OpenCvSharp can work on Mono. Therefore it is able to run on any platform which Mono supports (e.g. Linux, BSD and Mac OS X).

Examples

以下のコードは、Cannyアルゴリズムによるエッジ検出のプログラムです。

The code below finds the edges on the input image using the Canny algorithm.

using System;
using OpenCvSharp;

class Program 
{
    static void Main() 
    {
        using (IplImage src = new IplImage("lenna.png", LoadMode.GrayScale))
        using (IplImage dst = new IplImage(src.Size, BitDepth.U8, 1)) 
        {
            src.Canny(dst, 50, 200);
            using (CvWindow window_src = new CvWindow("src image", src)) 
            using (CvWindow window_dst = new CvWindow("dst image", dst)) 
            {
                CvWindow.WaitKey();
            }
        }
    }
}

OpenCVのネイティブの関数形式のラッパーも用意しています。OpenCVに慣れている方でも扱いやすくなっています。既存のC/C++で書かれたコードからの翻訳も容易です。

Native-style functions are also available. Experienced OpenCV users can use OpenCvSharp easily.

using System;
using OpenCvSharp;

class Program 
{
    static void Main() 
    {
        IplImage src = Cv.LoadImage("lenna.png", LoadMode.GrayScale);
        IplImage dst = Cv.CreateImage(new CvSize(src.Width, src.Height), BitDepth.U8, 1);
        Cv.Canny(src, dst, 50, 200);
        Cv.NamedWindow("src image");  
        Cv.ShowImage("src image", src);
        Cv.NamedWindow("dst image");  
        Cv.ShowImage("dst image", dst);
        Cv.WaitKey();
        Cv.DestroyAllWindows();
        Cv.ReleaseImage(src);
        Cv.ReleaseImage(dst);          
    }
}

System Requirements

+ .NET Framework 2.0 or Mono
+ Visual C++ 2008 SP1 Redistributable Package and/or Visual C++ 2010 SP1 Redistributable Package
+ OpenCV 2.x / 1.1pre
You will need to download and install the OpenCV library from here.
Powered by Google Project Hosting