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
Implements
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
Empty
Empty filters collection
public static PreprocessingFilter Empty { get; }
Property Value
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
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
AutoDenoisingFilter object.
AutoDewarping()
Automatically corrects geometric distortions in the image. Extremely resource intensive!
public static PreprocessingFilter AutoDewarping()
Returns
AutoDewarpingFilter object.
AutoSkew()
Enables the automatic image skew correction.
public static PreprocessingFilter AutoSkew()
Returns
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
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
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
BinarizeFilter object.
ContrastCorrectionFilter()
Contrast correction filter.
public static PreprocessingFilter ContrastCorrectionFilter()
Returns
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
ContrastCorrectionFilter object.
Dilate()
Dilation adds pixels to the boundaries of objects in an image.
public static PreprocessingFilter Dilate()
Returns
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
DilateFilter object.
GetEnumerator()
For IEnumarable interface realization.
public IEnumerator GetEnumerator()
Returns
IEnumerator
Invert()
Automatically inverts colors in a document image.
public static PreprocessingFilter Invert()
Returns
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
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
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
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.
Aspose.OCR.Filters.InterpolationFilterType
Returns
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
ResizeFilter object.
Rotate(float)
Rotate original image.
public static PreprocessingFilter Rotate(float angle)
Parameters
angle
float
Angle of rotation.
Returns
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.
area
Rectangle
Coordinates of the part of the image to be corrected.
Returns
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.
Returns
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.
Aspose.OCR.Filters.InterpolationFilterType
Returns
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
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
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
GrayscaleFilter object.