The two terms, and p, are optimized using a brute-force search
as performed by Viola and Jones [27]. Three different techniques
were used to find optimal weights of the rectangles of the Haar-like
features. The description of these techniques and the motivation for
their use is described in the following sections.