Class MeanShiftPeak<T extends ImageGray<T>>


public class MeanShiftPeak<T extends ImageGray<T>> extends Object
Simple implementations of mean-shift intended to finding local peaks inside an intensity image. Implementations differ in how they weigh each point. In each iterations the mean of the square sample region centered around the target is computed and the center shifted so that location. It stops when change is less than a delta or the maximum number of iterations has been exceeded. If the image border is hit while searching the square will be push back until it is entirely contained inside the image. This is NOT thread safe.
  • Field Details

    • image

      protected T extends ImageGray<T> image
    • interpolate

      protected InterpolatePixelS<T extends ImageGray<T>> interpolate
    • maxIterations

      protected int maxIterations
    • radius

      protected int radius
    • width

      protected int width
    • convergenceTol

      protected float convergenceTol
    • peakX

      protected float peakX
    • peakY

      protected float peakY
    • odd

      protected boolean odd
    • weights

      protected WeightPixel_F32 weights
  • Constructor Details

    • MeanShiftPeak

      public MeanShiftPeak(int maxIterations, float convergenceTol, WeightPixel_F32 weights, boolean odd, Class<T> imageType, BorderType borderType)
      Configures search.
      maxIterations - Maximum number of iterations. Try 10
      convergenceTol - Convergence tolerance. Try 1e-3
      weights - Used to compute the weight each pixel contributes to the mean. Try a uniform distribution.
  • Method Details

    • setImage

      public void setImage(T image)
      Specifies the input image
      image - input image
    • setRadius

      public void setRadius(int radius)
    • search

      public void search(float cx, float cy)
      Performs a mean-shift search center at the specified coordinates
    • searchPositive

      public void searchPositive(float cx, float cy)
      Performs a mean-shift search center at the specified coordinates but with negative weights ignored