Click or drag to resize

ImageFileTransformByMatrix Method

This method performs a geometric transformation on a page of the image file using the passed transformation matrix.

Namespace:  Kofax.OmniPageCSDK.IproPlus
Assembly:  Kofax.OmniPageCSDK.IproPlus (in Kofax.OmniPageCSDK.IproPlus.dll) Version: 1.0.0.0
Syntax
public void TransformByMatrix(
	double M00,
	double M01,
	double M02,
	double M10,
	double M11,
	double M12,
	double M20,
	double M21,
	ref IPROSIZE Size,
	[OptionalAttribute] int Page
)

Parameters

M00
Type: SystemDouble
M01
Type: SystemDouble
M02
Type: SystemDouble
M10
Type: SystemDouble
M11
Type: SystemDouble
M12
Type: SystemDouble
M20
Type: SystemDouble
M21
Type: SystemDouble
Size
Type: Kofax.OmniPageCSDK.IproPlusIPROSIZE
Page (Optional)
Type: SystemInt32
Remarks

The transformation matrix is a 3 by 3 element matrix in which the bottom-right (2, 2) element is always 1. The Mij parameter denotes the matrix element in the ith row and jth column. Each (x0, y0) point of the page is transformed to the (x2, y2) point with the following formula:

[x1, y1, z1] = M * [x0, y0, 1], where [x, y, z] denotes a column-vector. Then x2 = x1/z1 and y2 = y1 / z1.

Rotation, translation, enlargement, shrinking, shearing, perspective transformations and their combinations can be performed using this function.

For example the parameters for rotation by a degrees are:

cos(a), sin(a), 0,

-sin(a), cos(a), 0,

0, 0.

The parameters for scaling by scale factors are:

s, 0, 0,

0, s, 0,

0, 0.

The Size parameter defines the new dimensions of the image. If it is NULL (or Nothing), the original image dimensions are unchanged. If the optional Page Long parameter is unspecified or -1 the first page is transformed. Otherwise, the page defined by the Page index parameter is transformed.

This method can only be used with multi-page image TIFF files. A further requirement is that the pages in the multi-page TIFF file must be stored in one-strip format and the StripBytesCount TIFF tag must exist in the page header. TIFF image files created by the Capture SDK fulfill this requirement.

Transformations by defining points are also possible.

See Also