@Reference(type=Inproceedings, author={"Viola, P.","Jones, M."}, title="Rapid object detection using a boosted cascade of simple features", year="2001", booktitle="Computer Vision and Pattern Recognition, 2001. CVPR 2001. Proceedings of the 2001 IEEE Computer Society Conference on", pages={" I","511 "," I","518 vol.1"}, number="", volume="1", customData={"keywords"," AdaBoost; background regions; boosted simple feature cascade; classifiers; face detection; image processing; image representation; integral image; machine learning; object specific focus-of-attention mechanism; rapid object detection; real-time applications; statistical guarantees; visual object detection; feature extraction; image classification; image representation; learning (artificial intelligence); object detection;","doi","10.1109/CVPR.2001.990517","ISSN","1063-6919 "}) public abstract class HaarFeature extends Object
The response of applying the feature to a specific point on an image (with a specific scaling) can be efficiently calculated using summed area tables.
Internally this implementation caches a scaled version of each rectangle for a given detection scale.
Modifier and Type | Field and Description |
---|---|
protected WeightedRectangle[] |
cachedRects |
WeightedRectangle[] |
rects
The rectangles that make up this feature.
|
Modifier and Type | Method and Description |
---|---|
abstract float |
computeResponse(SummedSqTiltAreaTable sat,
int x,
int y)
Compute the response of this feature at the given location.
|
static HaarFeature |
create(boolean tilted,
int x0,
int y0,
int w0,
int h0,
float wt0,
int x1,
int y1,
int w1,
int h1,
float wt1)
Construct a feature with the given parameters.
|
static HaarFeature |
create(boolean tilted,
int x0,
int y0,
int w0,
int h0,
float wt0,
int x1,
int y1,
int w1,
int h1,
float wt1,
int x2,
int y2,
int w2,
int h2,
float wt2)
Construct a feature with the given parameters.
|
static HaarFeature |
create(List<WeightedRectangle> rectList,
boolean tilted)
Create a feature from the given data.
|
void |
setScale(float scale,
float invArea)
Set the current detection scale, setting up the internal caches
appropriately.
|
public WeightedRectangle[] rects
protected WeightedRectangle[] cachedRects
public final void setScale(float scale, float invArea)
scale
- the scaleinvArea
- the inverse of the detector areapublic abstract float computeResponse(SummedSqTiltAreaTable sat, int x, int y)
setScale(float, float)
(this is only required once per scale).sat
- the summed area table(s). If there are tilted features, then
this must include the tilted SAT.x
- the x-ordinate for the window being testedy
- the y-ordinate for the window being testedpublic static HaarFeature create(List<WeightedRectangle> rectList, boolean tilted)
rectList
- the rectangles defining the featuretilted
- is the feature tilted?HaarFeature
object.public static HaarFeature create(boolean tilted, int x0, int y0, int w0, int h0, float wt0, int x1, int y1, int w1, int h1, float wt1)
tilted
- is the feature tilted?x0
- x-ordinate of top-left of first rectangley0
- y-ordinate of top-left of first rectanglew0
- width of first rectangleh0
- height of first rectanglewt0
- weight of first rectanglex1
- x-ordinate of top-left of second rectangley1
- y-ordinate of top-left of second rectanglew1
- width of second rectangleh1
- height of second rectanglewt1
- weight of second rectanglepublic static HaarFeature create(boolean tilted, int x0, int y0, int w0, int h0, float wt0, int x1, int y1, int w1, int h1, float wt1, int x2, int y2, int w2, int h2, float wt2)
tilted
- is the feature tilted?x0
- x-ordinate of top-left of first rectangley0
- y-ordinate of top-left of first rectanglew0
- width of first rectangleh0
- height of first rectanglewt0
- weight of first rectanglex1
- x-ordinate of top-left of second rectangley1
- y-ordinate of top-left of second rectanglew1
- width of second rectangleh1
- height of second rectanglewt1
- weight of second rectanglex2
- x-ordinate of top-left of third rectangley2
- y-ordinate of top-left of third rectanglew2
- width of third rectangleh2
- height of third rectanglewt2
- weight of third rectangle