This interface represents 2D transformations of a coordinate system. More...
Public Member Functions | |
double | Build (ILPoints *srcPoints, ILPoints *dstPoints, LPVTransformType type) |
ILTransform * | Rotate (double da, LPVAxis axis) |
ILTransform * | Scale (double factorX, double factorY) |
ILTransform * | Transform (ILTransform *tf) |
ILTransform * | Translate (double offsetX, double offsetY) |
Public Member Functions inherited from ILObject | |
ILObject * | Copy () |
LPVErrorCode | Load (LString filename) |
void | Reset () |
LPVErrorCode | Save (LString filename) |
BOOL | Valid () |
Properties | |
LMatrix33 | Matrix [get, set] |
The \( 3 \times 3 \) transformation matrix. By default, it's an identity matrix. | |
This interface represents 2D transformations of a coordinate system.
A transformation specifies how to translate, scale, rotate or project the coordinate system, with the \( 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.
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.
[in] | srcPoints | The source points. |
[in] | dstPoints | The destination points, same count as the source. |
[in] | type | The transformation type. Usually it's set to LPVTransformHomography . |
mapError | Return 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. |
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.
[in] | da | The rotation angle in degrees. |
[in] | axis | The rotation axis. |
result | Return the new transformation. |
ILTransform* Scale | ( | double | factorX, |
double | factorY | ||
) |
Scale the coordinate system by the given factor and return a new transformation.
[in] | factorX | The scale factor of x-coordinate |
[in] | factorY | The scale factor of y-coordinate |
result | Return the new transformation |
ILTransform* Transform | ( | ILTransform * | tf | ) |
Transform the coordinate system by the given transformation and return a new transformation.
[in] | tf | The transformation. |
result | Return the new transformation. |
ILTransform* Translate | ( | double | offsetX, |
double | offsetY | ||
) |
Move the coordinate system by the given offset and return a new transformation.
[in] | offsetX | The x-coordinate of the offset |
[in] | offsetY | The y-coordinate of the offset |
result | Return the new transformation |