Up and running with OpenCV

OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.

This article will guide you in how to install openCV on your windows machine and writing Simple Image Opening Example.

Let’s start with installing OpenCV. There are actually two ways you can fulfill this task. One by directly downloading and using pre-built libraries and another by making your own libraries by compiling OpenCV Source Code. In this tutorial we will discuss only first one.

Now you need to add bin directory of above chosen folder to system path. This is cause you will use the OpenCV library in form of “Dynamic-link libraries” (also known as DLL). Inside these are stored all the algorithms and information the OpenCV library contains.

For Doing programming we are going to use Visual Studio. Before we create any project we need to setup some parameters inside Visual Studio

Go to Tools -> Options -> Projects & Solutions -> VC++ Directories

Select Include Files and Put these paths to it.

1

2

D:\OpenCV\Build\include

D:\OpenCV\Build\include\opencv

Now select Library Files and Put these paths to it.

1

D:\OpenCV\Build\x86\vc10\lib

Now we are done with the installation. Let’s start our first project in OpenCV using C.

Project will be created and default .cpp File will be created with main function in it.

Right Click on newly created Project. Go to its Properties

Go to Project properties menu C/C++ -> General -> Additional Include Directories. Now put following paths to it:

1

2

D:\OpenCV\Build\include

D:\OpenCV\Build\include\opencv

Go to Project properties menu Linker -> Input-> Additional Dependencies. Now put following paths to it (make sure that these file presents in library directory of OpenCV builds, If not make necessary changes in following file names):

From a laptop to a full organization, Ganesh has traveled a tough road. A commando, armed with the latest tech & a huge warehouse of knowledge, he leads by example & is here for the long haul. His strong belief in giving back more has borne rich fruits, both for his employees & clients.