header photo

Level 0-EmguCV Installation Guide for 64-bit Windows users

February 27, 2013

LEARNING OBJECTIVE:


There are two options available, but the basic steps are same.
The 2 options  are summarized as below:

METHOD 1: Install the 32-bit version EmguCV on your 64-bit system – yes its possible AND more rewarding than method 2  ^_^
Benefits?

  1. Allows you to avoid the of 64-bit and 32-bit compatibility issues while following my code!
  2. Allows you to use MS Access database in your EmguCV project as well.

Drawbacks?
i haven't noticed any.yet.

METHOD 2: Install the 64-bit version EmguCV on your 64-bit system – what everyone usually does.
Benefits?

  1. ummm...it works perfectly well? :D

Drawbacks?

  1. you'll get the '64-bit and 32-bit compatibility issues' while following my code!
  2. your EmguCV project in these settings will be build to x64 platform, BUT if you need to use MS Access database in your same project then as well then Microsoft.Jet.OLEDB provider( that i use in my code) will NOT work. you'll have to use another provider to connect to the database, which works differently.

Now follow along the steps below, both options will be instructed, choose the method that suits you, and every time you get the option, always follow that method till the end of this tutorial

-----------------------------------------------------------------------------------------------------------------------------------------------

  1. Make sure you have Visual Studio C# installed (any edition, I’ve used Visual Studio 2010 Professional Edition on my 64-bit Win 7 Ultimate. So far so good.)

  2. Download EmguCV Installer/Folder: 

    select the method you're following
    1. For Method 1: Download 32-bit installer of EmguCV  – that’s RIGHT! I said 32-bit NOT 64-bit! Trust me, it’ll work if follow the next steps too. So yes you do not need 64-bit version at all. I use the following version:  libemgucv-windows-x86-2.2.1.1150.exe
    2. For Method 2: Download  64-bit installer of EmguCV  – you do not need 32-bit version at all. I use the following version: libemgucv-windows-x64-2.2.1.1150.zip  (note: this is not an executable one, you simply extract/unzip it to the directory(i.e path) where you would have originally install it,as in the next step)

    P.S: You could use any latest version instead, but i can't guarantee that my tutorials will work cent per cent same on it too. select your desired version here, or follow with mine as given above .

  3. Install EmguCV to windows OS directory.
    I installed/unzipped my setups (of same version of EmguCV) to the following path

    C:\Emgu\emgucv-windows-x86 2.2.1.1150\          <--- For Method 1 followers

    C:\Emgu\libemgucv-windows-x64-2.2.1.1150\      <--- For Method 2 followers
       
    'emgucv-windows-x86 2.2.1.1150'  or  'libemgucv-windows-x64-2.2.1.1150' is  just the name of the setup file. Depending on the version & installer you're using, if it's different than mine, adjust it according to YOUR setup file name please)

    Set Path of EmguCv at installation

  4. Install service pack to avoid platform dependency issue:
    Now,IF you already haven’t,  then Install MSVCRT 9.0 SP1 if you're using Emgucv 2.0+ (such as the one im using as given above)  ELSE if you’re using Emgucv 2.4 or above  MSVCRT 9.0 SP1 x86 or MSVCRT 9.0 SP1 x64
    NOTE: i installed both for various reasons

  5. Now Configure a project to test your installation:

    5.1. Open a 'C# windows form' project in visual studio:
    C
    reate a new one Or open an existing one, for example use this camera application i made to test if you're on the right track.
    NOTE: The test camera application i gave above, is intentionally left incomplete and erroneous .  As you perform the next steps on it, it'll become completely functioning - thereby making your  installation configuration test a success :)

    5.2. Set the target platform of your project:

    For Method 1 Followers: Open the .sln file of the project and set the target platform of your code tox86 as follows:

     photo oledbsol1.png

    and now follow this:

     photo oledbsol.png

    For Method 2 Followers:  you do not need to set the target platform . BUT IF, after you complete this tutorial, you still get an Emgu.CV.Invoke error or something, THEN Open the .sln file of the project and set the target platform of your project to x64 , similar to how its done in above 2 images. just remember you need to set it to x64, NOT x86!

    5.3. Debug your project - you'll probably get errors, for now, never mind them and stop debugging.

    5.4. Add the EmguCv's Unmanaged code to your project:
    The EmguCV's un-managed code is simply the opencv .dll files required for emgucv functions to work in your project so must be added to your project, here's how to do so:

    i. Open the bin folder of your installed EmguCV setup. For our this tutorial, its at the following path: 
             C:\Emgu\emgucv-windows-x86 2.2.1.1150\bin           <--- For Method 1 followers
             C:\Emgu\libemgucv-windows-x64-2.2.1.1150\bin      <--- For Method 2 followers

    ii. now copy the following .dll files from this bin folder to  your project’s DEBUG folder (that is the folder where .exe of your project is)


    In the project i gave, its DEBUG folder will then look like this:


    NOTE: above steps 5.2 and 5.4 are a PAIR and must be done together! I.e, on a 64 bit windows,
    If you follow method 1 and set target platform of your project to x86, then you HAVE to use the 32-bit .dll files!

    and instead, if you follow method 2, set the target platform to AnyCPU or x64  or not, either way you HAVE to use the 64-bit .dll files!
    (.dll files are originally located in the respective BIN folder of the EmguCV you have installed. as mentioned in step 4)

    5.5. Add the EmguCV References to your project:

    Now to use these dlls we added to our project, expand your project’s “References” from the “solution explorer” at right side of the IDE and then

        i. Right-click References and select "add reference"

        ii. Select the Browse tab
       
        iii. Select the .dll file you have to add - they are  Emgu.CV.dll, Emgu.CV.UI.dll  and Emgu.Util.dll

    Click ok. (you can select and add multiple .dll files at once by holding ctrl+click)

    The files should be added by now! see the Emgu.CV  , Emgu.CV.UI and Emgu.Util under References  similar to  the image below



    5.6. Now include the Emgucv headers
    into the code, as shown in image above, and then your code's ready set to call ^ use emgucv functions!

    5.7. Finally, Debug/ Run and your code should be error free and running! and if you have been using the test application i provided, then you'll have a live stream from webcam (attached to your system,if any) being displayed on the windows form.

  6. Congratulations! You just successfully configured your first EmguCV project!

  7. STILL GOT ERROR???  then watch this video:


 

