I don't quite understand how the pixels are summed in each rectangle area described here: Face Detection using Haar Cascades

It says:

Each feature is a single value obtained by subtracting sum of pixels under white rectangle from sum of pixels under black rectangle.

What are summed in each region (rectangle)? The number of pixels or the intensity of all pixels in that region?

edit retag close merge delete

Thanks @berak. So, the value for the rectangle area is calculated based on the integral image, and each value from the integral image, in turn, is generated from the sum of all pixels (intensity) in the up-left from the original image. Is that right? If it is right, the answer to my question is that it uses the intensity of the pixels to calculate the rectangles value.

Now I have another doubt, about the integral image. It uses the intensity of the current pixel to generate the corresponding value (x,y) for the integral image?

For example:

|10|15|

|18|20|

Original

|10|25|

|28|63|

Integral

Is that correct?

1
• "that it uses the intensity of the pixels to calculate the rectangles value". -- yes.
• sorry, i do not understand the part about the "current pixel"
• in the end, the "absolute" intensity does not matter. think again of those haar rectangles. if the sum of the left rect is larger than the sum of the right, the left one is considered "white", and the right one "black", that's it ;)