org.openimaj.image.analysis.algorithm

## Class SummedSqAreaTable

• All Implemented Interfaces:
ImageAnalyser<FImage>
Direct Known Subclasses:
SummedSqTiltAreaTable

```public class SummedSqAreaTable
extends Object
implements ImageAnalyser<FImage>```
Implementation of an Integral Image or Summed Area Table. This Implementation calculates both the sum and squared sum values.

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` `sqSum`
The squared sum data
`FImage` `sum`
The sum data
• ### Constructor Summary

Constructors
Constructor and Description
`SummedSqAreaTable()`
Construct an empty SAT
`SummedSqAreaTable(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` ```calculateSqSumArea(int x1, int y1, int x2, int y2)```
Calculate the sum of squared 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` `calculateSqSumArea(Rectangle r)`
Calculate the sum of squared pixels in the image used for constructing this SAT within the given rectangle
`float` ```calculateSumArea(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` `calculateSumArea(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

• #### sum

`public FImage sum`
The sum data
• #### sqSum

`public FImage sqSum`
The squared sum data
• ### Constructor Detail

• #### SummedSqAreaTable

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

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

• #### computeTable

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

```public float calculateSumArea(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
• #### calculateSumArea

`public float calculateSumArea(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
• #### calculateSqSumArea

```public float calculateSqSumArea(int x1,
int y1,
int x2,
int y2)```
Calculate the sum of squared 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
• #### calculateSqSumArea

`public float calculateSqSumArea(Rectangle r)`
Calculate the sum of squared 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.