Class ThresholdReplacement

  • All Implemented Interfaces:
    CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, SizeOfHandler, ImageTransformer<BufferedImageContainer>, FlowContextHandler, Serializable, Comparable

    public class ThresholdReplacement
    extends AbstractBufferedImageTransformer
    Replaces pixels of the image that fall below or above (depending on configuration) a user defined threshold in the grayscale space with the supplied replacement color.
    Can be replaced to remove dark or light splotches.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -threshold <int> (property: threshold)
        The threshold (in grayscale space) that determines whether pixel gets replaced.
        default: 128
        minimum: 0
        maximum: 255
     
    -type <REMOVE_BELOW|REMOVE_ABOVE> (property: type)
        Defines how the threshold is interpreted.
        default: REMOVE_BELOW
     
    -replacement-color <java.awt.Color> (property: replacementColor)
        The color to use as replacement.
        default: #ffffff
     
    Version:
    $Revision: 7706 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Threshold

        protected int m_Threshold
        the (grayscale) threshold to use.
      • m_ReplacementColor

        protected Color m_ReplacementColor
        the replacement color.
    • Constructor Detail

      • ThresholdReplacement

        public ThresholdReplacement()
    • Method Detail

      • setThreshold

        public void setThreshold​(int value)
        Sets the threshold.
        Parameters:
        value - the threshold
      • getThreshold

        public int getThreshold()
        Returns the threshold.
        Returns:
        the threshold
      • thresholdTipText

        public String thresholdTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • typeTipText

        public String typeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • setReplacementColor

        public void setReplacementColor​(Color value)
        Sets the replacement color.
        Parameters:
        value - the color
      • getReplacementColor

        public Color getReplacementColor()
        Returns the replacement color.
        Returns:
        the color
      • replacementColorTipText

        public String replacementColorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui