Introduction to OpenCV

OpenCV is released under a BSD license and hence it is free for both academic and commercial use. It has C++, C, Python, and Java interfaces, and it supports Windows, Linux, Mac OS, iOS, and Android.

OpenCV was designed for computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library can take advantage of multi-core processing.

Some of the basic features of OpenCV are described below −

Sr.No.Feature & Description
1Smoothing ImagesThis involves applying Blur, GaussianBlur, medianBlur, and bilateral Filter.
2Eroding and DilatingIt can apply two very common morphology operators − Dilation and Erosion.
3Morphology TransformationsOpenCV function morphologyEx to apply Morphological Transformation such as opening, closing, TopHat, and BlackHat etc.
4Image PyramidsOpenCV functions pyrUp and pyrDown to down sample or up sample a given image.
4Basic Thresholding OperationsIt can perform basic thresholding operations using OpenCV function threshold.
5Adding borders to your imagesOpenCV function copyMakeBorder is used to set the borders(extra padding to your image).
7RemappingIn OpenCV, the function remap offers a simple remapping implementation.
8Histogram CalculationFor simple purposes, OpenCV implements the function calcHist, which calculates the histogram of a set of arrays (usually images or image planes). It can operate with up to 32 dimensions.

Integrating OpenCV

These following steps explain how to integrate OpenCV into your applications.

Download OpenCV

You can download OpenCV from their official Website here.

Create User Library

Further, we create a user library of OpenCV, so that we can use it as a future project.

Launch Eclipse

Select Window -> Preferences from the menu.

Navigate under Java -> Build Path -> User Libraries and click New.

Introduction to OpenCV Tutorial

Now enter the name for your library. For example, OpenCV-2.4.6.

After that, select your new user library(i.e. OpenCV-2.4.6) and click on Add External JARs.

Browse through C:\OpenCV-2.4.6\build\java\ and select opencv-246.jar. After adding the jar, extend the opencv-246.jar and select Native library location and press Edit.

Introduction to OpenCV Tutorial

Select External Folder… and browse to select the folder C:\OpenCV-2.4.6\build\java\x64. If you have a 32-bit system, you need to select the x86 folder instead of x64.

Press Ok and you are done.

Now your user library is created. Now you can reuse this configuration in any of the project.

Create OpenCV Project

Create a new java project in eclipse.

On the Java Settings step, under Libraries tab, select Add Library… and select OpenCV-2.4.6, then click Finish.

Introduction to OpenCV Tutorial

Click finish and you are done.


Comments

Leave a Reply

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