aranga
aranga

Reputation: 377

How to create a opencv dll for c# window application

I need to convert the opencv (c /c++) program into a dll file. I want to use that dll in c# windows form Application.

I tried some methods which is given given by some sites but while adding the references in window forms applications I got an error.

I don't know where made a mistake.

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

Here with I have attached my sample code. Please help me.

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);

}

Upvotes: 2

Views: 3180

Answers (1)

sschrass
sschrass

Reputation: 7156

this helps? http://www.emgu.com/wiki/index.php/Main_Page

Emgu CV is a cross platform .Net wrapper to the Intel OpenCV image processing library. Allowing OpenCV functions to be called from .NET compatible languages such as C#, VB, VC++, IronPython etc.

Since your program is not that big, you can rewrite it entierly in C#.

Upvotes: 2

Related Questions