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?
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:
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.
After that in stage 4, the algorithm uses the threshold from stage 3 to classify the image.