2

opencv (c /c++) プログラムを dll ファイルに変換する必要があります。その dll を C# Windows フォーム アプリケーションで使用したいと考えています。

一部のサイトで提供されている方法をいくつか試しましたが、ウィンドウフォームアプリケーションに参照を追加しているときにエラーが発生しました。

どこで間違えたのかわからない。

A reference to “D:\WindowsFormApplication4\windowsForrmsApllications4\bin\debug\testdll.dll”
Could not be added. Please make sure that the file is accessible and that it is a valid assembly or COM Component

ここにサンプルコードを添付しました。私を助けてください。

Void  main(const char*filename)
{
if  (filename ==0)
    {
        printf("The image not loaded\n");
        return -1;
    }
    IplImage* input_im = 0; 
    input_im = cvLoadImage(filename);
    cvNamedWindow("InputImage",CV_WINDOW_AUTOSIZE);
    cvShowImage("InputImage",input_im);
    cvWaitKey(0);
    cvDestroyWindow("InputImage");
    cvReleaseImage(&input_im);

}
4

1 に答える 1

2

これは役立ちますか?http://www.emgu.com/wiki/index.php/Main_Page

Emgu CV は、Intel OpenCV 画像処理ライブラリのクロス プラットフォーム .Net ラッパーです。C#、VB、VC++、IronPython などの .NET 互換言語から OpenCV 関数を呼び出せるようにします。

プログラムはそれほど大きくないので、C# で全体を書き直すことができます。

于 2012-05-08T06:06:01.973 に答える