Using Emgu CV in x64 based Windows 8 computer

0. Environment

Windows 8 Enterprice x64 En

Visual studio Ultimate 2012

Emgu CV 2.4.2.1777 (libemgucv-windows-x86-gpu-2.4.2.1777.exe, http://www.emgu.com/wiki/index.php/Main_Page)

1. Steps

1.1 Install Emgu by double click the exe file, and we will install Emgu in C:\Emgu\emgucv-windows-x86-gpu-2.4.2.1777 folder

1.2 Add "C:\Emgu\emgucv-windows-x86-gpu-2.4.2.1777\bin;C:\Emgu\emgucv-windows-x86-gpu-2.4.2.1777\bin\x86" to your "Environment Variables"'s "Path"

1.3 Download a "nvcuda.dll" file from the web, and put it in the "C:\Emgu\emgucv-windows-x86-gpu-2.4.2.1777\bin\x86" folder, after this you could run "cvextern_test.exe" in the same folder

1.4 Open Visual studio and create a C# Console Application or other type of application

1.5 Browse and add "Emgu.CV.dll, Emgu.CV.ML.dll, Emgu.CV.UI.dll, Emgu.Util.dll, ZedGraph.dll" to your project "References"

1.6 Change your project "Platform target" to "x86" in "Properties -> Build -> General"

1.7 Add the following code to your Main function and run it
IntPtr image = CvInvoke.cvCreateImage(new System.Drawing.Size(400, 300), IPL_DEPTH.IPL_DEPTH_8U, 1);

Ps: don't forget using the namespace
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.CvEnum;
using System.Drawing;//in System.Drawing.dll

2. Errors

2.1 Error 1

The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
Unable to load DLL 'opencv_core242': The specified module could not be found.

Solution: 1.2 and 1.3

2.2 Error 2

The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
An attempt was made to load a program with an incorrect format.

Solution: 1.6

3. References

http://blog.csdn.net/fengbingchun/article/details/8235499

http://blog.csdn.net/mengze914/article/details/8281295

 

(This article is from http://www.cnblogs.com/chenyineng/archive/2012/12/30/2840108.html, and belongs to http://chenyineng.cnblogs.com and http://www.chenyineng.info)

posted @ 2012-12-30 23:34  Yineng  阅读(1685)  评论(0编辑  收藏  举报
Homepage: www.chenyineng.info
Copyright 2010 - 2014 Yineng Chen. All rights reserved.