public class SummedSqAreaTable 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.
Modifier and Type | Field and Description |
---|---|
FImage |
sqSum
The squared sum data
|
FImage |
sum
The sum data
|
Constructor and Description |
---|
SummedSqAreaTable()
Construct an empty SAT
|
SummedSqAreaTable(FImage image)
Construct a SAT from the provided image
|
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) |
public SummedSqAreaTable()
public SummedSqAreaTable(FImage image)
image
- the imageprotected void computeTable(FImage image)
public float calculateSumArea(int x1, int y1, int x2, int y2)
x1
- x1y1
- y1x2
- x2y2
- y2public float calculateSumArea(Rectangle r)
r
- rectanglepublic float calculateSqSumArea(int x1, int y1, int x2, int y2)
x1
- x1y1
- y1x2
- x2y2
- y2public float calculateSqSumArea(Rectangle r)
r
- rectanglepublic void analyseImage(FImage image)
ImageAnalyser
analyseImage
in interface ImageAnalyser<FImage>
image
- The image to process in place.