ImageEn, unit ievision

TIEVisionOCR.getTextAngle

TIEVisionOCR.getTextAngle


Declaration

function getTextAngle(): single; overload; safecall;
function getTextAngle(image: TIEVisionImage): single; overload; safecall;


Description

Returns the text angle (orientation) in radians.
First overload takes last processed image as input.
Second overload takes the specified image as input.

Parameter Description
image Source image

Note: You should get a better deskew angle using getOrientation


Example

// Detect orientation
angle := OCR.getTextAngle( DestIEViewer.IEBitmap.GetIEVisionImage() ) * 180 / PI;
ImageEnView1.IEBitmap.Origin := ieboBOTTOMLEFT;
ImageEnView1.Proc.Rotate(-angle);

OCR.getTextAngle() returns -1.56 for the following image (which is -89 deg.):