public class MultiThreadedDetector extends Detector
Detector
. The search algorithm is
identical, but the image is separated into multiple vertical stripes for each
thread to process independently.
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!
bigStep, cascade, DEFAULT_BIG_STEP, DEFAULT_SCALE_FACTOR, DEFAULT_SMALL_STEP, scaleFactor, smallStep
maxSize, minSize, roi
Constructor and Description |
---|
MultiThreadedDetector(StageTreeClassifier cascade)
Construct the
MultiThreadedDetector with the given tree of
stages, and the default parameters for step sizes and scale factor. |
MultiThreadedDetector(StageTreeClassifier cascade,
float scaleFactor)
Construct the
MultiThreadedDetector with the given tree of stages
and scale factor. |
MultiThreadedDetector(StageTreeClassifier cascade,
float scaleFactor,
int smallStep,
int bigStep,
ThreadPoolExecutor threadPool)
Construct the
MultiThreadedDetector with the given parameters. |
Modifier and Type | Method and Description |
---|---|
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.
|
bigStep, bigStep, detect, getClassifier, getScaleFactor, setScaleFactor, setSmallStep, smallStep
getMaximumDetectionSize, getMinimumDetectionSize, setMaximumDetectionSize, setMinimumDetectionSize, setROI
public MultiThreadedDetector(StageTreeClassifier cascade, float scaleFactor, int smallStep, int bigStep, ThreadPoolExecutor threadPool)
MultiThreadedDetector
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 detectionthreadPool
- the thread pool. If null
the global pool is used.public MultiThreadedDetector(StageTreeClassifier cascade, float scaleFactor)
MultiThreadedDetector
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 MultiThreadedDetector(StageTreeClassifier cascade)
MultiThreadedDetector
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)
Detector
detectAtScale
in class Detector
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 in