Class GrayscaleFilter
-
- All Implemented Interfaces:
-
android.os.Parcelable
public final class GrayscaleFilter extends ParametricFilter implements Parcelable
Converts color images to grayscale and applies autocontrast.
-
-
Field Summary
Fields Modifier and Type Field Description private final String_typeprivate DoubleborderWidthFractionprivate DoubleblackOutliersFractionprivate DoublewhiteOutliersFraction
-
Constructor Summary
Constructors Constructor Description GrayscaleFilter(Map<String, Object> source)GrayscaleFilter(JSONObject json)GrayscaleFilter(Double borderWidthFraction, Double blackOutliersFraction, Double whiteOutliersFraction)
-
Method Summary
Modifier and Type Method Description Stringget_type()final DoublegetBorderWidthFraction()Ignore this fraction of pixels at the edge of the image when calculating statistics. final UnitsetBorderWidthFraction(Double borderWidthFraction)Ignore this fraction of pixels at the edge of the image when calculating statistics. final DoublegetBlackOutliersFraction()Clip this fraction of the darkest pixels in operations such as autocontrast. final UnitsetBlackOutliersFraction(Double blackOutliersFraction)Clip this fraction of the darkest pixels in operations such as autocontrast. final DoublegetWhiteOutliersFraction()Clip this fraction of the brightest pixels in operations such as autocontrast. final UnitsetWhiteOutliersFraction(Double whiteOutliersFraction)Clip this fraction of the brightest pixels in operations such as autocontrast. JSONObjecttoJson(ToJsonConfiguration config)GrayscaleFilterclone()final static GrayscaleFilterdefault()-
-
Method Detail
-
getBorderWidthFraction
final Double getBorderWidthFraction()
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
-
setBorderWidthFraction
final Unit setBorderWidthFraction(Double 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
-
getBlackOutliersFraction
final Double getBlackOutliersFraction()
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
-
setBlackOutliersFraction
final Unit setBlackOutliersFraction(Double 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
-
getWhiteOutliersFraction
final Double getWhiteOutliersFraction()
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
-
setWhiteOutliersFraction
final Unit setWhiteOutliersFraction(Double 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
-
toJson
JSONObject toJson(ToJsonConfiguration config)
-
clone
GrayscaleFilter clone()
-
default
final static GrayscaleFilter default()
-
-
-
-