Aspose.OCR for Python via Java API docs
Loading...
Searching...
No Matches

Base class for image processing commands. More...

Inherits BaseJavaClass.

Public Member Functions

 __init__ (self)
 
 add (self, filter)
 Add filter to collection for further preprocessing.
 
 getJavaClass (self)
 

Static Public Member Functions

 auto_denoising ()
 Enables the use of an additional neural network to improve the image - reduce noise.
 
 auto_dewarping ()
 Automatically corrects geometric distortions in the image.
 
 auto_skew ()
 Enables the automatic image skew correction.
 
 binarize ()
 Converts an image to black-and-white image.
 
 binarize_and_dilate ()
 Dilation adds pixels to the boundaries of objects in an image.
 
 contrast_correction ()
 Contrast correction filter.
 
 invert ()
 Automatically inverts colors in a document image.
 
 median ()
 The median filter run through each element of the image and replace each pixel with the median of its neighboring pixels.
 
 resize (int width, int height)
 Rescale image - upscale or downscale image resolution.
 
 rotate (float angle)
 Rotate original image.
 
 scale (float ratio)
 Rescale image - Upscale or downscale image resolution.
 
 threshold (int value)
 Create a binary image based on setting a threshold value on the pixel intensity of the original image.
 
 to_grayscale ()
 Converts an image to grayscale image.
 

Static Public Attributes

str JAVA_CLASS_NAME = "com.aspose.ocr.PreprocessingFilter"
 

Detailed Description

Base class for image processing commands.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self)

Member Function Documentation

◆ add()

add (   self,
  filter 
)

Add filter to collection for further preprocessing.

Parameters
filterPreprocessingFilter object.

◆ auto_denoising()

auto_denoising ( )
static

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.

Returns
: AutoDenoisingFilter object.

◆ auto_dewarping()

auto_dewarping ( )
static

Automatically corrects geometric distortions in the image.

Extremely resource intensive!

Returns
: AutoDewarpingFilter object.

◆ auto_skew()

auto_skew ( )
static

Enables the automatic image skew correction.

Returns
: AutoSkewFilter object.

◆ binarize()

binarize ( )
static

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.

Returns
: BinarizeFilter object.

◆ binarize_and_dilate()

binarize_and_dilate ( )
static

Dilation adds pixels to the boundaries of objects in an image.

Returns
: DilateFilter object.

◆ contrast_correction()

contrast_correction ( )
static

Contrast correction filter.

Returns
: ContrastCorrectionFilter object.

◆ getJavaClass()

getJavaClass (   self)

◆ invert()

invert ( )
static

Automatically inverts colors in a document image.

Returns
: InvertFilter object.

◆ median()

median ( )
static

The median filter run through each element of the image and replace each pixel with the median of its neighboring pixels.

Returns
: MedianFilter object.

◆ resize()

resize ( int  width,
int  height 
)
static

Rescale image - upscale or downscale image resolution.

Parameters
widthThe new width of the image.
heightThe new height of the image.
Returns
: ResizeFilter object.

◆ rotate()

rotate ( float  angle)
static

Rotate original image.

Parameters
angleAngle of rotation. Value from -360 to 360.
Returns
: RotateFilter object.

◆ scale()

scale ( float  ratio)
static

Rescale image - Upscale or downscale image resolution.

InterpolationFilterType bilinear or nearest neighbor.

Parameters
ratioThe scaling factor. Recommended value from 0.1 to 1 to shrink. From 1 to 10 to enlarge.
Returns
: ScaleFilter object.

◆ threshold()

threshold ( int  value)
static

Create a binary image based on setting a threshold value on the pixel intensity of the original image.

Parameters
valueThe max value.
Returns
: BinarizeFilter object.

◆ to_grayscale()

to_grayscale ( )
static

Converts an image to grayscale image.

Grayscale image have 256 level of light in image (0 to 255).

Returns
: GrayscaleFilter object.

Member Data Documentation

◆ JAVA_CLASS_NAME

str JAVA_CLASS_NAME = "com.aspose.ocr.PreprocessingFilter"
static