Package boofcv.alg.tracker.tld
Class TldVarianceFilter<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.tracker.tld.TldVarianceFilter<T>
Compute the variance for a rectangular region using the integral image. Supports both U8 and F32 input images.
For each new image in the sequence a call to
setImage(ImageGray)
must be done
so that it can compute the required integral images. See paper for mathematical details on how the variance
is computed using integral images.-
Constructor Summary
ModifierConstructorDescriptionprotected
TldVarianceFilter
(Class<T> imageType) Constructor which specifies the input image type. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Performs variance test at the specified rectangleprotected double
computeVariance
(int x0, int y0, int x1, int y1) Computes the variance inside the specified rectangle.protected double
computeVarianceSafe
(int x0, int y0, int x1, int y1) Computes the variance inside the specified rectangle.double
void
Selects a threshold based on image statistics.void
Sets the input image.static void
transformSq
(GrayF32 input, GrayF64 transformed) Integral image of pixel value squared.static void
transformSq
(GrayU8 input, GrayS64 transformed) Integral image of pixel value squared.
-
Constructor Details
-
Method Details
-
setImage
Sets the input image. Must be called before other functions/- Parameters:
gray
- input image
-
selectThreshold
Selects a threshold based on image statistics. The paper suggestions 1/2 the variance in the initial patch -
checkVariance
Performs variance test at the specified rectangle- Returns:
- true if it passes and false if not
-
computeVariance
protected double computeVariance(int x0, int y0, int x1, int y1) Computes the variance inside the specified rectangle. x0 and y0 must be > 0.- Returns:
- variance
-
computeVarianceSafe
protected double computeVarianceSafe(int x0, int y0, int x1, int y1) Computes the variance inside the specified rectangle.- Returns:
- variance
-
transformSq
Integral image of pixel value squared. integer -
transformSq
Integral image of pixel value squared. floating point -
getThresholdLower
public double getThresholdLower()
-