Class FactoryThresholdBinary


  • public class FactoryThresholdBinary
    extends java.lang.Object
    Factory for creating various filters which convert an input image into a binary one
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      blockMean​(boofcv.struct.ConfigLength regionWidth, double scale, boolean down, boolean thresholdFromLocalBlocks, java.lang.Class<T> inputType)
      Applies a non-overlapping block mean threshold
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      blockMinMax​(boofcv.struct.ConfigLength regionWidth, double scale, boolean down, boolean thresholdFromLocalBlocks, double minimumSpread, java.lang.Class<T> inputType)
      Applies a very fast non-overlapping block thresholding algorithm which uses min/max statistics.
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      blockOtsu​(boofcv.struct.ConfigLength regionWidth, double scale, boolean down, boolean thresholdFromLocalBlocks, boolean otsu2, double tuning, java.lang.Class<T> inputType)
      Applies a non-overlapping block Otsu threshold
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      globalEntropy​(int minValue, int maxValue, double scale, boolean down, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      globalFixed​(double threshold, boolean down, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      globalHuang​(double minValue, double maxValue, double scale, boolean down, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      globalLi​(double minValue, double maxValue, double scale, boolean down, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      globalOtsu​(double minValue, double maxValue, double scale, boolean down, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      localGaussian​(boofcv.struct.ConfigLength regionWidth, double scale, boolean down, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      localMean​(boofcv.struct.ConfigLength width, double scale, boolean down, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      localNick​(boofcv.struct.ConfigLength width, boolean down, float k, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      localOtsu​(boofcv.struct.ConfigLength regionWidth, double scale, boolean down, boolean otsu2, double tuning, java.lang.Class<T> inputType)
      Applies a local Otsu threshold
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      localSauvola​(boofcv.struct.ConfigLength width, boolean down, float k, java.lang.Class<T> inputType)  
      static <T extends boofcv.struct.image.ImageGray<T>>
      InputToBinary<T>
      threshold​(ConfigThreshold config, java.lang.Class<T> inputType)
      Creates threshold using a config class
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FactoryThresholdBinary

        public FactoryThresholdBinary()
    • Method Detail

      • localGaussian

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> localGaussian​(boofcv.struct.ConfigLength regionWidth,
                                                                                                  double scale,
                                                                                                  boolean down,
                                                                                                  java.lang.Class<T> inputType)
        Parameters:
        regionWidth - Width of square region.
        scale - Threshold scale adjustment
        down - Should it threshold up or down.
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        LocalGaussianBinaryFilter
      • localSauvola

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> localSauvola​(boofcv.struct.ConfigLength width,
                                                                                                 boolean down,
                                                                                                 float k,
                                                                                                 java.lang.Class<T> inputType)
        Parameters:
        width - Width of square region.
        down - Should it threshold up or down.
        k - User specified threshold adjustment factor. Must be positive. Try 0.3
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        ThresholdSauvola
      • localNick

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> localNick​(boofcv.struct.ConfigLength width,
                                                                                              boolean down,
                                                                                              float k,
                                                                                              java.lang.Class<T> inputType)
        Parameters:
        width - size of local region. Try 31
        down - Should it threshold up or down.
        k - The Niblack factor. Recommend -0.1 to -0.2
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        ThresholdNick
      • localOtsu

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> localOtsu​(boofcv.struct.ConfigLength regionWidth,
                                                                                              double scale,
                                                                                              boolean down,
                                                                                              boolean otsu2,
                                                                                              double tuning,
                                                                                              java.lang.Class<T> inputType)
        Applies a local Otsu threshold
        Parameters:
        regionWidth - About how wide and tall you wish a block to be in pixels.
        scale - Scale factor adjust for threshold. 1.0 means no change.
        down - Should it threshold up or down.
        tuning - Tuning parameter. 0 = standard Otsu. Greater than 0 will penalize zero texture.
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        ThresholdLocalOtsu
      • blockMinMax

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> blockMinMax​(boofcv.struct.ConfigLength regionWidth,
                                                                                                double scale,
                                                                                                boolean down,
                                                                                                boolean thresholdFromLocalBlocks,
                                                                                                double minimumSpread,
                                                                                                java.lang.Class<T> inputType)
        Applies a very fast non-overlapping block thresholding algorithm which uses min/max statistics.
        Parameters:
        regionWidth - Approximate size of block region
        scale - Scale factor adjust for threshold. 1.0 means no change.
        down - Should it threshold up or down.
        minimumSpread - If the difference between min max is less than or equal to this value then it is considered textureless. Set to ≤ -1 to disable.
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        ThresholdBlockMinMax
      • blockMean

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> blockMean​(boofcv.struct.ConfigLength regionWidth,
                                                                                              double scale,
                                                                                              boolean down,
                                                                                              boolean thresholdFromLocalBlocks,
                                                                                              java.lang.Class<T> inputType)
        Applies a non-overlapping block mean threshold
        Parameters:
        scale - Scale factor adjust for threshold. 1.0 means no change.
        down - Should it threshold up or down.
        regionWidth - Approximate size of block region
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        ThresholdBlockMean
      • blockOtsu

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> blockOtsu​(boofcv.struct.ConfigLength regionWidth,
                                                                                              double scale,
                                                                                              boolean down,
                                                                                              boolean thresholdFromLocalBlocks,
                                                                                              boolean otsu2,
                                                                                              double tuning,
                                                                                              java.lang.Class<T> inputType)
        Applies a non-overlapping block Otsu threshold
        Parameters:
        regionWidth - Approximate size of block region
        scale - Scale factor adjust for threshold. 1.0 means no change.
        down - Should it threshold up or down.
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        ThresholdBlockOtsu
      • globalEntropy

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> globalEntropy​(int minValue,
                                                                                                  int maxValue,
                                                                                                  double scale,
                                                                                                  boolean down,
                                                                                                  java.lang.Class<T> inputType)
        Parameters:
        minValue - The minimum value of a pixel in the image. (inclusive)
        maxValue - The maximum value of a pixel in the image. (inclusive)
        down - Should it threshold up or down.
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        GThresholdImageOps.computeEntropy(boofcv.struct.image.ImageGray, double, double)
      • globalOtsu

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> globalOtsu​(double minValue,
                                                                                               double maxValue,
                                                                                               double scale,
                                                                                               boolean down,
                                                                                               java.lang.Class<T> inputType)
        Parameters:
        minValue - The minimum value of a pixel in the image. (inclusive)
        maxValue - The maximum value of a pixel in the image. (inclusive)
        down - Should it threshold up or down.
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        GThresholdImageOps.computeOtsu(boofcv.struct.image.ImageGray, double, double)
      • globalLi

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> globalLi​(double minValue,
                                                                                             double maxValue,
                                                                                             double scale,
                                                                                             boolean down,
                                                                                             java.lang.Class<T> inputType)
        Parameters:
        minValue - The minimum value of a pixel in the image. (inclusive)
        maxValue - The maximum value of a pixel in the image. (inclusive)
        down - Should it threshold up or down.
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        GThresholdImageOps.computeLi(int[], int)
      • globalHuang

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> globalHuang​(double minValue,
                                                                                                double maxValue,
                                                                                                double scale,
                                                                                                boolean down,
                                                                                                java.lang.Class<T> inputType)
        Parameters:
        minValue - The minimum value of a pixel in the image. (inclusive)
        maxValue - The maximum value of a pixel in the image. (inclusive)
        down - Should it threshold up or down.
        inputType - Type of input image
        Returns:
        Filter to binary
        See Also:
        GThresholdImageOps.computeHuang(int[], int)
      • threshold

        public static <T extends boofcv.struct.image.ImageGray<T>> InputToBinary<T> threshold​(ConfigThreshold config,
                                                                                              java.lang.Class<T> inputType)
        Creates threshold using a config class
        Parameters:
        config - Configuration
        inputType - Type of input image
        Returns:
        The thresholder