Class CustomBinarizationFilter
-
- All Implemented Interfaces:
-
android.os.Parcelable
public final class CustomBinarizationFilter extends ParametricFilter implements Parcelable
Automatic binarization filter. This filter is a good starting point for most use cases.
-
-
Field Summary
Fields Modifier and Type Field Description private final String_typeprivate OutputModeoutputModeprivate Doubledenoiseprivate Integerradiusprivate BinarizationFilterPresetpreset
-
Constructor Summary
Constructors Constructor Description CustomBinarizationFilter(Map<String, Object> source)CustomBinarizationFilter(JSONObject json)CustomBinarizationFilter(OutputMode outputMode, Double denoise, Integer radius, BinarizationFilterPreset preset)
-
Method Summary
Modifier and Type Method Description Stringget_type()final OutputModegetOutputMode()Output mode of the filter. final UnitsetOutputMode(OutputMode outputMode)Output mode of the filter. final DoublegetDenoise()Value controlling the amount of noise removal. final UnitsetDenoise(Double denoise)Value controlling the amount of noise removal. final IntegergetRadius()Filter radius. final UnitsetRadius(Integer radius)Filter radius. final BinarizationFilterPresetgetPreset()Preset of binarization filter parameters that are found to perform well on different types of documents. final UnitsetPreset(BinarizationFilterPreset preset)Preset of binarization filter parameters that are found to perform well on different types of documents. JSONObjecttoJson(ToJsonConfiguration config)CustomBinarizationFilterclone()final static CustomBinarizationFilterdefault()-
-
Constructor Detail
-
CustomBinarizationFilter
CustomBinarizationFilter(JSONObject json)
-
CustomBinarizationFilter
CustomBinarizationFilter(OutputMode outputMode, Double denoise, Integer radius, BinarizationFilterPreset preset)
-
-
Method Detail
-
getOutputMode
final OutputMode getOutputMode()
Output mode of the filter. BINARY will return a black and white image, GRAYSCALE will return an antialiased grayscale image.
Default is BINARY
-
setOutputMode
final Unit setOutputMode(OutputMode outputMode)
Output mode of the filter. BINARY will return a black and white image, GRAYSCALE will return an antialiased grayscale image.
Default is BINARY
-
getDenoise
final Double getDenoise()
Value controlling the amount of noise removal. Value between 0 and 1. Too little noise removal may result in a very noisy image, worsening readability. Too much noise removal may result in the degradation of text, again, worsening readability.
Default is 0.5
-
setDenoise
final Unit setDenoise(Double denoise)
Value controlling the amount of noise removal. Value between 0 and 1. Too little noise removal may result in a very noisy image, worsening readability. Too much noise removal may result in the degradation of text, again, worsening readability.
Default is 0.5
-
getRadius
final Integer getRadius()
Filter radius. The bigger the radius, the slower the filter and generally the less noise in the result. The radius is used for both shadows removal and the calculation of local statistics in the main body of the filter. Higher radius usually allows to cope better with regions of light text on dark background. All the values larger than 127 are clamped to 127.
Default is 32
-
setRadius
final Unit setRadius(Integer radius)
Filter radius. The bigger the radius, the slower the filter and generally the less noise in the result. The radius is used for both shadows removal and the calculation of local statistics in the main body of the filter. Higher radius usually allows to cope better with regions of light text on dark background. All the values larger than 127 are clamped to 127.
Default is 32
-
getPreset
final BinarizationFilterPreset getPreset()
Preset of binarization filter parameters that are found to perform well on different types of documents.
Default is PRESET_4
-
setPreset
final Unit setPreset(BinarizationFilterPreset preset)
Preset of binarization filter parameters that are found to perform well on different types of documents.
Default is PRESET_4
-
toJson
JSONObject toJson(ToJsonConfiguration config)
-
clone
CustomBinarizationFilter clone()
-
default
final static CustomBinarizationFilter default()
-
-
-
-