gpt4 book ai didi

c# - 如何为 C# 窗口应用程序创建 opencv dll

转载 作者:太空宇宙 更新时间:2023-11-03 21:38:23 25 4
gpt4 key购买 nike

我需要将opencv(c/c++)程序转换成dll文件。我想在 c# windows 窗体应用程序中使用该 dll。

我尝试了一些网站给出的方法,但是在窗口窗体应用程序中添加引用时出现错误。

不知道哪里弄错了

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

}

最佳答案

这有帮助吗? 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.

因为你的程序不大,完全可以用C#重写。

关于c# - 如何为 C# 窗口应用程序创建 opencv dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10492505/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com