@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 class Detector extends AbstractMultiScaleObjectDetector<FImage,Rectangle>
StageTreeClassifier
and maximum is the image size), and a
scale-factor which determines the amount to change between scales. At a given
scale, the entire image is searched. In order to speed-up detection, if no
detection is made for a given (x, y) coordinate, the x-ordinate position is
incremented by bigStep()
, otherwise it is incremented by
smallStep()
.
Important note: This detector is NOT thread-safe due to the
fact that StageTreeClassifier
s are not themselves thread-safe. Do not
attempt to use it in a multi-threaded environment!
Modifier and Type | Field and Description |
---|---|
protected int |
bigStep |
protected StageTreeClassifier |
cascade |
static int |
DEFAULT_BIG_STEP
Default step size to make when there is definitely no detection.
|
static float |
DEFAULT_SCALE_FACTOR
Default scale factor multiplier.
|
static int |
DEFAULT_SMALL_STEP
Default step size to make when there is a hint of detection.
|
protected float |
scaleFactor |
protected int |
smallStep |
maxSize, minSize, roi
Constructor and Description |
---|
Detector(StageTreeClassifier cascade)
Construct the
Detector with the given tree of stages, and the
default parameters for step sizes and scale factor. |
Detector(StageTreeClassifier cascade,
float scaleFactor)
Construct the
Detector with the given tree of stages and scale
factor. |
Detector(StageTreeClassifier cascade,
float scaleFactor,
int smallStep,
int bigStep)
Construct the
Detector with the given parameters. |
Modifier and Type | Method and Description |
---|---|
int |
bigStep()
Get the step size the detector will make if there is definitely no
detection.
|
void |
bigStep(int bigStep)
Set the step size the detector will make if there is definitely no
detection.
|
List<Rectangle> |
detect(FImage image)
Detect objects in the given image and return representations of them.
|
protected void |
detectAtScale(SummedSqTiltAreaTable sat,
int startX,
int stopX,
int startY,
int stopY,
float ystep,
int windowWidth,
int windowHeight,
List<Rectangle> results)
Perform detection at a single scale.
|
StageTreeClassifier |
getClassifier()
Get the classifier tree or cascade used by this detector.
|
float |
getScaleFactor()
Get the scale factor (the amount to change between scales
(multiplicative)).
|
void |
setScaleFactor(float scaleFactor)
Set the scale factor (the amount to change between scales
(multiplicative)).
|
void |
setSmallStep(int smallStep)
Set the step size the detector will make if there is any hint of a
detection.
|
int |
smallStep()
Get the step size the detector will make if there is any hint of a
detection.
|
getMaximumDetectionSize, getMinimumDetectionSize, setMaximumDetectionSize, setMinimumDetectionSize, setROI
public static final int DEFAULT_SMALL_STEP
public static final int DEFAULT_BIG_STEP
public static final float DEFAULT_SCALE_FACTOR
protected StageTreeClassifier cascade
protected float scaleFactor
protected int smallStep
protected int bigStep
public Detector(StageTreeClassifier cascade, float scaleFactor, int smallStep, int bigStep)
Detector
with the given parameters.cascade
- the cascade or tree of stages.scaleFactor
- the amount to change between scales (multiplicative)smallStep
- the amount to step when there is a hint of detectionbigStep
- the amount to step when there is definitely no detectionpublic Detector(StageTreeClassifier cascade, float scaleFactor)
Detector
with the given tree of stages and scale
factor. The default step sizes are used.cascade
- the cascade or tree of stages.scaleFactor
- the amount to change between scalespublic Detector(StageTreeClassifier cascade)
Detector
with the given tree of stages, and the
default parameters for step sizes and scale factor.cascade
- the cascade or tree of stages.protected void detectAtScale(SummedSqTiltAreaTable sat, int startX, int stopX, int startY, int stopY, float ystep, int windowWidth, int windowHeight, List<Rectangle> results)
sat
- the summed area table(s)startX
- the starting x-ordinatestopX
- the stopping x-ordinatestartY
- the starting y-ordinatestopY
- the stopping y-ordinateystep
- the amount to stepwindowWidth
- the window width at the current scalewindowHeight
- the window height at the current scaleresults
- the list to store detection results inpublic List<Rectangle> detect(FImage image)
ObjectDetector
If no objects are detected, null
or an empty list may be
returned.
image
- the image to detect the object in.null
if none are found.public int smallStep()
bigStep()
.public int bigStep()
smallStep()
.public void setSmallStep(int smallStep)
bigStep()
.smallStep
- The amount to step on any hint of detection.public void bigStep(int bigStep)
smallStep()
.bigStep
- The amount to step when there is definitely no detection.public float getScaleFactor()
public void setScaleFactor(float scaleFactor)
scaleFactor
- the scale factor to setpublic StageTreeClassifier getClassifier()