Class Binary

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

    public class Binary
    extends AbstractBoofCVTransformer
    Creates a binary image.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -threshold-type <MANUAL|MEAN|ADAPTIVE_GAUSSIAN|ADAPTIVE_SQUARE|OTSU> (property: thresholdType)
        The type of threshold to apply.
        default: MANUAL
     
    -threshold <float> (property: threshold)
        The manual threshold to use.
        default: 0.0
     
    -gaussian-radius <int> (property: gaussianRadius)
        The Gaussian radius to use.
        default: 1
        minimum: 1
     
    -square-radius <int> (property: squareRadius)
        The radius of the square region to use.
        default: 1
        minimum: 1
     
    -bias <float> (property: bias)
        The bias to use (for adaptive methods).
        default: 0.0
     
    -threshold-down <boolean> (property: thresholdDown)
        Whether to threshold down or up.
        default: false
     
    -remove-small-blobs <boolean> (property: removeSmallBlobs)
        If enabled, small blobs are removed using erode8/dilate8.
        default: false
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Threshold

        protected float m_Threshold
        the manual threshold to use.
      • m_GaussianRadius

        protected int m_GaussianRadius
        the gaussian radius.
      • m_SquareRadius

        protected int m_SquareRadius
        the square radius.
      • m_Bias

        protected float m_Bias
        the bias (for adaptive methods).
      • m_ThresholdDown

        protected boolean m_ThresholdDown
        the down (for adaptive methods).
      • m_RemoveSmallBlobs

        protected boolean m_RemoveSmallBlobs
        whether to remove small blobs.
    • Constructor Detail

      • Binary

        public Binary()
    • Method Detail

      • setThresholdType

        public void setThresholdType​(Binary.ThresholdType value)
        Sets the type of threshold to apply.
        Parameters:
        value - the type
      • getThresholdType

        public Binary.ThresholdType getThresholdType()
        Returns the type of threshold to apply.
        Returns:
        the type
      • thresholdTypeTipText

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

        public void setThreshold​(float value)
        Sets the manual threshold to use.
        Parameters:
        value - the threshold to use
      • getThreshold

        public float getThreshold()
        Returns the manual threshold to use.
        Returns:
        the threshold in use
      • thresholdTipText

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

        public void setGaussianRadius​(int value)
        Sets the Gaussian radius to use.
        Parameters:
        value - the radius
      • getGaussianRadius

        public int getGaussianRadius()
        Returns the Gaussian radius to use.
        Returns:
        the radius
      • gaussianRadiusTipText

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

        public void setSquareRadius​(int value)
        Sets the radius of the square region to use.
        Parameters:
        value - the radius
      • getSquareRadius

        public int getSquareRadius()
        Returns the radius of the square region to use.
        Returns:
        the radius
      • squareRadiusTipText

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

        public void setBias​(float value)
        Sets the bias to use.
        Parameters:
        value - the bias to use
      • getBias

        public float getBias()
        Returns the bias to use (for adaptive methods).
        Returns:
        the bias in use
      • biasTipText

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

        public void setThresholdDown​(boolean value)
        Sets whether to threshold down or up (adaptive methods).
        Parameters:
        value - true if to threshold down
      • getThresholdDown

        public boolean getThresholdDown()
        Returns whether to threshold down or up (adaptive methods).
        Returns:
        true if to threshold down
      • thresholdDownTipText

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

        public void setRemoveSmallBlobs​(boolean value)
        Sets whether to remove small blobs using erode8/dilate8.
        Parameters:
        value - true if to remove blobs
      • getRemoveSmallBlobs

        public boolean getRemoveSmallBlobs()
        Returns whether to remove small blobs using erode8/dilate8.
        Returns:
        true if blobs removed
      • removeSmallBlobsTipText

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