Class PreprocessingFilter

Class PreprocessingFilter

Namespace: Aspose.OCR.Models.PreprocessingFilters
Assembly: Aspose.OCR.dll (25.2.0)

Base class for image processing commands.

public class PreprocessingFilter : IEnumerable

Inheritance

objectPreprocessingFilter

Implements

IEnumerable

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

PreprocessingFilter()

public PreprocessingFilter()

Properties

Default

Default filters collection contain AutoSkew filter

public static PreprocessingFilter Default { get; }

Property Value

PreprocessingFilter

Empty

Empty filters collection

public static PreprocessingFilter Empty { get; }

Property Value

PreprocessingFilter

Methods

Add(PreprocessingFilter)

Add the new filter to the collection to further run all operations. Consistency in the collection matters.

public void Add(PreprocessingFilter filter)

Parameters

filter PreprocessingFilter

New operation to add to filter list.

AutoDenoising()

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.

public static PreprocessingFilter AutoDenoising()

Returns

PreprocessingFilter

AutoDenoisingFilter object.

AutoDenoising(Rectangle)

Enables the use of an additional neural network to improve the image part - reduce noise. Useful for images with scan artifacts, distortion, spots, flares, gradients, foreign elements.

public static PreprocessingFilter AutoDenoising(Rectangle area)

Parameters

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

AutoDenoisingFilter object.

AutoDewarping()

Automatically corrects geometric distortions in the image. Extremely resource intensive!

public static PreprocessingFilter AutoDewarping()

Returns

PreprocessingFilter

AutoDewarpingFilter object.

AutoSkew()

Enables the automatic image skew correction.

public static PreprocessingFilter AutoSkew()

Returns

PreprocessingFilter

AutoSkewFilter object.

AutoSkew(Rectangle)

Enables the automatic image part skew correction.

public static PreprocessingFilter AutoSkew(Rectangle area)

Parameters

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

AutoSkewFilter object.

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.

public static PreprocessingFilter Binarize()

Returns

PreprocessingFilter

BinarizeFilter object.

Binarize(Rectangle)

Converts a part of the 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.

public static PreprocessingFilter Binarize(Rectangle area)

Parameters

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

BinarizeFilter object.

ContrastCorrectionFilter()

Contrast correction filter.

public static PreprocessingFilter ContrastCorrectionFilter()

Returns

PreprocessingFilter

ContrastCorrectionFilter object.

ContrastCorrectionFilter(Rectangle)

Contrast correction filter for the part of the image.

public static PreprocessingFilter ContrastCorrectionFilter(Rectangle area)

Parameters

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

ContrastCorrectionFilter object.

Dilate()

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

public static PreprocessingFilter Dilate()

Returns

PreprocessingFilter

DilateFilter object.

Dilate(Rectangle)

Dilation adds pixels to the boundaries of objects in a part of the image.

public static PreprocessingFilter Dilate(Rectangle area)

Parameters

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

DilateFilter object.

GetEnumerator()

For IEnumarable interface realization.

public IEnumerator GetEnumerator()

Returns

IEnumerator

IEnumerator

Invert()

Automatically inverts colors in a document image.

public static PreprocessingFilter Invert()

Returns

PreprocessingFilter

InvertFilter object.

Invert(Rectangle)

Automatically inverts colors in a part of the image.

public static PreprocessingFilter Invert(Rectangle area)

Parameters

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

InvertFilter object.

Median()

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

public static PreprocessingFilter Median()

Returns

PreprocessingFilter

MedianFilter object.

Median(Rectangle)

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

public static PreprocessingFilter Median(Rectangle area)

Parameters

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

MedianFilter object.

Resize(int, int, InterpolationFilterType)

Rescale image - Upscale or downscale image resolution.

public static PreprocessingFilter Resize(int width, int height, InterpolationFilterType type)

Parameters

width int

The new width of the image.

height int

The new height of the image.

type InterpolationFilterType

Aspose.OCR.Filters.InterpolationFilterType

Returns

PreprocessingFilter

ResizeFilter object.

Resize(int, int)

Rescale image - Upscale or downscale image resolution. InterpolationFilterType = Lanczos8

public static PreprocessingFilter Resize(int width, int height)

Parameters

width int

The new width of the image.

height int

The new height of the image.

Returns

PreprocessingFilter

ResizeFilter object.

Rotate(float)

Rotate original image.

public static PreprocessingFilter Rotate(float angle)

Parameters

angle float

Angle of rotation.From -360 to 360

Returns

PreprocessingFilter

RotateFilter object.

Rotate(float, Rectangle)

Rotate a part of the image.

public static PreprocessingFilter Rotate(float angle, Rectangle area)

Parameters

angle float

Angle of rotation.From -360 to 360

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

RotateFilter object.

Scale(float)

Rescale image - Upscale or downscale image resolution. InterpolationFilterType = Lanczos8

public static PreprocessingFilter Scale(float ratio)

Parameters

ratio float

The scaling factor. Recommended from 0.1 to 1 to shrink. From 1 to 10 to enlarge.

Returns

PreprocessingFilter

ScaleFilter object.

Scale(float, InterpolationFilterType)

Rescale image - Upscale or downscale image resolution.

public static PreprocessingFilter Scale(float ratio, InterpolationFilterType type)

Parameters

ratio float

The scaling factor. Recommended from 0.1 to 1 to shrink. From 1 to 10 to enlarge.

type InterpolationFilterType

Aspose.OCR.Filters.InterpolationFilterType

Returns

PreprocessingFilter

ScaleFilter object.

Threshold(int)

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

public static PreprocessingFilter Threshold(int value)

Parameters

value int

The max value.

Returns

PreprocessingFilter

BinarizeFilter object.

Threshold(int, Rectangle)

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

public static PreprocessingFilter Threshold(int value, Rectangle area)

Parameters

value int

The max value.

area Rectangle

Coordinates of the part of the image to be corrected.

Returns

PreprocessingFilter

BinarizeFilter object.

ToGrayscale()

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

public static PreprocessingFilter ToGrayscale()

Returns

PreprocessingFilter

GrayscaleFilter object.

 English