opencv_imgproc.dll抛出BadImageFormatException

时间:2012-11-01 04:27:10

标签: c# opencv emgucv badimageformatexception

我正在使用Emgu CV(用于x64)构建图像处理应用程序,我想在图像上使用过滤功能。所以,我使用opencv_imgproc.dll但它会抛出BadImageFormatException

Solution Platform : x86 
Operating System : Windows 7 - 64
Language: C# 
IDE: Visual C# 2010 express 

1 个答案:

答案 0 :(得分:1)

Emgu是OpenCV的托管包装器。由于OpenCV是不受管理的,因此您需要确保使用正在使用的Emgu版本的正确设置进行编译。

基于评论中发布的异常(http://pastie.org/5170481http://pastie.org/5170499供参考),正在编译的Emgu版本是x86版本,这意味着它依赖的OpenCV DLL需要是编译为32位。要运行代码,无论运行的操作系统的位数如何,项目的Build设置中的Platform target都需要设置为x86

要使用64位版本的Emgu,您需要下载为64位编译的版本(您可以看到不同的选项here) 然后将Platform target设置为x64

相关问题