Articulo de referencia

Tabla de áreas sumadas

Utilizando una tabla de área sumada ( 2. ) de una matriz de 6 × 6 ( 1. ) para sumar un subrectángulo de sus valores; cada punto de color resalta la suma dentro del rectángulo de...

Utilizando una tabla de área sumada ( 2. ) de una matriz de 6 × 6 ( 1. ) para sumar un subrectángulo de sus valores; cada punto de color resalta la suma dentro del rectángulo de ese color.

Una tabla de área sumada es una estructura de datos y un algoritmo para generar de forma rápida y eficiente la suma de valores en un subconjunto rectangular de una cuadrícula. En el ámbito del procesamiento de imágenes , también se la conoce como imagen integral . Fue introducida en los gráficos por computadora en 1984 por Frank Crow para su uso con mipmaps . En visión por computadora, fue popularizada por Lewis [ 1 ] y posteriormente recibió el nombre de "imagen integral", utilizándose prominentemente dentro del marco de detección de objetos de Viola-Jones en 2001. Históricamente, este principio es muy conocido en el estudio de funciones de distribución de probabilidad multidimensionales, concretamente en el cálculo de probabilidades 2D (o ND) (área bajo la distribución de probabilidad) a partir de las respectivas funciones de distribución acumulativa . [ 2 ]

El algoritmo

Como su nombre indica, el valor en cualquier punto ( x , y ) de la tabla de área sumada es la suma de todos los píxeles situados por encima y a la izquierda de ( x , y ), inclusive: [ 3 ] [ 4 ]  I(incógnita,y)=incógnitaincógnitayyi(incógnita,y){\displaystyle I(x,y)=\sum _{\begin{smallmatrix}x'\leq x\\y'\leq y\end{smallmatrix}}i(x',y')} dóndei(incógnita,y){\displaystyle i(x,y)}es el valor del píxel en ( x , y ).

La tabla de áreas sumadas se puede calcular de manera eficiente en una sola pasada sobre la imagen, ya que el valor en la tabla de áreas sumadas en ( x , y ) es simplemente: [ 5 ] I(incógnita,y)=i(incógnita,y)+I(incógnita,y1)+I(incógnita1,y)I(incógnita1,y1){\displaystyle I(x,y)=i(x,y)+I(x,y-1)+I(x-1,y)-I(x-1,y-1)}(Tenga en cuenta que la matriz resultante se calcula desde la esquina superior izquierda).

Descripción del cálculo de una suma en la estructura de datos/algoritmo de tabla de áreas sumadas.

Once the summed-area table has been computed, evaluating the sum of intensities over any rectangular area requires exactly four array references regardless of the area size. That is, the notation in the figure at right, having A = (x0, y0), B = (x1, y0), C = (x0, y1) and D = (x1, y1), the sum of i(x,y) over the rectangle spanned by A, B, C, and D is: x0<xx1y0<yy1i(x,y)=I(D)+I(A)I(B)I(C){\displaystyle \sum _{\begin{smallmatrix}x_{0}<x\leq x_{1}\\y_{0}<y\leq y_{1}\end{smallmatrix}}i(x,y)=I(D)+I(A)-I(B)-I(C)}

Extensions

This method is naturally extended to continuous domains.[2]

The method can be also extended to high-dimensional images.[6] If the corners of the rectangle are xp{\displaystyle x^{p}} with p{\displaystyle p} in {0,1}d{\displaystyle \{0,1\}^{d}}, then the sum of image values contained in the rectangle are computed with the formula p{0,1}d(1)dp1I(xp){\displaystyle \sum _{p\in \{0,1\}^{d}}(-1)^{d-\|p\|_{1}}I(x^{p})} where I(x){\displaystyle I(x)} is the integral image at x{\displaystyle x} and d{\displaystyle d} the image dimension. The notation xp{\displaystyle x^{p}} correspond in the example to d=2{\displaystyle d=2}, A=x(0,0){\displaystyle A=x^{(0,0)}}, B=x(1,0){\displaystyle B=x^{(1,0)}}, C=x(1,1){\displaystyle C=x^{(1,1)}} and D=x(0,1){\displaystyle D=x^{(0,1)}}. In neuroimaging, for example, the images have dimension d=3{\displaystyle d=3} or d=4{\displaystyle d=4}, when using voxels or voxels with a time-stamp.

This method has been extended to high-order integral image as in the work of Phan et al.[7] who provided two, three, or four integral images for quickly and efficiently calculating the standard deviation (variance), skewness, and kurtosis of local block in the image. This is detailed below:

