Class TldVarianceFilter<T extends ImageGray<T>>


public class TldVarianceFilter<T extends ImageGray<T>> extends Object
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 Details

    • TldVarianceFilter

      public TldVarianceFilter(Class<T> imageType)
      Constructor which specifies the input image type.
      imageType - Either GrayU8 or GrayF32
    • TldVarianceFilter

      protected TldVarianceFilter()
  • Method Details

    • setImage

      public void setImage(T gray)
      Sets the input image. Must be called before other functions/
      gray - input image
    • selectThreshold

      public void selectThreshold(ImageRectangle r)
      Selects a threshold based on image statistics. The paper suggestions 1/2 the variance in the initial patch
    • checkVariance

      public boolean checkVariance(ImageRectangle r)
      Performs variance test at the specified rectangle
      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.
    • computeVarianceSafe

      protected double computeVarianceSafe(int x0, int y0, int x1, int y1)
      Computes the variance inside the specified rectangle.
    • transformSq

      public static void transformSq(GrayU8 input, GrayS64 transformed)
      Integral image of pixel value squared. integer
    • transformSq

      public static void transformSq(GrayF32 input, GrayF64 transformed)
      Integral image of pixel value squared. floating point
    • getThresholdLower

      public double getThresholdLower()