One obvious way to guarantee an optimal solution to the problem
of finding optimal weights would be a brute-force search through
the possible weights. The search space could be restricted to a finite
number of possible values by quantizing the weight values and
limiting them to a predefined range. If the weights assigned to rectangles
are restricted to d values, then the number of distinct weight
combinations for two, three and four rectangle Haar-like features
are ( d
2 ), ( d
3 ) and ( d
4 ), respectively. For each of these weight combinations,
optimal values of and p need to be determined, which makes
brute-force search extremely time consuming. The search space can