threshold to determine Haar Feature

305 Views Asked by At

I try now to understand the Viola-Jones algorithm and I get confused about the threshold to determine if a block a Haar feature or not. The intensity of a pixel is in the range of 0->255.

When we have an ideal Haar feature then the delta value is 255 (like the image on the left) but in a real image, for example on the right, delta is 146, is that a Haar feature?

my question is: which value is the threshold value to determine if a block a Haar feature or not? Or it is simply 255/2=127,5? When delta > 127.5 -> Haar feature, when delta < 127.5 -> no Haar feature?

enter image description here

1

There are 1 best solutions below

0
On

I would like to point on some details that might help you understand Viola-Jone's algorithm.

According to the original article of Paul Viola and Michael Jones, the algorithm contains 4 main steps:

  1. Haar Feature Selection
  2. Creating an Integral Image
  3. Adaboost Training
  4. Cascading Classifiers

What you describe relates to the third stage. There is no one uniform threshold that determines if a block is a Haar feature or not. Instead, the algorithm uses Adaboost (machine learning algorithm) on training data to determine the desired value of the threshold.

"Stages in the cascade are constructed by training classifiers using AdaBoost and then adjusting the threshold to minimize false negatives."(End of page 4 in the above article)

After that in stage 4, the algorithm uses the threshold from stage 3 to classify the image.