ImageEn, unit IEVision

TIEVisionImage.getTransformInfo

TIEVisionImage.getTransformInfo

Declaration

function getTransformInfo(scale: double_p = nil; angle: double_p = nil; margin: int32_p = nil): bool32; safecall;

Description

For an image returned by prepareForOCR or deskew, returns the changes made to the geometry of the source image.
Returns False for any other image (and scale = 1, angle = 0, margin = 0).
Parameter Description
scale Optional. Receives the scale applied (1 = none)
angle Optional. Receives the clockwise rotation applied to correct the skew, in degrees (0 = none)
margin Optional. Receives the width of the white margin added on each side, in pixels

Note: The information belongs to the TIEVisionImage object that was returned. It is lost if the image is assigned to a TIEBitmap and then retrieved again.

Examples

Also see: Automated Samples
var
  scale, angle: Double;
  margin: int32_t;
begin
  prepared := ImageEnView1.IEBitmap.GetIEVisionImage().prepareForOCR();
  if prepared.getTransformInfo( @scale, @angle, @margin ) then
    ShowMessage( Format( 'Scale: %.2f, Deskew: %.2f deg, Margin: %d', [ scale, angle, margin ]));
end;


// Return the geometry changes made by prepareForOCR
img := ImageEnView1.IEBitmap.GetIEVisionImage().prepareForOCR();
img.getTransformInfo( @scale, @angle, @margin );
s := Format( 'Scale: %.2f, Deskew: %.2f, Margin: %d', [ scale, angle, margin ]);

For the following image, the result is "Scale: 1.54, Deskew: -0.38 deg, Margin: 10"

See Also

◼mapRectToSource