c# - Emgu.CV在Windows 7 x64上不起作用

我的程序可以在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.

这个错误看起来像这样:

我正在使用来自Nuget的Emgu.CV库,名为:myEmguCV.Net。

即使我尝试只用以下命令创建新项目:
BackgroundSubtractorMOG2 pMog11 = new BackgroundSubtractorMOG2(0, 80, false);

我有错误..

最佳答案

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

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

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

所以去

项目->属性->生成->选中与非托管dll编译平台相匹配的平台(x86,x64)(在您的情况下,可能为x64)。

https://stackoverflow.com/questions/23725209/

相关文章:

docker - 无法在 Dockerfile 中运行 sysctl 命令

opencv - OpenCV旋转的图像显示时形状不正确

python - 使用OpenCV计数视频中的帧…(Python)

android - 在 JNI/Android 中初始化 C++ 对象一次

android - 如何使用静态OpenCV在Android中使用JavaCV的静态方法

docker - depends_on不等待docker-compose 1.22.0中的其他服务

docker - Docker端口映射在Windows 10上不起作用

python - GUI 卡住了其余的 python 代码

opencv - 更改图像opencv的宽度步长

python - 质心计算程序中的时间滞后