ImageProcessingTools Object (IImageProcessingTools Interface)

This object allows you to preprocess images before recognition.

The standard procedure, which uses this object, is as follows:

  1. Open an image file using either the OpenImageFile or OpenImageFileFromStream method. These methods return an opened file as the ImageFile object.
  2. Open a page of the image file using the OpenImagePage of the ImageFile object. This method provides access to an image page as the Image object.
  3. Preprocess the image page using one of the available methods or implement your own preprocessing algorithm. With the available methods you can do the following operations:
    • remove noise from color photos (RemoveNoise, CreateDenoiseFilterParamsByImage methods)
    • remove motion blur from photos, equalize their brightness (RemoveMotionBlur, EqualizeBrightness methods)
    • remove geometrical distortions from an image or stretch it (CorrectImageGeometry, StretchTrapezoidToRectangle, StretchImage methods)
    • suppress color objects in official documents (SuppressColorObjects method)
    • remove garbage (excess dots that are smaller than a certain size) from an image (RemoveGarbage method)
    • smooth image (SmoothImageBySquareAverage, SmoothImageByGaussianKernel methods)
    • smooth texture (SmoothTexture method)
    • detect orientation of the text on an image and rotate an image either by a predefined angle, or by any custom angle (DetectOrientationByText, RotateImageByRotationType, RotateImage methods)
    • mirror or invert an image (MirrorImage, InvertRegion methods)
    • crop an image (CropImage method)
    • fill with color a region on an image (FillRegionWithColor method)
    • convert image to gray or black and white (ConvertToGray, Binarize methods)
    • convert an internal image plane to a bitmap and vice versa (ImageToBitmap and BitmapToImage methods)

Methods

Name Description
Binarize Converts an image to black and white.
BitmapToImage Converts the specified bitmap to the Image object.
CalcSuitableForOcr Shows how suitable is an image for OCR. Possible values are from 0.0 to 1.0.
ConvertToGray Converts an image to gray.
CorrectImageGeometry Corrects image geometry: perspective distortions, curved text lines.
CreateDenoiseFilterParamsByImage Measures ISO noise on the image and creates the DenoiseFilterParams object based on the measurement.
CropImage Crops an image.
DetectEmpty Detects if the image is empty.
DetectOrientationByText Detects orientation of an image by text lines.
DetectRequiredRotation Detects the rotation that should be applied to the image to return it to the normal (upright) orientation.
EqualizeBrightness Equalizes brightness of an image.
FillRegionWithColor Fills the specified region with color.
FilterColor Removes specified color objects from the entire image or its parts.
ImageToBitmap Converts the Image object to a bitmap.
InvertRegion Inverts either the specified region on an image or the entire image.
IsSuitableForOcr Checks if an image is suitable for OCR.
MirrorImage Mirrors an image either vertically or horizontally.
OpenImageFile Opens an image file.
OpenImageFileFromStream Reads an image file from the specified stream.
PreprocessCameraImage Preprocesses a photo using predefined settings specially designed for different types of photos.
RemoveGarbage Removes isolated clusters of pixels of the specified size which are considered garbage.
RemoveMotionBlur Removes motion blur from an image.
RemoveNoise Removes ISO noise from color photos.
RotateImage Rotates an image by the specified angle.
RotateImageByRotationType Rotates an image by a predefined angle (90 degrees clockwise, 90 degrees counterclockwise, upside down).
SmoothImageByGaussianKernel Smoothes an image by Gaussian kernel.
SmoothImageBySquareAverage Smoothes the image by averaging over the square neighborhood.
SmoothTexture Smoothes texture of an image by a nonlinear filter, preserving sharp edges.
StretchImage Stretches or shrinks the image to the specified size.
StretchTrapezoidToRectangle Transforms an image so that the specified trapezoid becomes a rectangle. Can be used to manually correct slight perspective distortion.
SuppressColorObjects Suppresses objects with the specified color in official documents.

Output parameter

This object is the output parameter of the CreateImageProcessingTools method of the Engine object.

Samples

C# code

15.08.2023 13:19:30

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.