Something More for Research

Explorer of Research #HEMBAD

Installing and using OpenCV with Visual Studio 2010 express

Posted by Hemprasad Y. Badgujar on May 4, 2013


Here’s the low-down on installing and getting started with OpenCV on Visual Studio Express 2010 on Windows.

1) Download OpenCV2.2 from Source Forge

Download the OpenCV-2.2.0-win32-vs2010.exe as it already contains the libraries and the binaries required for running OpenCV.

You can untar the file into a directory named /opencv2.2/

2) Download and install Visual Studio 2010 express (free) version and install on your PC.

3) Once Visual Studio 2010  is installed open VC++ and select  “New Project” and choose Win32 Console Application for e.g. first

4) Include the any relevant OpenCV code into first.cpp (snippet given below)

5) Include the following 3 directories under

Project->first properties->VC++ Directories->Include Directories. Click Edit

.\opencv2.2\include

.\opencv2.2\include\opencv

.\opencv2.2\include\opencv2

Click Apply and OK

6) Now include the library path

Project->first properties->Library Directories

.\opencv2.2\lib

Click Apply and OK

7) Now the last step is to include all the necessary OpenCV libraries during the linking phase

For this go to Project->first properties->Linker->Input->Additional Dependencies and cut and paste all the following libraries by clicking the “Edit”

opencv_calib3d220.lib
opencv_calib3d220d.lib
opencv_contrib220.lib
opencv_contrib220d.lib
opencv_core220.lib
opencv_core220d.lib
opencv_features2d220.lib
opencv_features2d220d.lib
opencv_ffmpeg220.lib
opencv_ffmpeg220d.lib
opencv_flann220.lib
opencv_flann220d.lib
opencv_gpu220.lib
opencv_gpu220d.lib
opencv_highgui220.lib
opencv_highgui220d.lib
opencv_imgproc220.lib
opencv_imgproc220d.lib
opencv_legacy220.lib
opencv_legacy220d.lib
opencv_ml220.lib
opencv_ml220d.lib
opencv_objdetect220.lib
opencv_objdetect220d.lib
opencv_ts220.lib
opencv_video220.lib
opencv_video220d.lib

Click Apply and Ok.

8) Now you are good to go. Build by choosing Debug->Build Solution

It should through fine  when  you now run the code

You should see

Here is a sample snippet

#include "stdafx.h"
#include "cv.h"
#include "highgui.h"

int main( int argc, char** argv ) {
// cvLoadImage determines an image type and creates datastructure with appropriate size
    IplImage* img = cvLoadImage("baboon.jpg",1);
// create a window. Window name is determined by a supplied argument
    cvNamedWindow( "test", CV_WINDOW_AUTOSIZE );
    // Apply Gaussian smooth
    //cvSmooth( img, img, CV_GAUSSIAN, 9, 9, 0, 0 );
    cvErode (img, img,NULL,2);
// Display an image inside and window. Window name is determined by a supplied argument
    cvShowImage( "test", img );

    //Save image
        cvSaveImage( "c:\\shanthi\\baboon2.png", img, 0);
// wait indefinitely for keystroke
    cvWaitKey(0);
// release pointer to an object
    cvReleaseImage( &img );
// Destroy a window
    cvDestroyWindow( argv[1] );
}





From  blog: http://gigadom.wordpress.com/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Extracts from a Personal Diary

dedicated to the life of a silent girl who eventually learnt to open up

Num3ri v 2.0

I miei numeri - seconda versione

ThuyDX

Just another WordPress.com site

Algunos Intereses de Abraham Zamudio Chauca

Matematica, Linux , Programacion Serial , Programacion Paralela (CPU - GPU) , Cluster de Computadores , Software Cientifico

josephdung

thoughts...

Tech_Raj

A great WordPress.com site

Travel tips

Travel tips

Experience the real life.....!!!

Shurwaat achi honi chahiye ...

Ronzii's Blog

Just your average geek's blog

Karan Jitendra Thakkar

Everything I think. Everything I do. Right here.

VentureBeat

News About Tech, Money and Innovation

Chetan Solanki

Helpful to u, if u need it.....

ScreenCrush

Explorer of Research #HEMBAD

managedCUDA

Explorer of Research #HEMBAD

siddheshsathe

A great WordPress.com site

Ari's

This is My Space so Dont Mess With IT !!

%d bloggers like this: