Viola-Jones Algorithm

Normally, every algorithm has a set of instructions, something without which this algorithm couldn’t exist on a basic level, and its remainder is as of now based on its instructions. In the Viola-Jones algorithm, these instructions are made up of Haar signs, which are a set of rectangular kernels:

Types of Haar Features

In the earlier version of the Viola-Jones algorithm, only signs without rotations were used, and in order to calculate the value of the result, the sum of the pixel intensity of one subregion was subtracted from the sum of pixel intensity of another subregion [1].

Haar Features without rotation

In the development phase of the method, signs with a rotation angle of 45 degrees and asymmetric configurations were proposed. Also, instead of calculating the normal difference, it was proposed to assign a certain weight to each subregion and calculate the corresponding values ​​as a weighted sum of pixels of different types of regions [2]:

Where the weights(Wi), the rectangles, and N are arbitrarily chosen.

To decide the class in each cascade, there is a sum of the quantities ​​of the weak classifiers of this cascade. Each weak classifier gives two quantities, depending upon whether the value of the attribute belonging to this classifier is greater or less than a given threshold.

Where w1 is a feature weight, norm(i, j) is the norm factor (standard deviation on the rectangle containing all features), threshold(t), is a parameter of the classifier.

For fast calculation, the integral image method is used.

#machine-learning #programming #python #opencv #computer-vision

Haar Cascade Classifiers in OpenCV Explained Visually
5.30 GEEK