Starting with Emgu CV

Shubham0987
Posted by in C# category on for Beginner level | Points: 250 | Views : 11234 red flag
Rating: 5 out of 5  
 1 vote(s)

This is a starters post which will guide how to configure the environment and visual studio to work with emgucv, emgu cv is a wrapper library for all the open cv functions.

What is Emgu CV ?

Before learning what is Emgu CV, one should know what is Open CV.

Open CV

It stands for Open Source Computer Vision, it was designed especially for computational efficiency with strong focus on real time applications.  It is written in optimized C/C++, and can take advantage of multi-core processing. In Image processing it has been a great boon for the developers.

Emgu CV

Its is essentially a huge library of "wrapper" functions that allows calling OpenCV funtions from Visual Studio Windows Form Application. It is necessary because Visual Studio/.NET is an "interpreted" environment that cannot directly call functions written in native C/C++.

In this tutorial we will start configuring our Visual Studio and environment for developing applications using EmguCV.

Firstly we need to download some the essential tools, we will be using the most stable versions though the new versions are also available.

  1. Visual Studio 2010 Express Edition
  2. Emgu CV (version 2.4.2 is available but had various issues so I'm doing it with the most stable version found 2.3.0)

Once you have installed all this it should work fine, but one common exception found is

The type initializer for 'Emgu.CV.CvInvoke' threw an exception.

If you see this exception, do following :

  • For Version 2.4+, the bundled OpenCV binary is build with Visual Studio 2010, you will needs to installed MSVCRT 10.0 SP1 x86 or MSVCRT 10.0 SP1 x64 to resolve the dependency issue.
  • For Version 2.0+, the bundled OpenCV binary is build with Visual Studio 2008, you will needs to installed MSVCRT 9.0 SP1 to resolve the dependency issue.
  • For Version 1.5, the bundled OpenCV pre1.1 binary is build with Visual Studio 2005, you will needs to installed MSVCRT 8.0 SP1 to resolve the dependency issue.

This is the most effective solution to the problem for the above exception, for others and detailed troubleshooting click here.

Now start the configuration part :

  1. We need to add a environment variable to the system variables.
    Right Click My Computer>Advanced System Settings>Environment Variables
    Under "System Variables" edit variable "path"
    add a semicolon(;) and the path to the emgu installation directory bin folder(by default it is C:\Emgu\emgucv-windows-x86 2.3.0.1416\bin
    system variables
  2. Now the environment is ready and we need to add the emgu custom controls to Visual Studio ToolBox
    In the toolbox, right click on General tab and select "choose items"
    Visual Studio ToolBox
  3. Select browse on bottom right corner and browse for "Emgu.CV.UI.dll" (it is located in bin folder of installation directory i.e C:\Emgu\emgucv-windows-x86 2.3.0.1416\bin)
  4. Now the Visual Studio will have the tools for emgu control
    Emgu Controls

 This is all required for setting up the environment for working with Emgu CV, in the next article we will learn how to create our first project with Emgu CV. Cheers :)

Page copy protected against web site content infringement by Copyscape

About the Author

Shubham0987
Full Name: Shubham Saxena
Member Level: Starter
Member Status: Member
Member Since: 12/26/2012 9:19:34 AM
Country: India
Shubham Saxena MSP, MVP - Mindcracker Founder - Developer Innovation Escalator
http://www.shubhamsaxena.com
I started my interest in IT sector from class 11th and from then I never stopped, cover page designing was my first step towards it. Then I started my organization for PHP web development. After entering my college life, I was elected as Microsoft Student Partner which was a great turning point in my life, now I'm also a Most Valuavle Professional (MVP) for Mindcracker Network. I also write blog. Application development and web development can be counted as my hobby, my organization now deals in technical trainings also.

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)