我下载了用于Raspberry Pi 2的Emgucv,当我尝试使用此cmd运行应用程序时,有一些示例项目
mono /home/pi/Downloads/libEmgu/usr/bin/Example.HelloWorld.monoexe
我得到了例外
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.CvInvoke ---> System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.Util.Platform ---> System.DllNotFoundException: c
at (wrapper managed-to-native) Emgu.Util.Platform:uname (intptr)
at Emgu.Util.Platform..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.GetModuleFormatString () [0x00000] in <filename unknown>:0
at Emgu.CV.CvInvoke..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at HelloWorld.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.CvInvoke ---> System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.Util.Platform ---> System.DllNotFoundException: c
at (wrapper managed-to-native) Emgu.Util.Platform:uname (intptr)
at Emgu.Util.Platform..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.GetModuleFormatString () [0x00000] in <filename unknown>:0
at Emgu.CV.CvInvoke..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at HelloWorld.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
任何人都可以帮助指导如何使用opencv运行应用程序。
答案 0 :(得分:0)
未找到Emgu CV本机库:
System.TypeInitializationException:抛出异常 emgu.CV.CvInvoke的类型初始值设定项---&gt; System.TypeInitializationException:抛出异常 emgu.Util.Platform的类型初始值设定项---&gt;
System.DllNotFoundException:
安装完&amp;编译Emgv CV(不仅仅是C#包装器代码,还包括CPP代码),在Linux上你需要告诉Mono
运行时它可以找到本机库(即使它们与C#位于同一目录中)组件):
cd bin
在你的情况下:
cd /home/pi/Downloads/libEmgu/usr/bin/
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
mono Example.HelloWorld.monoexe
请参阅以下链接以获取更多详细信息:http://www.emgu.com/wiki/index.php/Download_And_Installation#Build_the_binary