Viola-Jones Algorithm - “Sum of Pixels”?

亡梦爱人 提交于 2020-01-15 06:09:03

问题


I have looked at many articles and answers to questions on how the Viola-Jones algorithm really works. I keep finding the answers saying the "sum of pixels" in a certain region subtracted by the "sum of pixels" in the adjacent region. I'm confused on what "sum of pixels" means. What is the value based on? Is it the number of pixels in the area? The intensity of the color?

Thanks in advance.


回答1:


These are the definitions based on Viola-Jones paper on 'Robust Real-time Object Detection'

Integral Image: Integral Image(ii) at location x, y = ii(x,y)

ii(x,y) = > Sum of the pixels above and to the left of x, y inclusive

Here 'Sum of Pixels' implies the sum of pixels intensity values ( e.g., for a 8 bit gray scale image, a value between 0 and 255 ) at each pixel element to the above and to the left of pixel (x, y) and including the row/column x and y, considering a gray scale image in the representation.

Significance of the integral image is that it speeds up the computation of the sum of pixel intensities within any rectangular block of pixels. e.g. four array references.

And the integral image value by itself at each point given by ii(x,y) can be computed in one pass over the original image i(x,y)

using the below equations on each point during the pass as detailed in the reference paper:

s(x,y) = s(x,y-1) + i(x,y);

ii(x,y) = ii(x-1,y) + s(x,y);

where

s(x,y) = the cumulative row sum;
s(x,-1) = 0;
ii(-1,y) = 0;

These integral image values are then used to generate features to learn and later detect objects.




回答2:


The original Viola-Jones algorithm uses "Haar-like" features, which are approximations of first and second Gaussian derivative filters.

Gaussian derivative filters look like this:

Haar-like filters look like this:

The reason Viola and Jones used Haar-like filters, is that they can be evaluated very efficiently. All you have to do is subtract the sum of pixels covered by the black region of the filter from the sum of pixels covered by the white region. And since the regions are rectangular, the sum of the pixels in each region can be efficiently calculated from the corresponding integral image.



来源:https://stackoverflow.com/questions/23171232/viola-jones-algorithm-sum-of-pixels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!