Upload
dangtram
View
248
Download
1
Embed Size (px)
Citation preview
Getting Started with OpenCV Using Visual Studio Using this pictorial guide, you will be able to create a console application with Visual Studio using OpenCV computer vision library. You will need to install Visual Studio (2005 or 2008): the express editions are available for free.
1. Install Visual Studio.
2. 2. Download OpenCV and install: http://sourceforge.net/project/showfiles.php?group_id=22870.
3. See the samples folder in Start>OpenCV>Samples. Play with some executables.
4. To learn about OpenCV, read the wiki or the CVPR course on the sourceforge website.
5. Attempt to open an image, display it and close it by writing your own program.
The following pictures will guide you on how to do the last step above.
Start Visual Studio and use the menu command shown below to create a new project.
Select the Win32 Console Application. Type a name for the project and the solution. Click Next.
Select Empty Project and click finish.
A project within the solution will be created.
Right click the project and select Add>New Item to add new code.
Slect Code>C++ File (.cpp). Give a file name
Now you can type in code.
After you type in your code, you can build.
In order to use OpenCV you should add the header file folder,
Adding Header File Folders (Once)
Include the Include File Directories
For every project include cv, cxcore, highgui and optionally ml include folders.
Add the Library File folder.
Open the project properties window to add the library files.
Select project properties and add the libraries: cxcore.lib, cv.lib, highgui.lib, and optionally ml.lib.
You may need to setup the system path as well for the system to find the DLLs.
Images that you use should be located along with your .cpp files, unless you specify the path within your code.