ImageGear for C and C++ on Windows v19.8 - Updated
Enhance Image Quality
User Guide > How to Work with... > OCR > How to... > Prepare the Input > Enhance Image Quality

Before recognizing an image, some image pre-processing procedures can be used to enhance the quality of an image resulting in more accurate auto-zoning and recognition. This is typically done with the function IG_REC_image_preprocess(), which can include any or all of the following steps:

Deskew and rotation operation are performed on the current image, that is, the result of such preprocessing will be visible after the further exporting the recognition image into HIGEAR. Inversion, despeckling, and resolution enhancement is performed internally.

The following functions let you define the behavior of these image enhancement steps:

Example:

This code example demonstrates pre-processing an image to deskew it by a set value with the IG_REC_image_preprocess() function:

C
Copy Code
AT_ERRCOUNT nErrCount;
HIG_REC_IMAGE hImg;
HIGEAR hIGear;
nErrCount = IG_load_file("Image.tif", &hIGear );
nErrCount = IG_REC_image_import(hIGear, &hImg);
nErrCount = IG_image_delete(hIGear);
nErrCount = IG_REC_deskew_mode_set(IG_REC_IMG_DESKEW_SET);
nErrCount = IG_REC_slope_set(82);
nErrCount = IG_REC_image_preprocess(hImg);
//...
nErrCount = IG_REC_image_delete(hImg);

The image pre-processing functions can also be called one by one. In your code you can use the inverting function ( IG_REC_image_invert() ), the rotating function ( IG_REC_image_orient() ), the deskewing function ( IG_REC_image_deskew() ), and the despeckling function (IG_REC_image_despeckle()). When the application calls any of these functions, the appropriate image enhancement step is immediately performed on the image, and the result is available to both the recognition engine and the application. These functions do not have progress monitoring facilities.