ImageEn, unit imageenproc

TImageEnProc.SkewDetectionFine

TImageEnProc.SkewDetectionFine


Declaration

function SkewDetectionFine(StartingAngle: Double; resolution: Double; range: Integer; maxQuality: Boolean): Double;


Description

Estimate the orientation angle (in degrees) of the lines of text. Rather than using a Hough transform like SkewDetection, SkewDetectionFine performs progressive rotations to find the best orientation.

Note:
- Apply this method only to images that contains printed text
- If the image PixelFormat is not ie24RGB or ie1g, it will be converted

Parameter Description
StartingAngle The angle to start testing (0 if you don't know)
Resolution The increments of angle tested (0.1 is good)
Range The range of angles to test (specifying 10, for example, to test from -5 to +5)
MaxQuality if False, testing is only performed on a thumbnail to speed up processing (at the cost of accuracy)


Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Example

// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

 

// Check for skew within the range -5 to 5 with 0.1 degrees of precision and automatically orient (for printed text)
d := ImageEnView1.Proc.SkewDetectionFine( 0, 0.1, 10, True );
ImageEnView1.Proc.RotateAndCrop( d, ierBicubic );

 


See Also

- SkewDetection
- CalcOrientation