> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PagePreprocessingParams Object (IPagePreprocessingParams Interface)

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](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/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](/fine-reader/engine/api-reference/supplementary-objects-and-methods/savetofile-method), and [LoadFromFile](/fine-reader/engine/api-reference/supplementary-objects-and-methods/loadfromfile-method)

Windows [SaveToFile](/fine-reader/engine/api-reference/supplementary-objects-and-methods/savetofile-method), [LoadFromFile](/fine-reader/engine/api-reference/supplementary-objects-and-methods/loadfromfile-method), [SaveToMemory](/fine-reader/engine/api-reference/supplementary-objects-and-methods/savetomemory-method), and [LoadFromMemory](/fine-reader/engine/api-reference/supplementary-objects-and-methods/loadfrommemory-method).

## Properties

<table><thead><tr><th><p><strong>Name</strong></p></th><th><p><strong>Type</strong></p></th><th><p><strong>Description</strong></p></th></tr></thead><tbody><tr><td><p><strong>Application</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/engine-object-iengine-interface">Engine</a></strong>, <a href="/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties#readonly_properties">read-only</a></p></td><td><p>Returns the <strong><a href="/fine-reader/engine/api-reference/engine-object-iengine-interface">Engine</a> </strong>object.</p></td></tr><tr><td><p><a name="backgroundwhitening" /><strong>BackgroundWhitening</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/threestatepropertyvalueenum">ThreeStatePropertyValueEnum</a></strong></p></td><td><p>Specifies if image background should be whitened.</p><p>This property is TSPV\_Auto by default. In default mode, ABBYY FineReader Engine whitens the background.</p></td></tr><tr><td><p><a name="correctgeometry" /><strong>CorrectGeometry</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/threestatepropertyvalueenum">ThreeStatePropertyValueEnum</a></strong></p></td><td><p>Specifies whether geometrical distortions (perspective on photos, curved lines from scanned books, etc.) should be removed during page preprocessing.</p><p>This property is TSPV\_Auto by default. In default mode, ABBYY FineReader Engine corrects geometry for photographs.</p></td></tr><tr><td><p><a name="correctinvertedimage" /><strong>CorrectInvertedImage</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/threestatepropertyvalueenum">ThreeStatePropertyValueEnum</a></strong></p></td><td><p>Specifies if inverted image should be corrected.</p><p>This property is TSPV\_Auto by default. In default mode, ABBYY FineReader Engine corrects inverted images.</p></td></tr><tr><td><p><a name="correctorientationmode" /><strong>CorrectOrientationMode</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/correctorientationmodeenum">CorrectOrientationModeEnum</a></strong></p></td><td><p>Specifies how image orientation should be corrected during preprocessing.</p><p>The default value is COM\_Auto, which means orientation will be determined and corrected automatically if needed.</p></td></tr><tr><td><p><a name="correctskew" /><strong>CorrectSkewMode</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/correctskewmodeenum">CorrectSkewModeEnum</a></strong></p></td><td><p>If this property is set to CSM\_Auto or CSM\_Fast, image skew will be corrected during page preprocessing.</p><Note>Skew can be corrected only for angles not greater than 20 degrees.</Note><p>By default, this property is set to CSM\_Auto, which means precise skew correction.</p></td></tr><tr><td><p><a name="cropimage" /><strong>CropImage</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/threestatepropertyvalueenum">ThreeStatePropertyValueEnum</a></strong></p></td><td><p>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.</p><Note>This feature is not supported for black-and-white images.</Note><p>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.</p></td></tr><tr><td><p><a name="detectimagetype" /><strong>DetectImageType</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/threestatepropertyvalueenum">ThreeStatePropertyValueEnum</a></strong></p></td><td><p>Specifies how the image type is determined. Works in conjunction with ImageSourceType.</p><p>Default: TSPV\_Auto (effective only when <a href="/fine-reader/engine/api-reference/image-related-objects/prepareimagemode">ImageSourceType = IST\_Auto</a>).</p><ul><li>If <a href="/fine-reader/engine/api-reference/enumerations/imagesourcetypeenum">ImageSourceType</a> = IST\_Auto:</li></ul><ul><ul><li>TSPV\_Auto/TSPV\_Yes — the Engine detects the image type automatically.</li></ul></ul><ul><ul><li>TSPV\_No — the Engine does not detect; it reads the image type from the file’s properties/metadata (faster, but depends on correct metadata).</li></ul></ul><ul><li>If <a href="/fine-reader/engine/api-reference/enumerations/imagesourcetypeenum">ImageSourceType</a> 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.</li></ul></td></tr><tr><td><p><a name="discardcolorimage" /><strong>DiscardColorImage</strong></p></td><td><p><strong><a href="/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties">VARIANT\_BOOL</a></strong></p></td><td><p>This property set to TRUE tells ABBYY FineReader Engine to leave only <a href="/fine-reader/engine/guided-tour/advanced-techniques/working-with-images#black-and-white">black-and-white</a> plane in the prepared image. In this case, image binarization is performed during image preprocessing.</p><p>By default, this property is set to FALSE.</p></td></tr><tr><td><p><a name="overwriteresolutionmode" /><strong>OverwriteResolutionMode</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/overwriteresolutionmodeenum">OverwriteResolutionEnum</a></strong></p></td><td><p>If this property is set to ORM\_Auto, ABBYY FineReader Engine will automatically detect and overwrite image resolution.</p><p>If it is set to ORM\_Manual, use the <strong><a href="/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/pagepreprocessingparams#resolutiontooverwrite">ResolutionToOverwrite</a></strong> property to specify the new image resolution.</p><p>The new resolution will be applied before all other stages of image preparation (such as binarization, skew correction, etc.).</p><p>Notes:</p><ul><li>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.</li><li>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.</li></ul><p>By default, the value of the property is ORM\_Auto.</p></td></tr><tr><td><p><a name="resolutiontooverwrite" /><strong>ResolutionToOverwrite</strong></p></td><td><p><strong><a href="/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties">int</a></strong></p></td><td><p>This value is used to overwrite resolution of the preprocessed image if the <strong>OverwriteResolutionMode</strong> property is ORM\_Manual.</p><p>Note that the default value of this property is 0, so you must set the desired value yourself. If you set <strong>OverwriteResolutionMode</strong> to ORM\_Manual and don't set the value for this property, an error will occur.</p></td></tr><tr><td><p><a name="splittingparams" /><strong>SplitType</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/pagesplittypeenum">PageSplitTypeEnum</a></strong></p></td><td><p>Specifies the parameters of page splitting.</p></td></tr><tr><td><p><a name="straightenlinesmode" /><strong>StraightenLinesMode</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/straightenlinesmodeenum">StraightenLinesModeEnum</a></strong></p></td><td><p>Specifies how lines will be straightened.</p><p>This property is SLM\_Auto by default. In this case new neural network algorithm would be used.</p></td></tr><tr><td><p><a name="usefastbinarization" /><strong>UseFastBinarization</strong></p></td><td><p><strong><a href="/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties">VARIANT\_BOOL</a></strong></p></td><td><p>If this property is TRUE, ABBYY FineReader Engine will use algorithms for fast image binarization. Binarization is performed either during preprocessing (if <strong>DiscardColorImage</strong> is TRUE), or later when a black-and-white image is necessary (e.g., when you call the <strong><a href="/fine-reader/engine/api-reference/image-related-objects/imagedocument#blackwhiteimage">IImageDocument::BlackWhiteImage</a></strong> property for an open image document for the first time). This property set to TRUE will speed up binarization; however, its quality may deteriorate.</p><p>By default, the value of this property is FALSE.</p></td></tr><tr><td><p><a name="resolutiondetectionmode" /><strong>ResolutionDetectionMode</strong></p></td><td><p><strong><a href="/fine-reader/engine/api-reference/enumerations/resolutiondetectionmode">ResolutionDetectionMode</a></strong></p></td><td><p>Specifies how resolution will be detected</p><p>This property is RDM\_Auto by default. In this case new neural network algorithm would be used.</p></td></tr><tr><td><br /></td><td><br /></td><td><br /></td></tr></tbody></table>

