Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILTransform Interface Reference

This interface represents 2D transformations of a coordinate system. More...

Inheritance diagram for ILTransform:
ILObject LTransform

Public Member Functions

double Build (ILPoints *srcPoints, ILPoints *dstPoints, LPVTransformType type)
 
ILTransformRotate (double da, LPVAxis axis)
 
ILTransformScale (double factorX, double factorY)
 
ILTransformTransform (ILTransform *tf)
 
ILTransformTranslate (double offsetX, double offsetY)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Properties

LMatrix33 Matrix [get, set]
 The @math_eq{3 \times 3} transformation matrix. By default, it's an identity matrix.
 

Detailed Description

This interface represents 2D transformations of a coordinate system.

A transformation specifies how to translate, scale, rotate or project the coordinate system, with the @math_eq{3 \times 3} matrix inside.

It can be built using the Scale(), Rotate() and Translate() functions, or modify the involved LMatrix33 directly. Alternatively, it can be built using Build() by computing the transformation between the corresponding point pairs.

To use this interface, you should create a LTransform object.

Example Code

Member Function Documentation

◆ Build()

double Build ( ILPoints srcPoints,
ILPoints dstPoints,
LPVTransformType  type 
)

Build the transformation based on the given source and destination points, as:

\[ dst \sim H src \]

where the back-projection error is minimized.
It is recommended to provide at least 4 point pairs.

Parameters
[in]srcPointsThe source points.
[in]dstPointsThe destination points, same count as the source.
[in]typeThe transformation type. Usually it's set to LPVTransformHomography .
Return values
mapErrorReturn the mapping error of the result transformation which is the average of the distances between destination points and the mapping results. Return -1 for failure.

◆ Rotate()

ILTransform* Rotate ( double  da,
LPVAxis  axis 
)

Rotate the coordinate system by the given angle about the specified axis and return a new transformation. Note that for rotation in the image coordinates, the rotation axis is LPVAxisZ (which is the default value) and the rotation angle is clockwise because the image's y-axis points downwards.

Parameters
[in]daThe rotation angle in degrees.
[in]axisThe rotation axis.
Return values
resultReturn the new transformation.

◆ Scale()

ILTransform* Scale ( double  factorX,
double  factorY 
)

Scale the coordinate system by the given factor and return a new transformation.

Parameters
[in]factorXThe scale factor of x-coordinate
[in]factorYThe scale factor of y-coordinate
Return values
resultReturn the new transformation

◆ Transform()

ILTransform* Transform ( ILTransform tf)

Transform the coordinate system by the given transformation and return a new transformation.

Parameters
[in]tfThe transformation.
Return values
resultReturn the new transformation.

◆ Translate()

ILTransform* Translate ( double  offsetX,
double  offsetY 
)

Move the coordinate system by the given offset and return a new transformation.

Parameters
[in]offsetXThe x-coordinate of the offset
[in]offsetYThe y-coordinate of the offset
Return values
resultReturn the new transformation