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

Getting Started With Opencv Using Visual Studio: Group - Id 22870

This document provides a pictorial guide to setting up a basic OpenCV application in Visual Studio. The steps include installing Visual Studio and OpenCV, creating a new console application project, adding OpenCV header and library folders to the project properties, and writing code to open an image, display it, and close it as a simple test. Screenshots illustrate how to perform tasks like creating a new project, adding files, and configuring project properties in Visual Studio.

Uploaded by

abeh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

Getting Started With Opencv Using Visual Studio: Group - Id 22870

This document provides a pictorial guide to setting up a basic OpenCV application in Visual Studio. The steps include installing Visual Studio and OpenCV, creating a new console application project, adding OpenCV header and library folders to the project properties, and writing code to open an image, display it, and close it as a simple test. Screenshots illustrate how to perform tasks like creating a new project, adding files, and configuring project properties in Visual Studio.

Uploaded by

abeh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

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.

You might also like