Difference between revisions of "Download And Installation"

From Emgu CV: OpenCV in .NET (C#, VB, C++ and more)
Jump to: navigation, search
m (Kinect On Windows)
(Nuget)
(70 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Windows==
 
==Windows==
 +
===Nuget===
 +
Using nuget package manager is probably the easiest way to include Emgu CV library in your project.
  
You can run an [http://www.zianchoy.com/emguCVInstaller/ AutoIt script] that automates much of the process, including installing OpenCV if necessary, and lets you start developing with Visual Studio right away.
+
*From your project, right click on "References" and select "Manager Nuget Packages..." option. It will open up nuget package manager. In package source, make sure that "nuget.org" is selected. (If you are using the commercial release, please check the instruction in the commercial download area for instructions to setup the commercial release nuget repository.)
  
===Getting the Dependency===
+
*Under "Browse", enter the search text "emgu cv" and you should be able to find the Emgu.CV nuget pacakge.
 +
 
 +
[[File:install_EmguCV_Nuget.png| 600px]]
 +
 
 +
Please make sure the package is created by "Emgu Corporation" for the official release.
 +
 
 +
*Click the "Install" button. Nuget will download Emgu CV and configure the project for you.
 +
 
 +
===Using the Downloadable packages===
 +
If you are using the downloadable packages (.zip or .exe), you can follow the instructions below.
 +
 
 +
====Getting the Dependency====
 
*[[Emgu CV]] use WCF(Windows Communication Foundation) therefore requires .Net 3.0
 
*[[Emgu CV]] use WCF(Windows Communication Foundation) therefore requires .Net 3.0
*For version 2.4+ the bundled OpenCV binary is build with Visual Studio 2010, you will needs to installed '''[http://www.microsoft.com/en-us/download/details.aspx?id=8328 MSVCRT 9.0 SP1 x86]''' or '''[http://www.microsoft.com/en-us/download/details.aspx?id=13523 MSVCRT 9.0 SP1 x64]''' to resolve the dependency issue.
+
*For Version 3.0+, the required vcrt dlls are included in the "x86" and "x64" folder. You will be ready as long as you copy all the unmanaged dlls in the "x86" and "x64" folder to the folder of executable.
*For Version 2.0+, the bundled OpenCV binary is build with Visual Studio 2008, you will needs to installed '''[http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en MSVCRT 9.0 SP1]''' to resolve the dependency issue.
+
*For version 2.4.x the bundled OpenCV binary is build with Visual Studio 2010, you will needs to installed '''[http://www.microsoft.com/en-us/download/details.aspx?id=8328 MSVCRT 9.0 SP1 x86]''' or '''[http://www.microsoft.com/en-us/download/details.aspx?id=13523 MSVCRT 9.0 SP1 x64]''' to resolve the dependency issue.
 +
*For Version 2.0 - 2.3, the bundled OpenCV binary is build with Visual Studio 2008, you will needs to installed '''[http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en 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 '''[http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en MSVCRT 8.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 '''[http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en MSVCRT 8.0 SP1]''' to resolve the dependency issue.
  
===Building the Examples===
+
====Building the Examples====
 
*Follow [http://sourceforge.net/project/showfiles.php?group_id=216500 this link] to the file server on Source Forge.
 
*Follow [http://sourceforge.net/project/showfiles.php?group_id=216500 this link] to the file server on Source Forge.
 
*Download and extract the windows installer.  
 
*Download and extract the windows installer.  
 
*Install the software
 
*Install the software
*Go to the Solution folder
+
*Go to the "Solution\Windows.Desktop" folder.
**If you are using Visual Studio 2008, browse to VS2008
 
**If you are using Visual Studio 2010, browse to VS2010
 
 
*Open <code>Emgu.CV.Example.sln</code> and build the solution. At this point, you should be able to run the example programs.
 
*Open <code>Emgu.CV.Example.sln</code> and build the solution. At this point, you should be able to run the example programs.
  
===Creating a New Project in Visual Studio===
+
====Creating a New Project in Visual Studio====
 
To use the framework in Visual Studio, you need to
 
To use the framework in Visual Studio, you need to
 
* Download and extract the binary files package '''Emgu.CV.Windows.Binary-{version}.zip'''  
 
* Download and extract the binary files package '''Emgu.CV.Windows.Binary-{version}.zip'''  
 
For a Full guide to using the dependencies under Visual Studio and C# see the [[Setting_up_EMGU_C_Sharp| C# Tutorial]].
 
For a Full guide to using the dependencies under Visual Studio and C# see the [[Setting_up_EMGU_C_Sharp| C# Tutorial]].
  
====Core Functionality====
+
=====Core Functionality=====
=====Managed Code=====
+
======Managed Code======
 
*Create a new Visual Studio project or use an existing one
 
*Create a new Visual Studio project or use an existing one
*Add the two files <code>Emgu.Utils.dll</code> and <code>Emgu.CV.dll</code> to ''References'' of the project. as well.
+
*Add reference
 +
**For 3.1 release. Add the <code>Emgu.CV.World.dll</code> to ''Reference'' of the project.
 +
**For 3.0 release. Add the two files <code>Emgu.Utils.dll</code> and <code>Emgu.CV.dll</code> to ''References'' of the project.
 
*Optionally put the following lines in the top of your code to include the Emgu.CV namespace.
 
*Optionally put the following lines in the top of your code to include the Emgu.CV namespace.
 
<code>
 
<code>
using Emgu.CV;
+
using Emgu.CV;
using Emgu.CV.Structure;
+
 
 +
using Emgu.CV.Structure;
 
</code>
 
</code>
  
=====Open CV unmanaged dll=====
+
======Open CV unmanaged dll======
Copy the [[OpenCV]] dll files: <code>opencv_calib3d{XXX}.dll</code>, <code>opencv_contrib{XXX}.dll</code>, <code>opencv_core{XXX}.dll</code>, <code>opencv_features2d{XXX}.dll</code>, <code>opencv_ffmpeg{XXX}.dll</code>, <code>opencv_flann{XXX}.dll</code>, <code>opencv_gpu{XXX}.dll</code>, <code>opencv_highgui{XXX}.dll</code>, <code>opencv_imgproc{XXX}.dll</code>, <code>opencv_legacy{XXX}.dll</code>, <code>opencv_ml{XXX}.dll</code>, <code>opencv_objdetect{XXX}.dll</code>, <code>opencv_video{XXX}.dll</code> and <code>cvextern.dll</code> to the execution directory, where <code>{XXX}</code> is the OpenCV version number.
+
Copy the "x86" and "x64" folder, along with the DLLs inside those folder to the folder of the executable. Emgu CV is able to load the unmanaged binary from the "x86" folder when running in 32bit mode, and load the unmanaged binary from the "x64" folder when running in 64bit-mode.
 +
If you are only targeting the "x64" platform, you only need to copy the "x64" folder.
  
=====GPU package=====
+
======CUDA (GPU) package======
GPU for image processing is only available for [[Version_History#Emgu.CV-2.2.1|Emgu CV rev 2.2.1]] and later. Only package containing ''-gpu'' in its name (e.g. <code>libemgucv-xxx-gpu-xxx</code>) has GPU processing enabled.  
+
*For Emgu CV 3.x, only package containing ''-cuda'' in its name (e.g. <code>libemgucv-xxx-cuda-xxx</code> ) has CUDA processing enabled.  
 +
**Install the [https://developer.nvidia.com/cuda-downloads latest cuda graphic card driver] from NVIDIA on your development workstation.
 +
**Adding reference: For 3.1 release. You don't need to add extra references. The Cuda namespace is part of the Emgu.CV.World.dll; For 3.0 release. Add <code>Emgu.CV.Cuda.dll</code> to ''References''
 +
**Optionally put the following lines in the top of your code to include the Emgu.CV.Cuda  namespace. <code> using Emgu.CV.Cuda;</code>
  
*Install the [http://developer.nvidia.com/object/cuda_3_2_downloads.html latest cuda graphic card driver] from NVIDIA on your running platform.
+
*For Emgu CV 2.x, CUDA (GPU) for image processing is only available for [[Version_History#Emgu.CV-2.2.1|Emgu CV rev 2.2.1]] and later. Only package containing ''-gpu'' in its name (e.g. <code>libemgucv-xxx-gpu-xxx</code>) has CUDA (GPU) processing enabled.
*Copy the cuda and npp dll files: <code>cudart{bit}_{maj_rev}_{min_rev}.dll</code> and <code>npp{bit}_{maj_rev}_{min_rev}.dll</code> to the execution directory
+
**Install the [https://developer.nvidia.com/cuda-downloads latest cuda graphic card driver] from NVIDIA on your development workstation.
*Add <code>Emgu.CV.GPU.dll</code> to ''References''  
+
**Add <code>Emgu.CV.GPU.dll</code> to ''References''  
*Optionally put the following lines in the top of your code to include the Emgu.CV.GPU namespace.
+
**Optionally put the following lines in the top of your code to include the Emgu.CV.GPU namespace. <code> using Emgu.CV.GPU;</code>
<code>
+
 
using Emgu.CV.GPU;
+
======Commercial package======
</code>
 
=====Commercial package=====
 
 
The [[Licensing:#Commercial_License|commercial version]] is build with Intel Compiler, Intel IPP and (commercial version of) Intel TBB. It contains ''-tbb-ipp-icc'' in the package file name. Once you purchase the [[Licensing:#Commercial_License|commercial version]] you will received an email containing the instructions to download these packages.
 
The [[Licensing:#Commercial_License|commercial version]] is build with Intel Compiler, Intel IPP and (commercial version of) Intel TBB. It contains ''-tbb-ipp-icc'' in the package file name. Once you purchase the [[Licensing:#Commercial_License|commercial version]] you will received an email containing the instructions to download these packages.
  
Line 53: Line 70:
 
*Copy the TBB dll file <code>tbb.dll</code> to the execution directory
 
*Copy the TBB dll file <code>tbb.dll</code> to the execution directory
  
====GUI====
+
=====GUI=====
 
To display image using Emgu's [[ImageBox]]
 
To display image using Emgu's [[ImageBox]]
 
*Add <code> Emgu.CV.UI.dll</code> to ''References''
 
*Add <code> Emgu.CV.UI.dll</code> to ''References''
 
*Optionally put the following lines in the top of your code to include the Emgu.CV.UI namespace.
 
*Optionally put the following lines in the top of your code to include the Emgu.CV.UI namespace.
<code>
+
<code> using Emgu.CV.UI;</code>
using Emgu.CV.UI;
 
</code>
 
  
====Machine Learning====
+
=====Machine Learning=====
*Add <code>Emgu.CV.ML.dll</code> to ''References''  
+
*Adding reference
 +
** For 3.1 release. You don't need to add extra reference.
 +
** For release up to and including 3.0 release, add <code>Emgu.CV.ML.dll</code> to ''References''  
 
*Optionally put the following lines in the top of your code to include the Emgu.CV.ML namespace.
 
*Optionally put the following lines in the top of your code to include the Emgu.CV.ML namespace.
<code>
+
<code> using Emgu.CV.ML;</code>
using Emgu.CV.ML;
 
</code>
 
  
====Start Developing====
+
=====Start Developing=====
 
*Follow the [[Tutorial]] to learn how to use Emgu CV.  
 
*Follow the [[Tutorial]] to learn how to use Emgu CV.  
 
*Hello World ([[Hello_World_in_CSharp |C#]] or [[Hello_World_in_VB.NET |VB .NET]]) is a good starting point.
 
*Hello World ([[Hello_World_in_CSharp |C#]] or [[Hello_World_in_VB.NET |VB .NET]]) is a good starting point.
  
===The type initializer for 'Emgu.CV.CvInvoke' threw an exception.===
+
====The type initializer for 'Emgu.CV.CvInvoke' threw an exception.====
 
If you see this exception, please check the following
 
If you see this exception, please check the following
  
==== Have you installed MSVCRT? ====
+
===== Have you installed MSVCRT? =====
 +
* For Version 3.0+, the required vcrt dlls are included in the "x86" and "x64" folder. You will be ready as long as you copy all the unmanaged dlls in the "x86" and "x64" folder to the folder of executable.
 
*For Version 2.4+, the bundled OpenCV binary is build with Visual Studio 2010, you will needs to installed '''[http://www.microsoft.com/en-us/download/details.aspx?id=5555 MSVCRT 10.0 SP1 x86]''' or '''[http://www.microsoft.com/en-ca/download/details.aspx?id=13523 MSVCRT 10.0 SP1 x64]''' to resolve the dependency issue.
 
*For Version 2.4+, the bundled OpenCV binary is build with Visual Studio 2010, you will needs to installed '''[http://www.microsoft.com/en-us/download/details.aspx?id=5555 MSVCRT 10.0 SP1 x86]''' or '''[http://www.microsoft.com/en-ca/download/details.aspx?id=13523 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 '''[http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en MSVCRT 9.0 SP1]''' to resolve the dependency issue.
 
*For Version 2.0+, the bundled OpenCV binary is build with Visual Studio 2008, you will needs to installed '''[http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en 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 '''[http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en MSVCRT 8.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 '''[http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en MSVCRT 8.0 SP1]''' to resolve the dependency issue.
  
==== Have you copied the [[OpenCV]] dlls to the execution directory? ====
+
===== Have you copied the [[OpenCV]] dlls to the execution directory? =====
 
* Make sure the unmanaged DLLs are in the execution directory.  
 
* Make sure the unmanaged DLLs are in the execution directory.  
 +
**For Emgu CV version >=2.4.2, this means the "x86" and "x64" folder and all the dlls within the folders. The folder names and file structures should not be altered when deploying with the application.
 +
**For EMGU CV version 2.4 <code>cudart64_42_9.dll, cvextern.dll, npp64_42_9.dll, opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_flannXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_nonfreXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll,</code?> where <code>XXX</code> is the OpenCV version number.
 +
**For Emgu CV version 2.2, 2.3 this means the following dlls: <code>opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll</code> where <code>XXX</code> is the OpenCV version number.
 
**For Emgu CV version <= 2.1, this means the following dlls:<code>cvXXX.dll, cvauxXXX.dll, cxcoreXXX.dll, highguiXXX.dll, opencv_ffmpegXXX.dll, mlXXX.dllcvextern.dll</code> where <code>XXX</code> is the OpenCV version number.
 
**For Emgu CV version <= 2.1, this means the following dlls:<code>cvXXX.dll, cvauxXXX.dll, cxcoreXXX.dll, highguiXXX.dll, opencv_ffmpegXXX.dll, mlXXX.dllcvextern.dll</code> where <code>XXX</code> is the OpenCV version number.
**For Emgu CV version 2.2, 2.3 this means the following dlls: <code>opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll</code> where <code>XXX</code> is the OpenCV version number.
 
**For EMGU CV version >=2.4 <code>cudart64_42_9.dll, cvextern.dll, npp64_42_9.dll, opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_flannXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_nonfreXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll,</code?> where <code>XXX</code> is the OpenCV version number.
 
  
 
*The best way to set up your project is:
 
*The best way to set up your project is:
Line 91: Line 108:
 
**For each of the included Dlls, left click on it, find the "Copy to Output Directory" option and select "Copy if newer"
 
**For each of the included Dlls, left click on it, find the "Copy to Output Directory" option and select "Copy if newer"
  
==== Are you running a 32-Bit OS? ====
+
===== Are you missing any dependency? =====
The windows installer is only available for 32-Bit windows. If you are using a 64-bit OS, there are three possible ways to resolve this issue:
 
*You can download the 64bit binary only zip package from sourceforge and add it to your project.
 
*You can also recompile [[OpenCV]] from source for 64-bit platform. See [[Download_And_Installation#Building_from_Git | the instruction for building from GIT]]
 
*Alternatively you can force your .NET application to run in 32bit mode, even on a 64-bit OS. To do this, in the configuration page of your executable project, select Platform Target as ''''x86''''.
 
 
 
==== Are you missing any dependency? ====
 
 
Download [http://www.dependencywalker.com/ Dependency Walker] and use it to open the "cvextern.dll" file. Check if any dependency is missing.
 
Download [http://www.dependencywalker.com/ Dependency Walker] and use it to open the "cvextern.dll" file. Check if any dependency is missing.
  
==== I have checked all of above but I still got the Exception ====
+
===== I have checked all of above but I still got the Exception =====
 
In this case, please try to [[Download And Installation#Building the Examples | build and run the examples]]. After building the examples, try to run the "Hello World" Program.  
 
In this case, please try to [[Download And Installation#Building the Examples | build and run the examples]]. After building the examples, try to run the "Hello World" Program.  
  
Line 111: Line 122:
  
 
==== Prerequisite ====
 
==== Prerequisite ====
*You will need to install '''[http://www.cmake.org/cmake/resources/software.html CMAKE]''' in-order to build the unmanaged C++ code (OpenCV and cvextern.dll).
+
*You will need to install '''[http://www.cmake.org/cmake/resources/software.html CMAKE]''' in-order to build the unmanaged C++ code (OpenCV and cvextern.dll).
*You will need '''Visual Studio 2012''' / '''Visual Studio 2010''' / '''Visual Studio 2008''' to build the Managed code (Emgu CV)
+
*You will need '''Visual Studio 2017'''/ '''Visual Studio 2015''' to build the Managed code (Emgu CV)
===== Kinect On Windows =====
 
If you wants to build Emgu CV with OpenNI to enable Kinect support on windows. Here is the steps:
 
* First you will need to install the Kinect driver for Windows. The official OpenNI driver will not work. PrimeSense does not officially release Kinect driver on Windows and have no plan to do so in the near feature. Here is the modified SensorKinect diver that is available from GitHub: [https://github.com/avin2/SensorKinect.git https://github.com/avin2/SensorKinect.git] You need a Git client such as [http://code.google.com/p/tortoisegit/ TortoiseGit] to check out the source code. Once the code is checked out, plug in your Kinect sensor. When you are asked for driver installation, manually pick the driver from the <code>SensorKinect\Platform\Win32\Driver</code> folder you checked out. If everything go as planned, you should see the Kinect Hardware shown as follows:
 
[[File:KinectDriverScreenCapture.png]]
 
* Do not proceed to the next step unless you got the driver setup correctly.
 
* Download and install [http://www.openni.org/ OpenNI]
 
* Check out Emgu CV from git.
 
* Configure the project manually using CMake. First open CMake GUI, set the source code and build folder to the root of the Emgu CV folder. Check the box "WITH_OPENNI", click "Configure". Then enter the location for "OPENNI_INCLUDE_DIR", "OPENNI_LIB_DIR" and "OPENNI_PRIME_SENSOR_MODULE_BIN_DIR", click "Configure" and "Generate".
 
* Now you should have a Visual Studio solution to build Emgu CV with Kinect.
 
  
==== Building the unmanaged code ====
+
==== Configuring the project ====
 
===== 32-Bit Windows =====
 
===== 32-Bit Windows =====
Run <code>Build_Binary_x86.bat</code> script located in the trunk folder of SVN.
+
Run <code>Build_Binary_x86_nocuda.bat</code> script located in the <code>platforms\windows</code> folder of GIT.
 
===== 64-Bit Windows =====
 
===== 64-Bit Windows =====
Run <code>Build_Binary_x86-64.bat</code> script located in the trunk folder of SVN.
+
Run <code>Build_Binary_x86-64_doc.bat</code> script located in the <code>platforms\windows</code> folder of GIT.
 +
 
 +
==== Building the unmanaged code ====
 +
Double check if the <code>emgucv.sln</code> file exists in the root folder, if not, run the above step again.
 +
Open <code>emgucv.sln</code> solution located in the root folder with the matching version of Visual Studio, switch the configuration to "Release" and build the cvextern project.  
  
 
==== Building the managed code ====
 
==== Building the managed code ====
*Browse to the Solution Folder
+
*Browse to the "Solution\Windows.Desktop" Folder
**If you are using Visual Studio 2008, browse to VS2008
 
**If you are using Visual Studio 2010/2012, browse to VS2010_2012
 
 
*Open <code>Emgu.CV.sln</code> and build the solution.
 
*Open <code>Emgu.CV.sln</code> and build the solution.
At this point, the Emgu CV dlls should be available under bin folder in the top most directory.
+
At this point, the Emgu CV dlls should be available under the <code>bin</code> folder in the top most directory.
  
 
==Linux==
 
==Linux==
===Getting the Dependency===
+
===Getting ready===
====Fedora 15====
+
====Fedora 21====
 
* [[OpenCV]]
 
* [[OpenCV]]
 
** We will build a custom version of OpenCV in the next step. It is recommended to remove any OpenCV package if it is installed on your machine. You should remove OpenCV by running as root <pre> yum remove opencv </pre>  
 
** We will build a custom version of OpenCV in the next step. It is recommended to remove any OpenCV package if it is installed on your machine. You should remove OpenCV by running as root <pre> yum remove opencv </pre>  
Line 149: Line 153:
 
[[Emgu CV]] has adapted to use cmake to compile all it source code (as well as [[OpenCV]]). Make sure you have cmake installed.
 
[[Emgu CV]] has adapted to use cmake to compile all it source code (as well as [[OpenCV]]). Make sure you have cmake installed.
  
* Installing the dependencies
+
* Installing GIT so you can check out the project folder, you can install GIT by running as root <pre>yum install git</pre>
You can install the dependencies by running as root <pre> yum install mono-core mono-extras mono-devel mono-wcf gcc-c++ cmake svn libpng-devel libjpeg-turbo-devel jasper-devel libtiff-devel libgeotiff-devel gtk2-devel OpenEXR-devel libv4l-devel eigen2-devel libdc1394-devel qt-devel tbb-devel tesseract-devel</pre>
+
 
 +
====Ubuntu 16.04====
 +
* [[Mono]]
 +
** You will need [[Mono]] >= 2.6
 +
** [[Emgu CV]] library use WCF (Windows Communication Foundation) and therefore also requires libmono-wcf3.0-cil.
 +
* [[OpenCV]]
 +
** We will build a custom version of OpenCV in the next step. It is recommended to remove any OpenCV package if it is installed on your machine.
 +
* CMake
 +
[[Emgu CV]] has adapted to use cmake to compile its source code (as well as [[OpenCV]]).
 +
* Installing GIT so you can check out the project folder, you can install GIT by running <pre>sudo apt-get install git</pre>
  
====Ubuntu 13.04====
+
====Raspbian (Raspberry Pi 2)====
 
* [[Mono]]
 
* [[Mono]]
 
** You will need [[Mono]] >= 2.6
 
** You will need [[Mono]] >= 2.6
Line 160: Line 173:
 
* CMake
 
* CMake
 
[[Emgu CV]] has adapted to use cmake to compile its source code (as well as [[OpenCV]]).  
 
[[Emgu CV]] has adapted to use cmake to compile its source code (as well as [[OpenCV]]).  
* Installing the prerequisites
+
* Installing GIT so you can check out the project folder, you can install GIT by running <pre>sudo apt-get install git</pre>
You can install the prerequisites by running <pre>sudo apt-get install build-essential monodevelop libmono-wcf3.0-cil mono-gmcs libtiff5-dev libgeotiff-dev libgtk2.0-dev libgstreamer0.10-dev libavcodec-dev libswscale-dev libavformat-dev libopenexr-dev libjasper-dev libdc1394-22-dev libv4l-dev libqt4-opengl-dev libeigen2-dev libtbb-dev libtesseract-dev cmake-curses-gui git</pre>
 
  
===Building from Source===
+
===Getting the source code===
 
*To build from source, you will need a Git client to check out the source code from SourceForge. For more information, see [[GIT]]. The following command can be used to check out the source:
 
*To build from source, you will need a Git client to check out the source code from SourceForge. For more information, see [[GIT]]. The following command can be used to check out the source:
<pre>git clone git://git.code.sf.net/p/emgucv/code emgucv </pre>
+
<pre>git clone https://github.com/emgucv/emgucv emgucv </pre>
 
*Go to emgucv directory
 
*Go to emgucv directory
 
<pre>cd emgucv</pre>
 
<pre>cd emgucv</pre>
Line 172: Line 184:
 
<pre>git submodule update --init --recursive</pre>
 
<pre>git submodule update --init --recursive</pre>
  
*Use cmake to generate make file
+
===Configuring the project===
<pre>cmake -DBUILD_NEW_PYTHON_SUPPORT:BOOL=FALSE -DBUILD_TESTS:BOOL=FALSE -DBUILD_DOCS:BOOL=FALSE -DWITH_TBB:BOOL=TRUE -DWITH_CUDA:BOOL=FALSE -DWITH_OPENCL:BOOL=FALSE .</pre>
+
====Fedora 21====
 +
*Got to the configuration folder
 +
<pre>cd platforms/fedora/21</pre>
 +
*Installing the perquisites
 +
This only needs to be run once. You can install the prerequisites by running <pre>./install_dependency</pre>
 +
*Use the following command to configure the project:
 +
<pre>./cmake_configure</pre>
 +
*Go back to the source code root folder
 +
<pre>cd ../../..</pre>
 +
 
 +
====Raspbian (Raspberry Pi 2)====
 +
*Got to the configuration folder
 +
<pre>cd platforms/raspbian</pre>
 +
*Installing the perquisites
 +
This only needs to be run once. You can install the prerequisites by running <pre>./apt_install_dependency</pre>
 +
*Use the following command to configure the project:
 +
<pre>./cmake_configure</pre>
 +
*Go back to the source code root folder
 +
<pre>cd ../..</pre>
  
This will generate make file for [[Emgu CV]]
+
====Ubuntu====
 +
*Got to the configuration folder
 +
<pre>cd platforms/ubuntu/16.04</pre>
 +
*Installing the perquisites
 +
This only needs to be run once. You can install the prerequisites by running <pre>./apt_install_dependency</pre>
 +
*Use the following command to configure the project:
 +
<pre>./cmake_configure</pre>
 +
*Go back to the source code root folder
 +
<pre>cd ../../..</pre>
 +
 
 +
===Build the binary===
 
*Build [[Emgu CV]] by calling  
 
*Build [[Emgu CV]] by calling  
 
<pre>make</pre>
 
<pre>make</pre>
Line 181: Line 221:
 
Sit back and wait as this will build [[OpenCV]], as well as cvextern.so, Emgu.Util.dll, Emgu.CV.dll, Emgu.CV.UI.dll and Emgu.CV.ML.dll
 
Sit back and wait as this will build [[OpenCV]], as well as cvextern.so, Emgu.Util.dll, Emgu.CV.dll, Emgu.CV.UI.dll and Emgu.CV.ML.dll
  
 +
===Running the Examples===
 
*Now go to the bin folder  
 
*Now go to the bin folder  
 
<pre>cd bin</pre>
 
<pre>cd bin</pre>
Line 226: Line 267:
 
===Building from Source===
 
===Building from Source===
 
*To build from source, you will need a Git client to check out the source code from SourceForge. For more information, see [[GIT]]. The following command can be used to check out the source:
 
*To build from source, you will need a Git client to check out the source code from SourceForge. For more information, see [[GIT]]. The following command can be used to check out the source:
<pre>git clone git://git.code.sf.net/p/emgucv/code emgucv</pre>
+
<pre>git clone https://github.com/emgucv/emgucv emgucv</pre>
 
*Go to emgucv directory
 
*Go to emgucv directory
 
<pre>cd emgucv</pre>
 
<pre>cd emgucv</pre>
 
+
* It is recommend to check out a branch of emgucv, for example, 2.4.10 instead of the master development code.
 +
<pre>git checkout EMGUCV_3_1_R16_12</pre>
 
*Initialize opencv, tesseract-ocr and cvblob submodules
 
*Initialize opencv, tesseract-ocr and cvblob submodules
 
<pre>git submodule update --init --recursive</pre>
 
<pre>git submodule update --init --recursive</pre>
  
*Use cmake to generate make file
+
*Configure and build [[Emgu CV]]
<pre>cmake -DCMAKE_OSX_ARCHITECTURES=i386 -DBUILD_NEW_PYTHON_SUPPORT:BOOL=FALSE -DBUILD_PERF_TESTS=FALSE -DBUILD_TESTS:BOOL=FALSE -DBUILD_DOCS:BOOL=FALSE -DBUILD_JPEG=TRUE -DBUILD_PNG=TRUE -DBUILD_TIFF=TRUE .</pre>
+
<pre>cd platform/osx
 +
./configure
 +
cd ..
 +
</pre>
  
This will generate make file for [[Emgu CV]]
+
Sit back and wait as this will build [[OpenCV]] and Emgu CV
*Build [[Emgu CV]] by calling
 
<pre>make</pre>
 
 
 
Sit back and wait as this will build [[OpenCV]], as well as cvextern.so, Emgu.Util.dll, Emgu.CV.dll, Emgu.CV.UI.dll and Emgu.CV.ML.dll
 
  
 
*Now go to the bin folder  
 
*Now go to the bin folder  
Line 247: Line 288:
 
<pre>mono Example.PlanarSubdivision.monoexe</pre>
 
<pre>mono Example.PlanarSubdivision.monoexe</pre>
  
You should see the planar subdivision window
+
You should see the planar subdivision window. Note that the first time a mono program is executed, it may take a considerable time to start, some times as long as one minute. Any consecutive execution should be fast.
 +
 
 
*Follow the instruction on [[Compiling with Monodevelop]], as the environment has been setup by cmake
 
*Follow the instruction on [[Compiling with Monodevelop]], as the environment has been setup by cmake
  
Line 254: Line 296:
 
<pre>mono Example.PlanarSubdivision.monoexe</pre>
 
<pre>mono Example.PlanarSubdivision.monoexe</pre>
 
Your OpenCV build might be incomplete (e.g. GTK+ 2.x devel library is missing). To trace the cause of the error, run <pre>MONO_LOG_LEVEL=debug mono Example.PlanarSubdivision.monoexe</pre> and exam the error message.
 
Your OpenCV build might be incomplete (e.g. GTK+ 2.x devel library is missing). To trace the cause of the error, run <pre>MONO_LOG_LEVEL=debug mono Example.PlanarSubdivision.monoexe</pre> and exam the error message.
 +
 +
== iOS ==
 +
Emgu CV for iOS is only available under our commercial license. The instructions below applies to the Emgu CV for iOS, Professional or Ultimate commercial release.
 +
 +
=== Adding Emgu CV to your Xamarin iOS App ===
 +
The "libs" folder of the iOS (or Pro) release package should contains the file
 +
<pre>"Emgu.CV.World.IOS.dll</pre>
 +
Adding this dll file as a reference to your Xamarin iOS App should allow you to use Emgu CV in your App.
 +
 +
=== Size of the binary ===
 +
The "Emgu.CV.World.IOS.dll" file size is large. For example, in the 3.4.1 iOS release, this file is 256MB. It contains the native binary for all supported CPU architectures, including those for simulators.
 +
 +
However, if you are building an IPA for app store submission, and is only targeting ARM64 devices, you can select just ARM64 architecture. When the IPA is build, the compiler will strip out all the binary that are not used. It will significantly reduce the final size of the IPA. Depends on the number of functions you used, if you are only targeting a single ARM64 architecture, the final IPA size should be some where around 30-40MB.
 +
 +
=== Demos ===
 +
The demo solution is available under the "Solution\iOS" folder. 
 +
 +
== Android ==
 +
Emgu CV for Android is only available under our commercial license. The instructions below applies to the Emgu CV for Android, Professional or Ultimate commercial release.
 +
 +
=== Adding Emgu CV to your Xamarin Android App ===
 +
The "libs" folder of the iOS (or Pro) release package should contains the file
 +
<pre>Emgu.CV.World.Android.dll</pre>
 +
Adding this dll file as a reference to your Xamarin Android App should allow you to use Emgu CV in your App.
 +
 +
=== Size of the binary ===
 +
The "Emgu.CV.World.Android.dll" file size is large. For example, in the 3.4.1 Android release, this file is 70MB. It contains the native binary for all supported CPU architectures.
 +
 +
However, if you are building an app for Google Play Store submission, and is only targeting armeabi-v7 devices, you can select just armeabi-v7 architecture. When the final APK is build, the compiler will strip out all the binary for the architectures that are not used. It will significantly reduce the final size of the APK. Depends on the number of functions you used, if you are only targeting a single armeabi-v7 architecture, the final APK size should be some where around 20-30MB.
 +
 +
=== Demos ===
 +
The demo solution is available under the "Solution\Android" folder.

Revision as of 15:49, 15 June 2018

Windows

Nuget

Using nuget package manager is probably the easiest way to include Emgu CV library in your project.

  • From your project, right click on "References" and select "Manager Nuget Packages..." option. It will open up nuget package manager. In package source, make sure that "nuget.org" is selected. (If you are using the commercial release, please check the instruction in the commercial download area for instructions to setup the commercial release nuget repository.)
  • Under "Browse", enter the search text "emgu cv" and you should be able to find the Emgu.CV nuget pacakge.

Install EmguCV Nuget.png

Please make sure the package is created by "Emgu Corporation" for the official release.

  • Click the "Install" button. Nuget will download Emgu CV and configure the project for you.

Using the Downloadable packages

If you are using the downloadable packages (.zip or .exe), you can follow the instructions below.

Getting the Dependency

  • Emgu CV use WCF(Windows Communication Foundation) therefore requires .Net 3.0
  • For Version 3.0+, the required vcrt dlls are included in the "x86" and "x64" folder. You will be ready as long as you copy all the unmanaged dlls in the "x86" and "x64" folder to the folder of executable.
  • For version 2.4.x the bundled OpenCV binary is build with Visual Studio 2010, you will needs to installed MSVCRT 9.0 SP1 x86 or MSVCRT 9.0 SP1 x64 to resolve the dependency issue.
  • For Version 2.0 - 2.3, 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.

Building the Examples

  • Follow this link to the file server on Source Forge.
  • Download and extract the windows installer.
  • Install the software
  • Go to the "Solution\Windows.Desktop" folder.
  • Open Emgu.CV.Example.sln and build the solution. At this point, you should be able to run the example programs.

Creating a New Project in Visual Studio

To use the framework in Visual Studio, you need to

  • Download and extract the binary files package Emgu.CV.Windows.Binary-{version}.zip

For a Full guide to using the dependencies under Visual Studio and C# see the C# Tutorial.

Core Functionality
Managed Code
  • Create a new Visual Studio project or use an existing one
  • Add reference
    • For 3.1 release. Add the Emgu.CV.World.dll to Reference of the project.
    • For 3.0 release. Add the two files Emgu.Utils.dll and Emgu.CV.dll to References of the project.
  • Optionally put the following lines in the top of your code to include the Emgu.CV namespace.

using Emgu.CV;

using Emgu.CV.Structure;

Open CV unmanaged dll

Copy the "x86" and "x64" folder, along with the DLLs inside those folder to the folder of the executable. Emgu CV is able to load the unmanaged binary from the "x86" folder when running in 32bit mode, and load the unmanaged binary from the "x64" folder when running in 64bit-mode. If you are only targeting the "x64" platform, you only need to copy the "x64" folder.

CUDA (GPU) package
  • For Emgu CV 3.x, only package containing -cuda in its name (e.g. libemgucv-xxx-cuda-xxx ) has CUDA processing enabled.
    • Install the latest cuda graphic card driver from NVIDIA on your development workstation.
    • Adding reference: For 3.1 release. You don't need to add extra references. The Cuda namespace is part of the Emgu.CV.World.dll; For 3.0 release. Add Emgu.CV.Cuda.dll to References
    • Optionally put the following lines in the top of your code to include the Emgu.CV.Cuda namespace. using Emgu.CV.Cuda;
  • For Emgu CV 2.x, CUDA (GPU) for image processing is only available for Emgu CV rev 2.2.1 and later. Only package containing -gpu in its name (e.g. libemgucv-xxx-gpu-xxx) has CUDA (GPU) processing enabled.
    • Install the latest cuda graphic card driver from NVIDIA on your development workstation.
    • Add Emgu.CV.GPU.dll to References
    • Optionally put the following lines in the top of your code to include the Emgu.CV.GPU namespace. using Emgu.CV.GPU;
Commercial package

The commercial version is build with Intel Compiler, Intel IPP and (commercial version of) Intel TBB. It contains -tbb-ipp-icc in the package file name. Once you purchase the commercial version you will received an email containing the instructions to download these packages.

For commercial release > v2.3.1:

  • Copy the Intel C++ compiler runtime redistributable dlls libiomp5md.dll, libmmd.dll & svml_dispmd.dllto the execution directory
  • Copy the TBB dll file tbb.dll to the execution directory
GUI

To display image using Emgu's ImageBox

  • Add Emgu.CV.UI.dll to References
  • Optionally put the following lines in the top of your code to include the Emgu.CV.UI namespace.

using Emgu.CV.UI;

Machine Learning
  • Adding reference
    • For 3.1 release. You don't need to add extra reference.
    • For release up to and including 3.0 release, add Emgu.CV.ML.dll to References
  • Optionally put the following lines in the top of your code to include the Emgu.CV.ML namespace.

using Emgu.CV.ML;

Start Developing
  • Follow the Tutorial to learn how to use Emgu CV.
  • Hello World (C# or VB .NET) is a good starting point.

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

If you see this exception, please check the following

Have you installed MSVCRT?
  • For Version 3.0+, the required vcrt dlls are included in the "x86" and "x64" folder. You will be ready as long as you copy all the unmanaged dlls in the "x86" and "x64" folder to the folder of executable.
  • 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.
Have you copied the OpenCV dlls to the execution directory?
  • Make sure the unmanaged DLLs are in the execution directory.
    • For Emgu CV version >=2.4.2, this means the "x86" and "x64" folder and all the dlls within the folders. The folder names and file structures should not be altered when deploying with the application.
    • For EMGU CV version 2.4 cudart64_42_9.dll, cvextern.dll, npp64_42_9.dll, opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_flannXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_nonfreXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll,</code?> where <code>XXX is the OpenCV version number.
    • For Emgu CV version 2.2, 2.3 this means the following dlls: opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll where XXX is the OpenCV version number.
    • For Emgu CV version <= 2.1, this means the following dlls:cvXXX.dll, cvauxXXX.dll, cxcoreXXX.dll, highguiXXX.dll, opencv_ffmpegXXX.dll, mlXXX.dllcvextern.dll where XXX is the OpenCV version number.
  • The best way to set up your project is:
    • Copy the unmanaged DLLs to your project folder
    • Right click on the project, click Add->Existing Item and select all unmanaged DLLs. Add them to the project.
    • For each of the included Dlls, left click on it, find the "Copy to Output Directory" option and select "Copy if newer"
Are you missing any dependency?

Download Dependency Walker and use it to open the "cvextern.dll" file. Check if any dependency is missing.

I have checked all of above but I still got the Exception

In this case, please try to build and run the examples. After building the examples, try to run the "Hello World" Program.

If "Hello World" runs without any problem, compare it with you project, find the difference in configuration and fix it.

If "Hello World" get the same "The type initializer for 'Emgu.CV.CvInvoke' threw an exception." message, try to find out the InnerException and report it to the discussion forum

Building from Git

If you wants to build the development version of Emgu CV from source code, you can to get it from GIT following instructions on This page.

Prerequisite

  • You will need to install CMAKE in-order to build the unmanaged C++ code (OpenCV and cvextern.dll).
  • You will need Visual Studio 2017/ Visual Studio 2015 to build the Managed code (Emgu CV)

Configuring the project

32-Bit Windows

Run Build_Binary_x86_nocuda.bat script located in the platforms\windows folder of GIT.

64-Bit Windows

Run Build_Binary_x86-64_doc.bat script located in the platforms\windows folder of GIT.

Building the unmanaged code

Double check if the emgucv.sln file exists in the root folder, if not, run the above step again. Open emgucv.sln solution located in the root folder with the matching version of Visual Studio, switch the configuration to "Release" and build the cvextern project.

Building the managed code

  • Browse to the "Solution\Windows.Desktop" Folder
  • Open Emgu.CV.sln and build the solution.

At this point, the Emgu CV dlls should be available under the bin folder in the top most directory.

Linux

Getting ready

Fedora 21

  • OpenCV
    • We will build a custom version of OpenCV in the next step. It is recommended to remove any OpenCV package if it is installed on your machine. You should remove OpenCV by running as root
       yum remove opencv 
  • Mono
    • You will need Mono.
    • Emgu CV library use WCF (Windows Communication Foundation) and therefore also requires mono-wcf.
  • CMake

Emgu CV has adapted to use cmake to compile all it source code (as well as OpenCV). Make sure you have cmake installed.

  • Installing GIT so you can check out the project folder, you can install GIT by running as root
    yum install git

Ubuntu 16.04

  • Mono
    • You will need Mono >= 2.6
    • Emgu CV library use WCF (Windows Communication Foundation) and therefore also requires libmono-wcf3.0-cil.
  • OpenCV
    • We will build a custom version of OpenCV in the next step. It is recommended to remove any OpenCV package if it is installed on your machine.
  • CMake

Emgu CV has adapted to use cmake to compile its source code (as well as OpenCV).

  • Installing GIT so you can check out the project folder, you can install GIT by running
    sudo apt-get install git

Raspbian (Raspberry Pi 2)

  • Mono
    • You will need Mono >= 2.6
    • Emgu CV library use WCF (Windows Communication Foundation) and therefore also requires libmono-wcf3.0-cil.
  • OpenCV
    • We will build a custom version of OpenCV in the next step. It is recommended to remove any OpenCV package if it is installed on your machine.
  • CMake

Emgu CV has adapted to use cmake to compile its source code (as well as OpenCV).

  • Installing GIT so you can check out the project folder, you can install GIT by running
    sudo apt-get install git

Getting the source code

  • To build from source, you will need a Git client to check out the source code from SourceForge. For more information, see GIT. The following command can be used to check out the source:
git clone https://github.com/emgucv/emgucv emgucv 
  • Go to emgucv directory
cd emgucv
  • Initialize opencv, tesseract-ocr and cvblob submodules
git submodule update --init --recursive

Configuring the project

Fedora 21

  • Got to the configuration folder
cd platforms/fedora/21
  • Installing the perquisites
This only needs to be run once. You can install the prerequisites by running
./install_dependency
  • Use the following command to configure the project:
./cmake_configure
  • Go back to the source code root folder
cd ../../..

Raspbian (Raspberry Pi 2)

  • Got to the configuration folder
cd platforms/raspbian
  • Installing the perquisites
This only needs to be run once. You can install the prerequisites by running
./apt_install_dependency
  • Use the following command to configure the project:
./cmake_configure
  • Go back to the source code root folder
cd ../..

Ubuntu

  • Got to the configuration folder
cd platforms/ubuntu/16.04
  • Installing the perquisites
This only needs to be run once. You can install the prerequisites by running
./apt_install_dependency
  • Use the following command to configure the project:
./cmake_configure
  • Go back to the source code root folder
cd ../../..

Build the binary

make

Sit back and wait as this will build OpenCV, as well as cvextern.so, Emgu.Util.dll, Emgu.CV.dll, Emgu.CV.UI.dll and Emgu.CV.ML.dll

Running the Examples

  • Now go to the bin folder
cd bin
  • make sure mono can load the dynamic library from the current location by typing
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
  • Try to run the example
mono Example.PlanarSubdivision.monoexe

You should see the planar subdivision window

System.DllNotFoundException

If you encounter this exception during

mono Example.PlanarSubdivision.monoexe
Your OpenCV build might be incomplete (e.g. GTK+ 2.x devel library is missing). To trace the cause of the error, run
MONO_LOG_LEVEL=debug mono Example.PlanarSubdivision.monoexe
and exam the error message.

Building Installable Package

RPM Package for Fedora 15

  • Make sure the dependency is satisfied.
  • Make sure you have the rpm-build package installed. You can do this by running as root
    yum install rpm-build
  • Check out the source from SVN and go the the emgucv source folder
  • Configure the package with
    cmake -DBUILD_NEW_PYTHON_SUPPORT:BOOL=FALSE -DEMGU_CV_EXAMPLE_BUILD:BOOL=FALSE -DBUILD_TESTS:BOOL=FALSE -DBUILD_DOCS:BOOL=FALSE .
  • Create a rpm package by running as root
    make package
  • You should get a libemgucv-{VERSION}.{SUBVERSION}-{arch}.rpm file which includes
    • OpenCV library and documentations
    • Emgu CV library and its dependencies (including ZedGraph and zlib.net)

Debian Package for Ubuntu 11.04

  • Make sure the dependency is satisfied.
  • Check out the source from SVN and go to the emgucv source folder
  • Configure the package with
    cmake -DBUILD_NEW_PYTHON_SUPPORT:BOOL=FALSE -DEMGU_CV_EXAMPLE_BUILD:BOOL=FALSE -DBUILD_TESTS:BOOL=FALSE -DBUILD_DOCS:BOOL=FALSE .
  • Create a debian package with
    sudo make package
  • You should get a libemgucv-{VERSION}.{SUBVERSION}-{arch}.deb file which includes
    • OpenCV library and documentations
    • Emgu CV library and its dependencies (including ZedGraph)

OSX

Getting the Dependency

Emgu CV has adapted to use cmake to compile all it source code (as well as OpenCV). Make sure you have cmake installed.

  • Xcode

Make sure you have Xcode and Command Line Tools installed.

Building from Source

  • To build from source, you will need a Git client to check out the source code from SourceForge. For more information, see GIT. The following command can be used to check out the source:
git clone https://github.com/emgucv/emgucv emgucv
  • Go to emgucv directory
cd emgucv
  • It is recommend to check out a branch of emgucv, for example, 2.4.10 instead of the master development code.
git checkout EMGUCV_3_1_R16_12
  • Initialize opencv, tesseract-ocr and cvblob submodules
git submodule update --init --recursive
cd platform/osx
./configure
cd ..

Sit back and wait as this will build OpenCV and Emgu CV

  • Now go to the bin folder
cd bin
  • Try to run the example
mono Example.PlanarSubdivision.monoexe

You should see the planar subdivision window. Note that the first time a mono program is executed, it may take a considerable time to start, some times as long as one minute. Any consecutive execution should be fast.

System.DllNotFoundException

If you encounter this exception during

mono Example.PlanarSubdivision.monoexe
Your OpenCV build might be incomplete (e.g. GTK+ 2.x devel library is missing). To trace the cause of the error, run
MONO_LOG_LEVEL=debug mono Example.PlanarSubdivision.monoexe
and exam the error message.

iOS

Emgu CV for iOS is only available under our commercial license. The instructions below applies to the Emgu CV for iOS, Professional or Ultimate commercial release.

Adding Emgu CV to your Xamarin iOS App

The "libs" folder of the iOS (or Pro) release package should contains the file

"Emgu.CV.World.IOS.dll

Adding this dll file as a reference to your Xamarin iOS App should allow you to use Emgu CV in your App.

Size of the binary

The "Emgu.CV.World.IOS.dll" file size is large. For example, in the 3.4.1 iOS release, this file is 256MB. It contains the native binary for all supported CPU architectures, including those for simulators.

However, if you are building an IPA for app store submission, and is only targeting ARM64 devices, you can select just ARM64 architecture. When the IPA is build, the compiler will strip out all the binary that are not used. It will significantly reduce the final size of the IPA. Depends on the number of functions you used, if you are only targeting a single ARM64 architecture, the final IPA size should be some where around 30-40MB.

Demos

The demo solution is available under the "Solution\iOS" folder.

Android

Emgu CV for Android is only available under our commercial license. The instructions below applies to the Emgu CV for Android, Professional or Ultimate commercial release.

Adding Emgu CV to your Xamarin Android App

The "libs" folder of the iOS (or Pro) release package should contains the file

Emgu.CV.World.Android.dll

Adding this dll file as a reference to your Xamarin Android App should allow you to use Emgu CV in your App.

Size of the binary

The "Emgu.CV.World.Android.dll" file size is large. For example, in the 3.4.1 Android release, this file is 70MB. It contains the native binary for all supported CPU architectures.

However, if you are building an app for Google Play Store submission, and is only targeting armeabi-v7 devices, you can select just armeabi-v7 architecture. When the final APK is build, the compiler will strip out all the binary for the architectures that are not used. It will significantly reduce the final size of the APK. Depends on the number of functions you used, if you are only targeting a single armeabi-v7 architecture, the final APK size should be some where around 20-30MB.

Demos

The demo solution is available under the "Solution\Android" folder.