将opencv代码与c#代码结合 [英] combine opencv code with c# code
问题描述
我需要将opencv(c/c ++)程序转换为dll文件.我想在C#Windows窗体应用程序中使用该dll.
我尝试了一些网站提供的方法,但是在窗口窗体应用程序中添加引用时出现错误.
这是我的程序
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 by some sites but while adding the references in window forms applications I got an error.
This is my program
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
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);
}
当我编译该程序时,编译不会出错.但是当我尝试调试时,它显示错误为跟随错误-无法启动程序''c:\ users \ my \ destop \ cam \ estlib.dill
我不知道哪里出了错.请帮助我
谢谢
When i complied this program its compile within not errors. But When i strated to debugging it shows error as follow error - Unable to start program ''c:\users\my\destop\cam\estlib.dill
I don''t know where made a mistake.Please help me
Thank you
推荐答案
您应该看一下Emgu CV库,它基本上已经满足了您的需求:
http://www.emgu.com/wiki/index.php/Main_Page [ ^ ]
You should have a look at the Emgu CV library which basically already does what you need:
http://www.emgu.com/wiki/index.php/Main_Page[^]
这篇关于将opencv代码与c#代码结合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!