Cognotics Home  
Search Cognotics:
.
Home > OpenCV Resources > Seeing With OpenCV > Part 1 Pages:   Prev   1   2   3   4   Next
.
 
Part 1: Introduction to OpenCV (Continued)
This article originally appeared in SERVO Magazine, January 2007. Reprinted by permission of T & L Publications, Inc.
 

Organization

OpenCV's functionality is contained in several modules.

CXCORE contains basic datatype definitions. For example, the data structures for image, point, and rectangle are defined in cxtypes.h. CXCORE also contains linear algebra and statistics methods, the persistence functions, and error handlers. Somewhat oddly, the graphics functions for drawing on images are located here as well.

CV contains image processing and camera calibration methods. The computational geometry functions are also located here.

CVAUX is described in OpenCV's documentation as containing obsolete and experimental code. However, the simplest interfaces for face recognition are in this module. The code behind them is specialized for face recognition, and they're widely used for that purpose.

ML contains machine-learning interfaces.

The remaining functionality is contained in HighGUI and CVCAM. Both of these are located in a directory named "otherlibs," making them easy to miss. Since HighGUI contains the basic I/O interfaces, you'll want to be sure you don't overlook it! It also contains the multi-platform windowing capabilities.

CVCAM contains interfaces for video access through DirectX on 32-bit Windows platforms. However, HighGUI also contains video interfaces . In this article, I'll cover only the interfaces in HighGUI. They're simpler to use, and they work on all platforms. If you're using Windows XP or 2000, you may get a performance boost by switching to the CVCAM interfaces, but for learning OpenCV, the simpler ones in HighGUI are just fine.

Installing OpenCV

Basic Install

OpenCV for linux or MacOSX is packaged as a source-code archive. You'll need to build both static and shared-object libraries. You can either build an RPM first, and install from that, or compile and install it directly. Instructions for doing both are in INSTALL.

The Windows download is packaged as an executable that installs OpenCV when you run it. It places OpenCV files into a directory of your choice, optionally modifies your system path to include the OpenCV binaries, and registers several DirectX filters. By default, it installs to C:/Program Files/OpenCV/>version<.

Customizing a Windows Install

Windows users, OpenCV is easy to install, and the default installation will work. But a bit of advance planning may leave you happier with the results. Here are a few suggestions.

Since OpenCV is a developers' toolkit, not a program, you may want to locate it somewhere other than your Program Files directory. If you do prefer to locate it elsewhere, decide that before you run the installer, and enter that location when asked.

I suggest you also decide, before installing, how you want Windows to find the OpenCV dlls. You can either modify your system's PATH variable to include their location, or you can move them, after installing, from OpenCV's "bin" directory to your SYSTEM_ROOT directory.

If you prefer to move the dlls, but aren't sure where your SYSTEM_ROOT directory is, you can locate it by running the sysinfo utility available at www.cognotics.com/utilities.

If you prefer to modify the PATH, rather than moving the dlls, you can have the installer do that for you by selecting the check box "Add bin directory to PATH."

Figure 1 .

Figure 2. Selecting OpenCV header files in Windows to place into a single include directory

After Installing

The OpenCV directory contains several subdirectories. The docs directory contains html documentation for all the OpenCV functions and datatypes. Since the best documentation is a working example, you might also want to browse the "samples" directory.

The header files you'll need to include when you compile programs that use OpenCV are distributed among the OpenCV modules. Although you don't need to do this, I like to gather them together into a single include directory.

On both linux and Windows, you can locate the headers by searching the install directory and subdirectories for filenames that match the pattern *.h, *.hpp. There will be lots of matches. You don't need all of them. Headers for all modules except HighGUI are in separate "include" directories inside each module. You can skip headers in the "src" directories for these modules. For HighGUI, you'll need highgui.h, located in otherlibs/highgui.

.
Source Code for this Article CONTINUED   Prev   1   2   3   4   Next
. .
.
.
 
Source Code for this Article
 
Related Resources:

Download OpenCV
Official OpenCV usergroup
OpenCV Wiki

 
Articles in this series:

Part 1: Introduction to OpenCV

Part 2: Finding Faces in Images

Part 3: Follow that Face!

Part 4: Face Recognition With Eigenface

Part 5: Implementing Eigenface
 
.
bottom margin
Home | OpenCV Resources | Seeing With OpenCV