OpenCV with Java and C#


If you haven’t already installed OpenCV, follow the instructions from here. And if you are using Windows and would like to integrate OpenCv with Visual Studio or QT, go here.

Download and install JDK from here

Download and Install Eclipse from here.

Open eclipse. On the above tab, go to Window -> Preferences -> User Libraries -> New..

Create New User Library with any name as shown above.


Now, Click on Add External Jars and select the jar file in your OpenCV->Build->Java folder.

Then, add native libraries as OpenCV->Build->Java->x86 folder as shown below.


Next time you create a Java Project, just add this library and you’re done.

OpenCV with C# – EmguCV:

If you haven’t already installed OpenCV, here is the tutorial for that.

Download and install the equivalent EmguCV version as your OpenCV from here.

Add emgucv-windows-\bin\x86 to PATH of your Environment Variables.

Open Visual Studio and create new C# project.java2

Then in the Solution Explorer, right click on References -> Add References.


Click Browse and select Emgu.CV.dllEmgu.Util.dll, and Emgu.CV.UI.dll files in the bin folder as shown below.java2

Now, right click on your solution file and add an existing item


Browse to your opencv build-> bin folder and select all the dll files shown below. Click add.


Lastly select all the added dlls in the solution explorer and in the properties section, select Always copy as shown below.


In the code, include the following



Leave a Comment

Your email address will not be published. Required fields are marked *