CustomBinarizationFilter

data class CustomBinarizationFilter(var outputMode: OutputMode = OutputMode.BINARY, var denoise: Double = 0.5, var radius: Int = 32, var preset: BinarizationFilterPreset = BinarizationFilterPreset.PRESET_4) : ParametricFilter, Parcelable

Automatic binarization filter. This filter is a good starting point for most use cases.

Constructors

Link copied to clipboard
constructor(source: Map<String, Any?>)
constructor(json: JSONObject)
constructor(outputMode: OutputMode = OutputMode.BINARY, denoise: Double = 0.5, radius: Int = 32, preset: BinarizationFilterPreset = BinarizationFilterPreset.PRESET_4)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val _type: String
Link copied to clipboard

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.

Link copied to clipboard

Output mode of the filter. BINARY will return a black and white image, GRAYSCALE will return an antialiased grayscale image.

Link copied to clipboard

Preset of binarization filter parameters that are found to perform well on different types of documents.

Link copied to clipboard
var radius: Int

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.

Functions

Link copied to clipboard
open override fun clone(): CustomBinarizationFilter
Link copied to clipboard
open override fun toJson(config: ToJsonConfiguration): JSONObject