Haar Features

Haar features (named for their resemblance to Haar wavelets) are a set of image filters formed by summing and subtracting purely rectangular subregions of the image (PP99). Examples of Haar features are shown in Figure 7.1. The filter output is the sum of the gray levels of the pixels covered by the white regions minus the sum of the values of the pixels covered by the black regions. By their nature, these filters can be implemented efficiently using the integral image (Section 1.15).

Haar features are used to approximate convolutions when detecting keypoints with SURF, or as input features for decision trees to produce weak classifiers.

Figure 7.1: Examples of Haar features. The regions covered by the light and dark areas are summed and subtracted, respectively.
Image 2h Image 2v Image 3H Image 3V Image 4q Image 2c

Although the shape could in principle be arbitrary, the number of basis functions for the features is usually limited; overly complex and computationally expensive features are avoided where possible.

In addition to selecting the type of feature, the subregion to which it is applied must also be selected: each subwindow in the region under analysis yields a value when one of these many features is applied. Identifying the most discriminative features is part of the training process (using Decision Stumps ordered by AdaBoost) or can be done with techniques such as PCA.

Paolo medici
2026-10-06