0% found this document useful (0 votes)
115 views

Introduction To OpenCV

The document provides an introduction and overview of OpenCV including what it is, what it can do, and how to set it up in Visual Studio 2008 and CodeBlocks. OpenCV is an open-source library for image processing and computer vision. It can be used for image manipulation, I/O, processing, analysis, recognition and more. Setup involves downloading OpenCV, installing dependencies, configuring include and library paths in the IDE, and adding OpenCV library files in the project properties. A sample program is provided to load and display an image.

Uploaded by

windywake3910
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

Introduction To OpenCV

The document provides an introduction and overview of OpenCV including what it is, what it can do, and how to set it up in Visual Studio 2008 and CodeBlocks. OpenCV is an open-source library for image processing and computer vision. It can be used for image manipulation, I/O, processing, analysis, recognition and more. Setup involves downloading OpenCV, installing dependencies, configuring include and library paths in the IDE, and adding OpenCV library files in the project properties. A sample program is provided to load and display an image.

Uploaded by

windywake3910
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Introduction to OpenCV

Dr. Chung-Hao Chen


Haole Guo
Sep 2011
Index
1. What is OpenCV
2. What can OpenCV do
3. How to setup OpenCV
What is OpenCV ?
OpenCVis a based onC / C +
+language,open sourceimage
processinglibrary
Develop by Inter
Free to use
What can OpenCV do
Image data manipulation
Image and video I/O
Matrix and vector manipulation and linear algebra
routines
Various dynamic data structures
Basic image processing
Structural
Camera calibration
Motion analysis
Object recognition
Basic GUI
Image labeling
How to setup openCV ?
Downlinks:
1. OpenCV lib
http://sourceforge.net/projects/opencvlibrary/files
/
2.VS2008
http://www.microsoft.com/express/product/defaul
t.aspx
3.Codeblock
http://www.codeblocks.org/
4. Cmake

http://www.cmake.org/cmake/resources/software
.html
Download OpenCV and
install
Download the OpenCV
2.1.0 Windows installer from
SourceForge- "OpenCV-2.1.0-win32-
vs2008.exe".
Install it to a folder (without any
spaces in it), say "C:\OpenCV2.1\".
This article will refer to this path as
$openCVDir
During installation, enable the option
"Add OpenCV to the system PATH for
Setup OpenCV in VS2008
1. Configure Visual Studio
Open VC++ Directories configuration: Tools > Options
> Projects and Solutions > VC++ Directories
Choose "Show directories for: Include files"
Add "$openCVDir\include\opencv"
Choose "Show directories for: Library files"
Add "$openCVDir\lib"
Choose "Show directories for: Source files"
Add "$openCVDir\src\cv"
Add "$openCVDir\src\cvaux"
Add "$openCVDir\src\cxcore"
Add "$openCVDir\src\highgui"
Setup OpenCV in VS2008
2. Configure your Project
After you've created a project you'll need to add the OpenCV
dependencies.
Open Project Properties: Project > %projectName% Properties...
Open Linker Input properties: Configuration Properties > Linker
> Input
Open the "..." window to edit "Additional Dependencies" and on
each line put:
"cv210.lib"
"cxcore210.lib"
"highgui210.lib"
And any other lib file necessary for your project
Your project should now build. If you get any errors try restarting
Visual Studio and then doing a clean Rebuild.
Setup openCV in VS2008
3. Support video on youtube
http://www.youtube.com/watch?v=9nPp
a_WiArI
Setup openCV in Codeblock
1.Build project
Setup OpenCV in Codeblock
2.Name and address
Setup openCV in codeblock
3.Write a test program
Setup openCV in codeblock
Sample program
#include "cv.h"
#include "highgui.h"
int main( int argc, char** argv )
{
IplImage* pImg;

if( argc == 2 &&


(pImg = cvLoadImage( argv[1], 1)) != 0 )
{ cvNamedWindow( "Image", 1 );
cvShowImage( "Image", pImg );
cvWaitKey(0);
cvDestroyWindow( "Image" );
cvReleaseImage( &pImg );
return 0;
}
return -1;
}
Setup openCV in codeblock
4. Go setup build options
Setup openCV in codeblock
5.Build option- search directories -
complier
Setup openCV in codeblock
6.Build option search directories -
linker
Setup openCV in codeblock
7.Build option linker settings
Setup openCV in codeblock
8. Setup input image
Setup openCV in codeblock
9.Result output:

You might also like