To compute variance or standard deviation of a block, we need two integral images: I(x,y)=xxyyi(x,y){\displaystyle I(x,y)=\sum _{\begin{smallmatrix}x'\leq x\\y'\leq y\end{smallmatrix}}i(x',y')}I2(x,y)=xxyyi2(x,y){\displaystyle I^{2}(x,y)=\sum _{\begin{smallmatrix}x'\leq x\\y'\leq y\end{smallmatrix}}i^{2}(x',y')} The variance is given by: Var(X)=1ni=1n(xiμ)2.{\displaystyle \operatorname {Var} (X)={\frac {1}{n}}\sum _{i=1}^{n}(x_{i}-\mu )^{2}.} Let S1{\displaystyle S_{1}} and S2{\displaystyle S_{2}} denote the summations of block ABCD{\displaystyle ABCD} of I{\displaystyle I} and I2{\displaystyle I^{2}}, respectively. S1{\displaystyle S_{1}} and S2{\displaystyle S_{2}} are computed quickly by integral image. Now, we manipulate the variance equation as: Var(X)=1ni=1n(xi22μxi+μ2)=1n[i=1nxi22i=1nμxi+i=1nμ2]=1n[i=1nxi22i=1nμxi+nμ2]=1n[i=1nxi22μi=1nxi+nμ2]=1n[S22S1nS1+n(S1n)2]=1n[S2S12n]{\displaystyle {\begin{aligned}\operatorname {Var} (X)&={\frac {1}{n}}\sum _{i=1}^{n}\left(x_{i}^{2}-2\mu x_{i}+\mu ^{2}\right)\\[1ex]&={\frac {1}{n}}\left[\sum _{i=1}^{n}x_{i}^{2}-2\sum _{i=1}^{n}\mu x_{i}+\sum _{i=1}^{n}\mu ^{2}\right]\\[1ex]&={\frac {1}{n}}\left[\sum _{i=1}^{n}x_{i}^{2}-2\sum _{i=1}^{n}\mu x_{i}+n\mu ^{2}\right]\\[1ex]&={\frac {1}{n}}\left[\sum _{i=1}^{n}x_{i}^{2}-2\mu \sum _{i=1}^{n}x_{i}+n\mu ^{2}\right]\\[1ex]&={\frac {1}{n}}\left[S_{2}-2{\frac {S_{1}}{n}}S_{1}+n\left({\frac {S_{1}}{n}}\right)^{2}\right]\\[1ex]&={\frac {1}{n}}\left[S_{2}-{\frac {S_{1}^{2}}{n}}\right]\end{aligned}}} Where μ=S1/n{\displaystyle \mu =S_{1}/n} and S2=i=1nxi2{\textstyle S_{2}=\sum _{i=1}^{n}x_{i}^{2}}.

Similar to the estimation of the mean (μ{\displaystyle \mu }) and variance (Var{\displaystyle \operatorname {Var} }), which requires the integral images of the first and second power of the image respectively (i.e. I,I2{\displaystyle I,I^{2}}); manipulations similar to the ones mentioned above can be made to the third and fourth powers of the images (i.e. I3(x,y),I4(x,y){\displaystyle I^{3}(x,y),I^{4}(x,y)}.) for obtaining the skewness and kurtosis.[7] But one important implementation detail that must be kept in mind for the above methods, as mentioned by F Shafait et al.[8] is that of integer overflow occurring for the higher order integral images in case 32-bit integers are used.

Consideraciones para la implementación

Es posible que el tipo de datos para las sumas deba ser diferente y de mayor tamaño que el tipo de datos utilizado para los valores originales, para poder acomodar la suma máxima esperada sin desbordamiento . Para datos de punto flotante, el error se puede reducir mediante la suma compensada .

Véase también

Referencias

  1. Lewis, JP (1995). Fast template matching . Proc. Vision Interface . pp. 120– 123. 
  2. 1 2 Finkelstein, Amir; neeratsharma (2010). "Integrales dobles mediante la suma de valores de la función de distribución acumulativa" . Proyecto de demostración de Wolfram .
  3. Crow, Franklin (1984). "Tablas de área sumada para mapeo de texturas" . SIGGRAPH '84: Actas de la 11.ª conferencia anual sobre gráficos por computadora y técnicas interactivas . págs. 207–212 . doi : 10.1145/800031.808600 . 
  4. Viola, Paul; Jones, Michael (2002). "Detección robusta de objetos en tiempo real" (PDF) . Revista internacional de visión por computadora .
  5. BADGERATI (2010-09-03). "Visión por computadora: la imagen integral" . computersciencesource.wordpress.com . Recuperado el 2017-02-13 .
  6. Tapia, Ernesto (enero de 2011). "Una nota sobre el cálculo de imágenes integrales de alta dimensión". Pattern Recognition Letters . 32 (2): 197– 201. Bibcode : 2011PaReL..32..197T . doi : 10.1016/j.patrec.2010.10.007 .
  7. 1 2 Phan, Thien; Sohoni, Sohum; Larson, Eric C.; Chandler, Damon M. (22 de abril de 2012). "Aceleración de la evaluación de la calidad de imagen basada en el análisis del rendimiento". Simposio IEEE del Suroeste de 2012 sobre Análisis e Interpretación de Imágenes (PDF) . págs. 81–84 . CiteSeerX 10.1.1.666.4791 . doi : 10.1109/SSIAI.2012.6202458 . hdl : 11244/25701 . ISBN   978-1-4673-1830-3. S2CID 12472935 . 
  8. Shafait, Faisal; Keysers, Daniel; M. Breuel, Thomas (enero de 2008). Yanikoglu, Berrin A.; Berkner, Kathrin (eds.). "Implementación eficiente de técnicas de umbralización adaptativa local utilizando imágenes integrales" (PDF) . Electronic Imaging . Document Recognition and Retrieval XV. 6815 : 681510–681510–6. Bibcode : 2008SPIE.6815E..10S . CiteSeerX 10.1.1.109.2748 . doi : 10.1117/12.767755 . S2CID 9284084 .  
  • Implementación de tablas sumadas en la detección de objetos

Vídeos de conferencias

  • Introducción a la teoría que sustenta el algoritmo de imagen integral.
  • Una demostración de una versión continua del algoritmo de imagen integral, del Proyecto de Demostraciones de Wolfram.