public class SummedAreaTable extends Object implements ImageAnalyser<FImage>
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.
| Constructor and Description |
|---|
SummedAreaTable()
Construct an empty SAT
|
SummedAreaTable(FImage image)
Construct a SAT from the provided image
|
| 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) |
public SummedAreaTable()
public SummedAreaTable(FImage image)
image - the imageprotected void computeTable(FImage image)
public float calculateArea(int x1, int y1, int x2, int y2)
x1 - x1y1 - y1x2 - x2y2 - y2public float calculateArea(Rectangle r)
r - rectanglepublic void analyseImage(FImage image)
ImageAnalyseranalyseImage in interface ImageAnalyser<FImage>image - The image to process in place.