Class GrayscaleFilter

java.lang.Object
io.scanbot.sdk.imageprocessing.ParametricFilter
io.scanbot.sdk.imageprocessing.GrayscaleFilter

public class GrayscaleFilter extends ParametricFilter
Converts color images to grayscale and applies autocontrast.
  • Constructor Details

    • GrayscaleFilter

      public GrayscaleFilter(double borderWidthFraction, double blackOutliersFraction, double whiteOutliersFraction)
      Constructs GrayscaleFilter with the given params.
      Parameters:
      borderWidthFraction - Ignore this fraction of pixels at the edge of the image when calculating statistics. Pixels at the edge of the image typically have poor statistics. Ignoring them and using only the inner pixels when calculating certain statistics can substantially improve the quality of the result. The value must be less than 0.5 but usually good values are between 0 and 0.15. Default is `0.06`.
      blackOutliersFraction - Clip this fraction of the darkest pixels in operations such as autocontrast. Increasing the range of middle gray levels at the expense of the brightest and darkest levels may improve the overall contrast and quality of the result. Sum of blackOutliersFraction and whiteOutliersFraction must be less than 1 but usually good values for the parameters do not exceed 0.05;. Default is `0.0`.
      whiteOutliersFraction - Clip this fraction of the brightest pixels in operations such as autocontrast. Increasing the range of middle gray levels at the expense of the brightest and darkest levels may improve the overall contrast and quality of the result. Sum of blackOutliersFraction and whiteOutliersFraction must be less than 1 but usually good values for the parameters do not exceed 0.05;. Default is `0.02`.
    • GrayscaleFilter

      public GrayscaleFilter()
      Constructs GrayscaleFilter with default parameters.
  • Method Details

    • getBorderWidthFraction

      public double getBorderWidthFraction()
      Getter for borderWidthFraction field. See constructor documentation for more information about the field.
      Returns:
      borderWidthFraction
    • setBorderWidthFraction

      public void setBorderWidthFraction(double borderWidthFraction)
      Setter for borderWidthFraction field. See constructor documentation for more information about the field.
      Parameters:
      borderWidthFraction - Value to set.
    • getBlackOutliersFraction

      public double getBlackOutliersFraction()
      Getter for blackOutliersFraction field. See constructor documentation for more information about the field.
      Returns:
      blackOutliersFraction
    • setBlackOutliersFraction

      public void setBlackOutliersFraction(double blackOutliersFraction)
      Setter for blackOutliersFraction field. See constructor documentation for more information about the field.
      Parameters:
      blackOutliersFraction - Value to set.
    • getWhiteOutliersFraction

      public double getWhiteOutliersFraction()
      Getter for whiteOutliersFraction field. See constructor documentation for more information about the field.
      Returns:
      whiteOutliersFraction
    • setWhiteOutliersFraction

      public void setWhiteOutliersFraction(double whiteOutliersFraction)
      Setter for whiteOutliersFraction field. See constructor documentation for more information about the field.
      Parameters:
      whiteOutliersFraction - Value to set.