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

• 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

• 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