Emgu.CV不适用于Windows 7 x64

时间:2014-05-18 18:05:30

标签: c# opencv emgucv

我的程序在我的Windows 8 x64中运行良好。但是,当我尝试在Windows 7 x64的笔记本电脑上运行它时,我遇到了一些问题。

错误:

A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: URI formats are not supported.

A first chance exception of type 'System.BadImageFormatException' occurred in Emgu.CV.dll
Additional information: You tried to load the wrong format. (Excluded from the HRESULT: 0x8007000B)

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Target call threw an exception.

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Target call threw an exception.

'InzV2.vshost.exe' (CLR v4.0.30319: InzV2.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml.resources\v4.0_4.0.0.0_pl_b77a5c561934e089\System.Xaml.resources.dll'. Module was built without symbols.
A first chance exception of type 'System.Xaml.XamlObjectWriterException' occurred in System.Xaml.dll
Additional information:Calling the constructor for the type of „InzV2.MainWindow” compatible with specific binding constraints caused an exception.

A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: Calling the constructor for the type of „InzV2.MainWindow” compatible with specific binding constraints caused an exception., line number 3, position 9.

An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: Calling the constructor for the type of „InzV2.MainWindow” compatible with specific binding constraints caused an exception., line number 3, position 9.

这个错误看起来像这样: enter image description here

我使用Nuget的Emgu.CV lib调用:myEmguCV.Net。

即使我只尝试克里特新项目:

BackgroundSubtractorMOG2 pMog11 = new BackgroundSubtractorMOG2(0, 80, false);

我有错误..

1 个答案:

答案 0 :(得分:1)

当为不同的平台编译非托管程序集时,会发生此错误,而不是当前正在编译.NET代码。

例如,如果非托管dll在x86架构中并且您尝试将代码编译为x64 .NET运行时,则会出现此类错误。

在您提供的图像中,您似乎正在尝试将代码编译为x86体系结构,而您的EmguCV非托管.dll可能基于x64。

所以转到

项目 - >属性 - >构建 - >勾选与编译非托管dll的平台匹配的平台(x86,x64)(可能在你的情况下应该是x64)。