org.openimaj.image.analysis.algorithm

## Class SummedAreaTable

• All Implemented Interfaces:
ImageAnalyser<FImage>

```public class SummedAreaTable
extends Object
implements ImageAnalyser<FImage>```
Implementation of an Integral Image or Summed Area Table.

See http://en.wikipedia.org/wiki/Summed_area_table and http://research.microsoft .com/en-us/um/people/viola/Pubs/Detect/violaJones_IJCV.pdf

Basically, this provides an efficient way to find the sum of all pixels in a rectangular area of an image.

Author:
Jonathon Hare (jsh2@ecs.soton.ac.uk)
• ### Field Summary

Fields
Modifier and Type Field and Description
`FImage` `data`
The SAT data
• ### Constructor Summary

Constructors
Constructor and Description
`SummedAreaTable()`
Construct an empty SAT
`SummedAreaTable(FImage image)`
Construct a SAT from the provided image
• ### Method Summary

All Methods
Modifier and Type Method and Description
`void` `analyseImage(FImage image)`
Analyse an image.
`float` ```calculateArea(int x1, int y1, int x2, int y2)```
Calculate the sum of pixels in the image used for constructing this SAT within the rectangle defined by (x1,y1) [top-left coordinate] and (x2,y2) [bottom- right coordinate]
`float` `calculateArea(Rectangle r)`
Calculate the sum of pixels in the image used for constructing this SAT within the given rectangle
`protected void` `computeTable(FImage image)`
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### data

`public FImage data`
The SAT data
• ### Constructor Detail

• #### SummedAreaTable

`public SummedAreaTable()`
Construct an empty SAT
• #### SummedAreaTable

`public SummedAreaTable(FImage image)`
Construct a SAT from the provided image
Parameters:
`image` - the image
• ### Method Detail

• #### computeTable

`protected void computeTable(FImage image)`
• #### calculateArea

```public float calculateArea(int x1,
int y1,
int x2,
int y2)```
Calculate the sum of pixels in the image used for constructing this SAT within the rectangle defined by (x1,y1) [top-left coordinate] and (x2,y2) [bottom- right coordinate]
Parameters:
`x1` - x1
`y1` - y1
`x2` - x2
`y2` - y2
Returns:
sum of pixels in given rectangle
• #### calculateArea

`public float calculateArea(Rectangle r)`
Calculate the sum of pixels in the image used for constructing this SAT within the given rectangle
Parameters:
`r` - rectangle
Returns:
sum of pixels in given rectangle
• #### analyseImage

`public void analyseImage(FImage image)`
Description copied from interface: `ImageAnalyser`
Analyse an image.
Specified by:
`analyseImage` in interface `ImageAnalyser<FImage>`
Parameters:
`image` - The image to process in place.