You are on page 1of 23

Computer Vision and Its Applications

OpenCV 2.4.8 Introduction

Jison G.S. Hsu

Department of Mechanical Engineering


NTUST

Computer Vision, Js Hsu

Build the OpenCV library


For system other than Windows and Visual Studio 2010,
please look for more details on official installation guide
http://docs.opencv.org/doc/tutorials/introduction/table_of
_content_introduction/table_of_content_introduction
Download OpenCV-2.4.8
http://opencv.org/downloads.html
OpenCV v2.4.8 documentation
http://opencv.itseez.com/

Computer Vision, Js Hsu

Unpack OpenCV

Path_A

Computer Vision, Js Hsu

Open a new project

Computer Vision, Js Hsu

Open a new project

Computer Vision, Js Hsu

Configure your project


Add two folders to Your_project directory
External_lib

workingdir32

Computer Vision, Js Hsu

Configure your project


Copy lib files from opencv\build\x86\vc10\lib
To Your_project\External_lib

Computer Vision, Js Hsu

Configure your project


Copy include files from opencv\build\include
To Your_project\External_lib

Computer Vision, Js Hsu

Configure your project


Copy dll files from opencv\build\x86\vc10\bin
To Your_project\workingdir32

Computer Vision, Js Hsu

Configure your project

Computer Vision, Js Hsu

Configure your project


Include path

Click

Computer Vision, Js Hsu

Configure your project


Include path

$(SolutionDir)External_lib\include
$(SolutionDir)External_lib\include\opencv
$(SolutionDir)External_lib\include\opencv2

Computer Vision, Js Hsu

Configure your VS2010


Add lib files

$(SolutionDir)External_lib\lib

Computer Vision, Js Hsu

Configure your VS2010


Add lib files

Click

Computer Vision, Js Hsu

Configure your VS2010


Add lib files
opencv_calib3d248d.lib
opencv_contrib248d.lib
opencv_core248d.lib
opencv_features2d248d.lib
opencv_flann248d.lib
opencv_gpu248d.lib
opencv_highgui248d.lib
opencv_imgproc248d.lib
opencv_legacy248d.lib
opencv_ml248d.lib
opencv_nonfree248d.lib
opencv_objdetect248d.lib
opencv_photo248d.lib
opencv_stitching248d.lib
opencv_ts248d.lib
opencv_video248d.lib
opencv_videostab248d.lib
Computer Vision, Js Hsu

Configure your project


workingdir

$(SolutionDir)workingdir32

Computer Vision, Js Hsu

Example 1
Load, Show, and Save an Image

Computer Vision, Js Hsu

Exercise 1
OpenCV

Hint :
cvtColor ( input image , output image , CV_BGR2GRAY )

Computer Vision, Js Hsu

openCV
BGR

Computer Vision, Js Hsu

Example 2 RGB split

BGR

Hint : split( Mat input , vector<Mat> output )


Computer Vision, Js Hsu

Exercise 2
OpenCV
Split

Computer Vision, Js Hsu

Computer Vision, Js Hsu

Example 3 Image blur

Hint : blur( Mat input , Mat output


, winsize )
Computer Vision, Js Hsu

You might also like