Interface GlobalThresholder

All Superinterfaces:
Thresholder
All Known Implementing Classes:
IsodataThresholder, IsodataThresholderSlow, MaxEntropyThresholder, MeanThresholder, MedianThresholder, MinErrorThresholder, MinMaxThresholder, OtsuThresholder, QuantileThresholder

public interface GlobalThresholder extends Thresholder

Common interface to be implemented by all global thresholders. See Sec. 9.1 of [1] for an overview.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/08/01
  • Nested Class Summary

    Nested classes/interfaces inherited from interface imagingbook.common.threshold.Thresholder

    Thresholder.BackgroundMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    getThreshold(int[] h)
    Returns a single (global) threshold value for the specified histogram.
    default float
    Returns a single (global) threshold value for the specified ByteProcessor (8-bit image).
    default boolean
    Thresholds the specified ByteProcessor (8-bit image), which is modified.
  • Field Details

  • Method Details

    • getThreshold

      float getThreshold(int[] h)
      Returns a single (global) threshold value for the specified histogram.
      Parameters:
      h - a histogram (array of frequencies)
      Returns:
      a single (global) threshold value
    • getThreshold

      default float getThreshold(ByteProcessor bp)
      Returns a single (global) threshold value for the specified ByteProcessor (8-bit image).
      Parameters:
      bp - a ByteProcessor (8-bit image)
      Returns:
      a single (global) threshold value
    • threshold

      default boolean threshold(ByteProcessor ip)
      Description copied from interface: Thresholder
      Thresholds the specified ByteProcessor (8-bit image), which is modified. Does nothing and returns true if no valid threshold could be found (e.g., if all image pixels have the same value).
      Specified by:
      threshold in interface Thresholder
      Parameters:
      ip - a ByteProcessor (8-bit image)
      Returns:
      true iff the operation was successful