## Methods

| Name                                                                                                                                               | Description                                                                                       |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [CopyFrom](/fine-reader/engine/visual-components-reference/supplementary-objects/spellwordcollection/copyfrom-method)                              | Initializes properties of the current object with values of similar properties of another object. |
| [LoadFromFile](/fine-reader/engine/api-reference/supplementary-objects-and-methods/loadfromfile-method)                                            | Restores the object contents from a file on disk.                                                 |
| [LoadFromMemory](/fine-reader/engine/api-reference/supplementary-objects-and-methods/loadfrommemory-method) <br /><br /> **Note:** *Windows only.* | Restores the object contents from the global memory.                                              |
| [SaveToFile](/fine-reader/engine/api-reference/supplementary-objects-and-methods/savetofile-method)                                                | Saves the object contents into a file on disk.                                                    |
| [SaveToMemory](/fine-reader/engine/api-reference/supplementary-objects-and-methods/savetomemory-method) <br /><br /> **Note:** *Windows only.*     | Saves the object contents into the global memory.                                                 |

## Related objects

<img src="https://mintcdn.com/abbyy/i-EfCQVmseNiPQcp/images/fine-reader/engine/pagepreprocessingparams.gif?s=7cbf0fd96e282b322f8996026b76398a" alt="PagePreprocessingParams" width="270" height="66" data-path="images/fine-reader/engine/pagepreprocessingparams.gif" />[](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/pageprocessingparams#pagepreprocessingparams)[](/fine-reader/engine/api-reference/parameter-objects/preprocessing-analysis-recognition-and-synthesis-parameters/pageprocessingparams)

[Object Diagram](/fine-reader/engine/api-reference/object-diagram)

## Output parameter

This object is the output parameter of the [CreatePagePreprocessingParams](/fine-reader/engine/api-reference/engine-object-iengine-interface/creation-methods/createlessobjectgreater-methods) method of the [Engine](/fine-reader/engine/api-reference/engine-object-iengine-interface) object.

## Input parameter

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

* [Preprocess](/fine-reader/engine/api-reference/document-related-objects/frdocument/preprocess-method), [PreprocessPages](/fine-reader/engine/api-reference/document-related-objects/frdocument/preprocesspages-method) methods of the [FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument) object
* [Preprocess](/fine-reader/engine/api-reference/document-related-objects/frpage/preprocess-method) method of the [FRPage](/fine-reader/engine/api-reference/document-related-objects/frpage) object

## Samples

The object is used in the following code samples:

* Linux: [CommandLineInterface](/fine-reader/engine/guided-tour/samples#commandlineinterface)
* Windows: [CommandLineInterface](/fine-reader/engine/guided-tour/samples#commandlineinterface); and demo tools: [Classification](/fine-reader/engine/guided-tour/samples#classification).

## See also

[Tuning Parameters of Preprocessing, Analysis, Recognition, and Synthesis](/fine-reader/engine/guided-tour/advanced-techniques/tuning-parameters-of-preprocessing-analysis-recognition-and-synthesis)

[Working with Properties](/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties)
