ImageGear for C and C++ on Windows v19.1 - Updated
IG_REC_image_deskew
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Recognition Image Preprocessing Functions > IG_REC_image_deskew

Performs immediate deskewing on the given image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_image_deskew(
   HIG_REC_IMAGE hImage,
   AT_INT Slope
);

Arguments:

Name Type Description
hImage HIG_REC_IMAGE Handle of the image.
Slope AT_INT Integer slope value for deskewing. The value given here is the number of pixels of vertical ascent on 1000 horizontal pixels. That is, the tangent of the deskew angle multiplied by 1000. The Slope parameter must be in the range -577 to 577; that means the maximal slope value is 30 degrees.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

See IG_REC_image_import.

Example:

 
Copy Code
AT_ERRCOUNT ErrCount = 0;
AT_INT nSlope = 0;
enumIGRecImgRotate eImgRotate = IG_REC_IMG_ROTATE_AUTO;
HIGEAR higImage = 0;
HIG_REC_IMAGE higRecImage = 0;

ErrCount += IG_load_file("Image.tif", &higImage);
ErrCount += IG_REC_image_import(higImage, &higRecImage);
ErrCount += IG_REC_image_skew_detect(higRecImage, &nSlope, &eImgRotate);
ErrCount += IG_REC_image_deskew(higRecImage, nSlope);

//...

ErrCount += IG_REC_image_delete(higRecImage);
ErrCount += IG_image_delete(higImage);

Remarks:

  1. Recognition component ignores a skew value if it is 0.5 degree or less.
  2. When this function is called, the coordinates of all defined zones in the zone list will be automatically recalculated.
  3. The image to be deskewed can be of any type (bi-tonal, grayscale, or color).
  4. The function IG_REC_image_skew_detect can detect the skew of a specified image, but only up to 15 degrees.
  5. This function ignores the current Image deskewing mode setting as set by a previous IG_REC_deskew_mode_set call and also the value in IG_REC_slope_set. Those settings relate only to deskewing performed during pre-processing initiated by IG_REC_image_preprocess, which supports programmed or auto-deskewing.
  6. This function works incorrectly if Asian languages are enabled for recognition.

See Also

HIG_REC_IMAGE