3
Getting to Know OpenCV
OpenCV Data Types
OpenCV has many data types, which are designed to make the representation and handling of important
concepts of computer vision relatively easy and intuitive. At the same time, many algorithm developers
require a set of relatively powerful primitives that can be generalized or extended for their particular needs.
OpenCV attempts to address both of these needs through the use of templates for fundamental data types,
and specializations of those templates that make everyday operations easier.
From an organizational perspective, it is convenient to divide the data types into three major categories.
First, the basic data types are those that are assembled directly from C++ primitives (int, float, etc.).
These types include simple vectors and matrices, as well as representations of simple geometric concepts
like points, rectangles, sizes, and the like. The second category contains helper objects. These objects
represent more abstract concepts such as the garbage collecting pointer class, range objects used for slicing,
and abstractions such as termination criteria. The third category is what might be called large array types.
These are objects whose fundamental purpose is to contain arrays or other assemblies of primitives or,
more often, the basic data types mentioned first. The