Interface NonMaxSuppression

All Known Implementing Classes:
WrapperNonMaxCandidate, WrapperNonMaximumBlock, WrapperNonMaximumNaive

public interface NonMaxSuppression

Detects local minimums and/or maximums in an intensity image inside square regions. This is known as non-maximum suppression. The detector can be configured to ignore pixels along the image border by a user specified distance. Some implementations require candidate locations for the features. This allows for a sparse algorithm to be used, resulting in a significant speed boost. Pixel values with a value of -Float.MAX_VALUE or Float.MAX_VALUE will not be considered for local minimum/maximum, respectively. This is a good way to ignore previously detected features.

Not all implementations will search for both minimums or maximums. Be sure you are using the correct one. If you don't intend on detecting a minimum or maximum pass in null for the candidate list and the output found list.

An extractor which uses candidate features must always be provided them. However, an algorithm which does not use candidate features will simply ignore that input and operate as usual. Can check capabilities at runtime using the canDetectMinimums() and canDetectMaximums() functions.

A border can be specified around the outside of the image in which extremes can't be detected. However, a pixel outside this border can influence if a pixel is a maximum inside, if the local search radius extends that far. This is specified by the border parameter and the valid region is defined as follows:
border ≤ x < width-border AND border ≤ y < height-border

  • Method Details

    • process

      void process​(GrayF32 intensity, @Nullable @Nullable ListIntPoint2D candidateMin, @Nullable @Nullable ListIntPoint2D candidateMax, @Nullable @Nullable QueueCorner foundMin, @Nullable @Nullable QueueCorner foundMax)
      Process a feature intensity image to extract the point features. If a pixel has an intensity value == -Float.MAX_VALUE or Float.MAX_VALUE it will not be considered for a local min or max, respectively. If an algorithm only detect local minimums or maximums and null can be passed in for unused lists. This is the recommended procedure since it will force an exception to be thrown if a mistake was made.
      Parameters:
      intensity - (Input) Feature intensity image. Not modified.
      candidateMin - (Input) (Optional) List of candidate local minimum features. Can be null if not used.
      candidateMax - (Input) (Optional) List of candidate local maximum features Can be null if not used.
      foundMin - (Output) Storage for found minimums. Can be null if not used.
      foundMax - (Output) Storage for found maximums. Can be null if not used.
    • getUsesCandidates

      boolean getUsesCandidates()
      Returns true if the algorithm requires a candidate list of corners.
      Returns:
      true if candidates are required.
    • getThresholdMinimum

      float getThresholdMinimum()
      Maximum value for detected minimums
      Returns:
      threshold for feature selection
    • getThresholdMaximum

      float getThresholdMaximum()
      Minimum value for detected maximums
      Returns:
      threshold for feature selection
    • setThresholdMinimum

      void setThresholdMinimum​(float threshold)
      Change the feature selection threshold for finding local minimums.
      Parameters:
      threshold - The new selection threshold.
    • setThresholdMaximum

      void setThresholdMaximum​(float threshold)
      Change the feature selection threshold for finding local maximums.
      Parameters:
      threshold - The new selection threshold.
    • setIgnoreBorder

      void setIgnoreBorder​(int border)
      Defines the region inside the image in which a pixel can be an extreme. valid region is: border ≤ x < width-border AND border ≤ y < height-border
      Parameters:
      border - Border size in pixels.
    • getIgnoreBorder

      int getIgnoreBorder()
      Returns the size of the image border.
      Returns:
      border size
    • setSearchRadius

      void setSearchRadius​(int radius)
      Species the search radius for the feature
      Parameters:
      radius - Radius in pixels
    • getSearchRadius

      int getSearchRadius()
      Describes how large the region is that is being searched. The radius is the number of pixels away from the center.
      Returns:
      Search radius
    • canDetectMaximums

      boolean canDetectMaximums()
      True if it can detect local maximums.
    • canDetectMinimums

      boolean canDetectMinimums()
      True if it can detect local minimums.