PreprocessingFilter
PreprocessingFilter class
Module: models
Inherits: BaseJavaClass
Base class for image processing commands.
Constructors
| Name | Description |
|---|---|
| init |
Methods
| Name | Return Type | Static | Description |
|---|---|---|---|
| add | No | Add filter to collection for further preprocessing. | |
| auto_denoising | Yes | Enables the use of an additional neural network to improve the image - reduce noise. Useful for images with scan artifacts, distortion, spots, flares, gradients, foreign elements. | |
| auto_dewarping | Yes | Automatically corrects geometric distortions in the image. Extremely resource intensive! | |
| auto_skew | Yes | Enables the automatic image skew correction. | |
| binarize | Yes | Converts an image to black-and-white image. Binary images are images whose pixels have only two possible intensity values. They are normally displayed as black and white. Numerically, the two values are often 0 for black, and 255 for white. Binary images are produced by auto thresholding an image. | |
| binarize_and_dilate | Yes | Dilation adds pixels to the boundaries of objects in an image. | |
| contrast_correction | Yes | Contrast correction filter. | |
| getJavaClass | No | ||
| invert | Yes | Automatically inverts colors in a document image. | |
| median | Yes | The median filter run through each element of the image and replace each pixel with the median of its neighboring pixels. | |
| resize | Yes | Rescale image - upscale or downscale image resolution. | |
| rotate | Yes | Rotate original image. | |
| scale | Yes | Rescale image - Upscale or downscale image resolution. InterpolationFilterType bilinear or nearest neighbor. | |
| threshold | Yes | Create a binary image based on setting a threshold value on the pixel intensity of the original image. | |
| to_grayscale | Yes | Converts an image to grayscale image. Grayscale image have 256 level of light in image (0 to 255). |
Fields
| Name | Value | Description |
|---|---|---|
| JAVA_CLASS_NAME | "com.aspose.ocr.PreprocessingFilter" |
PreprocessingFilter Constructor
__init__(self)
PreprocessingFilter.add
add(self, filter)
Add filter to collection for further preprocessing.
| Parameter | Type | Description |
|---|---|---|
filter | `` | PreprocessingFilter object. |
PreprocessingFilter.auto_denoising (static)
auto_denoising()
Enables the use of an additional neural network to improve the image - reduce noise. Useful for images with scan artifacts, distortion, spots, flares, gradients, foreign elements.
PreprocessingFilter.auto_dewarping (static)
auto_dewarping()
Automatically corrects geometric distortions in the image. Extremely resource intensive!
PreprocessingFilter.auto_skew (static)
auto_skew()
Enables the automatic image skew correction.
PreprocessingFilter.binarize (static)
binarize()
Converts an image to black-and-white image. Binary images are images whose pixels have only two possible intensity values. They are normally displayed as black and white. Numerically, the two values are often 0 for black, and 255 for white. Binary images are produced by auto thresholding an image.
PreprocessingFilter.binarize_and_dilate (static)
binarize_and_dilate()
Dilation adds pixels to the boundaries of objects in an image.
PreprocessingFilter.contrast_correction (static)
contrast_correction()
Contrast correction filter.
PreprocessingFilter.getJavaClass
getJavaClass(self)
PreprocessingFilter.invert (static)
invert()
Automatically inverts colors in a document image.
PreprocessingFilter.median (static)
median()
The median filter run through each element of the image and replace each pixel with the median of its neighboring pixels.
PreprocessingFilter.resize (static)
resize(int width, int height)
Rescale image - upscale or downscale image resolution.
| Parameter | Type | Description |
|---|---|---|
width | int | The new width of the image. |
height | int | The new height of the image. |
PreprocessingFilter.rotate (static)
rotate(float angle)
Rotate original image.
| Parameter | Type | Description |
|---|---|---|
angle | float | Angle of rotation. Value from -360 to 360. |
PreprocessingFilter.scale (static)
scale(float ratio)
Rescale image - Upscale or downscale image resolution. InterpolationFilterType bilinear or nearest neighbor.
| Parameter | Type | Description |
|---|---|---|
ratio | float | The scaling factor. Recommended value from 0.1 to 1 to shrink. From 1 to 10 to enlarge. |
PreprocessingFilter.threshold (static)
threshold(int value)
Create a binary image based on setting a threshold value on the pixel intensity of the original image.
| Parameter | Type | Description |
|---|---|---|
value | int | The max value. |
PreprocessingFilter.to_grayscale (static)
to_grayscale()
Converts an image to grayscale image. Grayscale image have 256 level of light in image (0 to 255).
PreprocessingFilter.JAVA_CLASS_NAME
Type: str
Value: "com.aspose.ocr.PreprocessingFilter"