Haar Features

The Haar features (the name derives from their similarity to Haar wavelets) refer to a series of image filters constructed as sums and differences of purely rectangular subregions of the image itself (PP99). Examples of Haar features are shown in Figure 6.1. The resulting value of the filter is the sum of the grayscale values of the pixels underlying the areas in white, minus the value of the pixels underlying the areas indicated in black. By their nature, these filters can be efficiently implemented using the integral image (Section 1.14).

Haar Features are used as an approximation of convolutions for calculating key points in the SURF algorithm, or as input features for decision trees to obtain weak classifiers.

Figure 6.1: Examples of Haar Features. In the light areas, the underlying region is summed, while in the dark areas, it is subtracted, respectively.
Image 2h Image 2v Image 3H Image 3V Image 4q Image 2c

Even though the form could potentially be anything, the number of bases for the features is typically limited (efforts are made, if possible, to avoid features that are too complex and computationally intensive).

In addition to the type of feature, it is necessary to select the sub-area of application: from each sub-window of the area to be analyzed, it is indeed possible to extract a value following the application of one of these many features. Identifying the most discriminative features is part of the training activity (Decision Stump ordered with AdaBoost) or through techniques such as PCA.

Paolo medici
2025-10-22