Skip to main content
This object is used for tuning different parameters of page preprocessing. Page preprocessing is performed before page analysis. This stage includes correction of page orientation, image inversion, and removal of geometrical distortions. A pointer to this object is passed as a member of the PageProcessingParams object into processing methods. The PagePreprocessingParams object is a persistent object. This means that the object’s current state can be written to persistent storage. Later, the object can be re-created by reading the object’s state from the persistent storage. The following methods provide persistence of the object: Linux: SaveToFile, and LoadFromFile Windows SaveToFile, LoadFromFile, SaveToMemory, and LoadFromMemory.

Properties

Name

Type

Description

Application

Engine, read-only

Returns the Engine object.

BackgroundWhitening

ThreeStatePropertyValueEnum

Specifies if image background should be whitened.

This property is TSPV_Auto by default. In default mode, ABBYY FineReader Engine whitens the background.

CorrectGeometry

ThreeStatePropertyValueEnum

Specifies whether geometrical distortions (perspective on photos, curved lines from scanned books, etc.) should be removed during page preprocessing.

This property is TSPV_Auto by default. In default mode, ABBYY FineReader Engine corrects geometry for photographs.

CorrectInvertedImage

ThreeStatePropertyValueEnum

Specifies if inverted image should be corrected.

This property is TSPV_Auto by default. In default mode, ABBYY FineReader Engine corrects inverted images.

CorrectOrientationMode

CorrectOrientationModeEnum

Specifies how image orientation should be corrected during preprocessing.

The default value is COM_Auto, which means orientation will be determined and corrected automatically if needed.

CorrectSkewMode

CorrectSkewModeEnum

If this property is set to CSM_Auto or CSM_Fast, image skew will be corrected during page preprocessing.

Skew can be corrected only for angles not greater than 20 degrees.

By default, this property is set to CSM_Auto, which means precise skew correction.

CropImage

ThreeStatePropertyValueEnum

If this property is set to TSPV_Yes, during preprocessing ABBYY FineReader Engine will detect document edges on the image and crop the image accordingly.

This feature is not supported for black-and-white images.

The default value of this property is TSPV_Auto. In the default mode, ABBYY FineReader Engine crops the image or skips this step automatically, depending on the source of the processed image.

DetectImageType

ThreeStatePropertyValueEnum

Specifies how the image type is determined. Works in conjunction with ImageSourceType.

Default: TSPV_Auto (effective only when ImageSourceType = IST_Auto).

    • TSPV_Auto/TSPV_Yes — the Engine detects the image type automatically.
    • TSPV_No — the Engine does not detect; it reads the image type from the file’s properties/metadata (faster, but depends on correct metadata).
  • If ImageSourceType is explicitly set to IST_Photo, IST_Scan, IST_Screenshot, IST_SyntheticImage, or IST_SyntheticText, detection is not performed (treated as TSPV_No) and the Engine reads the image type from properties/metadata.

DiscardColorImage

VARIANT_BOOL

This property set to TRUE tells ABBYY FineReader Engine to leave only black-and-white plane in the prepared image. In this case, image binarization is performed during image preprocessing.

By default, this property is set to FALSE.

OverwriteResolutionMode

OverwriteResolutionEnum

If this property is set to ORM_Auto, ABBYY FineReader Engine will automatically detect and overwrite image resolution.

If it is set to ORM_Manual, use the ResolutionToOverwrite property to specify the new image resolution.

The new resolution will be applied before all other stages of image preparation (such as binarization, skew correction, etc.).

Notes:

  • If you set this property to ORM_No and resolution of the prepared image is too low (less than 50 dpi), too high (more than 3200 dpi), or undefined, the image will not be opened and an error will occur.
  • If you are opening a PDF file, the new resolution will be used for image rasterization; image size in pixels may be modified according to the detected resolution and the page dimensions.

By default, the value of the property is ORM_Auto.

ResolutionToOverwrite

int

This value is used to overwrite resolution of the preprocessed image if the OverwriteResolutionMode property is ORM_Manual.

Note that the default value of this property is 0, so you must set the desired value yourself. If you set OverwriteResolutionMode to ORM_Manual and don’t set the value for this property, an error will occur.

SplitType

PageSplitTypeEnum

Specifies the parameters of page splitting.

StraightenLinesMode

StraightenLinesModeEnum

Specifies how lines will be straightened.

This property is SLM_Auto by default. In this case new neural network algorithm would be used.

UseFastBinarization

VARIANT_BOOL

If this property is TRUE, ABBYY FineReader Engine will use algorithms for fast image binarization. Binarization is performed either during preprocessing (if DiscardColorImage is TRUE), or later when a black-and-white image is necessary (e.g., when you call the IImageDocument::BlackWhiteImage property for an open image document for the first time). This property set to TRUE will speed up binarization; however, its quality may deteriorate.

By default, the value of this property is FALSE.

ResolutionDetectionMode

ResolutionDetectionMode

Specifies how resolution will be detected

This property is RDM_Auto by default. In this case new neural network algorithm would be used.




Methods

NameDescription
CopyFromInitializes properties of the current object with values of similar properties of another object.
LoadFromFileRestores the object contents from a file on disk.
LoadFromMemory <Note> : Windows only. </Note>Restores the object contents from the global memory.
SaveToFileSaves the object contents into a file on disk.
SaveToMemory <Note> : Windows only. </Note>Saves the object contents into the global memory.
PagePreprocessingParams Object Diagram

Output parameter

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

Input parameter

This object is passed as an input parameter to the following methods:

Samples

The object is used in the following code samples:

See also

Tuning Parameters of Preprocessing, Analysis, Recognition, and Synthesis Working with Properties