Chapter 2. Introduction to OpenCV
Getting Started
After installing the OpenCV library, our first task is, naturally, to get started and make something interesting happen. In order to do this, we will need to set up the programming environment.
In Visual Studio, it is necessary to create a project and to configure the setup so that (a) the libraries highgui.lib, cxcore.lib, ml.lib, and cv.lib are linked[8] and (b) the preprocessor will search the OpenCV â¦/opencv/*/include directories for header files. These "include" directories will typically be named something like C:/program files/opencv/cv/include,[9] â¦/opencv/cxcore/include, â¦/opencv/ml/include, and â¦/opencv/otherlibs/highgui. Once you've done this, you can create a new C file and start your first program.
Tip
Certain key header files can make your life much easier. Many useful macros are in the header files â¦/opencv/cxcore/include/cxtypes.h and cxmisc.h. These can do things like initialize structures and arrays in one line, sort lists, and so on. The most important headers for compiling are â¦/cv/include/cv.h and â¦/cxcore/include/cxcore.h for computer vision, â¦/otherlibs/highgui/highgui.h for I/O, and â¦/ml/include/ml.h for machine learning.
Get Learning OpenCV now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.