ImgDeskewSafe

Top  Previous  Next

Prototype

 

floatAngle:=ImgDeskewSafe(intImageHandle, intRange, floatResolution, intStep, boolIfWhiteBackground, boolIfInterpolation)

 

Description

 

Deskew the image as ImgDeskew but avoid to loose info on borders because it increases the size of image before rotating.

 

Parameters

 

intImageHandle: integer value corresponding to the image handle.

 

intRange: integer value that specifies the range of deskewing (between -SpecifiedValue and +SpecifiedValue);

 

floatResolution: resolution used in deskew procedure.

 

intStep: rows step in the loop that reads and analyzes rows of the image (0: Automatic; 1:All the rows)

 

boolIfWhiteBackground: boolean that specifies if background created by rotation is filled by white or black ink;

 

boolIfInterpolation: boolean that specifies if you want to use Interpolation.

 

Returned value

 

floatAngle : calculated deskew angle.

 

Notes

 

None.

 

Example

 

// Save original width and height

OWidth:=ImgGetWidth(_CurrentImage);

OHeight:=ImgGetHeight(_CurrentImage);

 

// Image safe deskewing

angle:=ImgDeskewSage(_CurrentImage, 5, 0.1, 0, False, False);

 

// Retrieve new width and height

NWidth:=ImgGetWidth(_CurrentImage);

NHeight:=ImgGetHeight(_CurrentImage);

 

// Log a message with deskewd angle

ApplicationLog('Safe deskewed image: '+ FloatToStr(angle) +'°.');

 

// Log a message with old size

ApplicationLog('Old image size: '+ IntToStr(OWidth)+'x'IntToStr(OHeight));

 

// Log a message with new size

ApplicationLog('New image size: '+ IntToStr(NWidth)+'x'IntToStr(NHeight));