--------------------------------------------------------------------------------------------------------------------------------------------------------------
IF YOU LIKE THIS TUTORIAL. PLEASE ENCOURAGE ME AND LEAVE A COMMENT BELOW :)

SEE YOU IN THE NEXT TUTORIAL :)

Go Back

thank you!

Sorry to ask you, i fell like i don't see something so obvious but I've to ask. When I run your example, says that there is a error with "Capture" and "Brg" and another 4 errors, and when i did an application following all your instructions, it works! so i guess is something with the program. I'm trying to do a real time face detector using Visual Basic. Also, thank you very much, sorry for the long post and my english, i'm not a native english speaker. I'll be waiting for your answer and keep doing what you do. :D

Great tutorial Mahvish! Thanks!

Hi, may I ask a question?
Its like this, my laptop has a USB capture card attached, I want to send the image from the USB capture card to the C# GUI. Is that possible?
Thankks!!

you been very helpful. thanks....

Thank you very much for your tutorials! =)

hello, nice tutorial but i am having a problem in changing the platform. i am using VS 2010 express edition on 64 bit windows and i followed ur steps of method 1 but i don't have any option of changing platform in "BUILD" though in active solution platform i set ANY CPU option... can u please tell me what's the problem or anyone else can help me..??i really need ur help. :(

I have done with platform target x64, it was done successfully, but if i give this exe to anyone alse,it will work right or make problems in other system??

It was very helpful for me
Thank you very much

thank you 2 much fantastic tutorial - thatnk yoooooooooooooou



Comment