Data structures and functions to work with areas of interest and their transformations. More...
Data Structures | |
struct | TArea |
Describes an area of interest that is using three points (P0, P1 and P2). More... | |
struct | TDRect |
Double precision rectangle defined by its edges. More... | |
struct | TMatrix |
Defines a 2x2 transformation matrix. More... | |
Functions | |
double | Argument (double X, double Y) |
Calculates the argument (direction) of the vector X, Y. More... | |
cvbbool_t | CreateAffineTransformedImage (IMG ImageIn, const TCoordinateMap &CS, IMG &ImageOut) |
Creates an affine transformed image from the given ImageIn. More... | |
cvbbool_t | CreateAreaAffineTransformedImage (IMG ImageIn, const TCoordinateMap &CS, const TArea &Area, IMG &ImageOut) |
Creates an affine transformed, linear interpolated image of the given Area from the given ImageIn. More... | |
cvbbool_t | CreateMatrixTransformedImage (IMG ImageIn, TMatrix Matrix, IMG &ImageOut) |
Creates a matrix transformed image. More... | |
cvbbool_t | CreateMatrixTransformedImageEx (IMG ImageIn, TMatrix Matrix, IMG &ImageOut) |
Creates a matrix transformed image. More... | |
bool | InverseMatrix (TMatrix A, TMatrix &AInv) |
Computes the inverse of matrix A, if possible. More... | |
double | MatrixDeterminant (TMatrix A) |
Calculates the determinant of the given matrix A. More... | |
void | MatrixITransform (cvbval_t Xin, cvbval_t Yin, TMatrix A, cvbval_t &Xout, cvbval_t &Yout) |
Calculates the transformation for the input vector (Xin, Yin) based on the matrix A. More... | |
void | MatrixRTransform (double Xin, double Yin, TMatrix A, double &Xout, double &Yout) |
Calculates the transformation for the input vector (Xin, Yin) based on the matrix A. More... | |
void | MatrixTransformArea (TArea AreaIn, TMatrix A, TArea &AreaOut) |
Performs a matrix transformation on a given area. More... | |
void | MultiplyMatrices (TMatrix A, TMatrix B, TMatrix &R) |
Multiplies two matrices A and B. More... | |
void | RotationMatrix (double Angle, TMatrix &R) |
Calculates the rotation matrix coefficients for a given Angle. More... | |
void | SetArea (double X0, double Y0, double X1, double Y1, double X2, double Y2, TArea &Area) |
Sets the coordinates to the given Area. More... | |
void | SetMatrix (double A11, double A12, double A21, double A22, TMatrix &A) |
Sets the components to a 2x2 matrix A. More... | |
void | SetRectArea (double Left, double Top, double Right, double Bottom, TArea &Area) |
Sets the Area points P0, P1, and P2 based on the given rectangle borders. More... | |
Data structures and functions to work with areas of interest and their transformations.
double Argument | ( | double | X, |
double | Y | ||
) |
cvbbool_t CreateAffineTransformedImage | ( | IMG | ImageIn, |
const TCoordinateMap & | CS, | ||
IMG & | ImageOut | ||
) |
Creates an affine transformed image from the given ImageIn.
The coordinate system is also transformed via ComposeCoordinateMaps to reflect the translatory changes. The resulting ImageOut width and height are as with CreateMatrixTransformedImage, but the image coordinates are also transformed regarding the origin of the given CS. This is where this function differs from CreateMatrixTransformedImage.
This is effectively a shorthand for
The following BytesPerPixel for signed and unsigned integer cvbdatatype_t values are supported: 1, 2, 4, and 8. For floating point cvbdatatype_t values only 4 and 8 BytesPerPixel are supported.
[in] | ImageIn | Image object handle of the source image to be transformed. |
[in] | CS | Affine matrix with which the image is transformed. |
[out] | ImageOut | Variable to receive the handle of the output image. |
cvbbool_t CreateAreaAffineTransformedImage | ( | IMG | ImageIn, |
const TCoordinateMap & | CS, | ||
const TArea & | Area, | ||
IMG & | ImageOut | ||
) |
Creates an affine transformed, linear interpolated image of the given Area from the given ImageIn.
The coordinate system is also transformed via ComposeCoordinateMaps to reflect the translatory changes. The resulting ImageOut has the dimensions of the smallest possible rectangle which encloses the given Area which has been transformed with TCoordinateMap::Matrix. The image coordinates are also transformed of ImageOut the given CS.
The following BytesPerPixel for signed and unsigned integer cvbdatatype_t values are supported: 1, 2, 4, and 8. For floating point cvbdatatype_t values only 4 and 8 BytesPerPixel are supported.
[in] | ImageIn | Image object handle of the source image to be transformed. |
[in] | Area | Area of interest in image coordinates to be transformed. |
[in] | CS | Affine matrix with which the image is transformed. |
[out] | ImageOut | Variable to receive the handle of the output image. |
Creates a matrix transformed image.
The possible geometric transformations with the specified 2x2 Matrix include
The resulting ImageOut, which is created via CreateCompatibleImage, has the coordinate system being transformed regarding its origin. The resulting width and height is defined by the bounding box of the matrix transformed image area.
The following BytesPerPixel for signed and unsigned integer cvbdatatype_t values are supported: 1, 2, 4, and 8. For floating point cvbdatatype_t values only 4 and 8 BytesPerPixel are supported.
[in] | ImageIn | Image object handle of the source image to be transformed. |
[in] | Matrix | Matrix with which the image is transformed. |
[out] | ImageOut | Variable to receive the handle of the output image. |
Creates a matrix transformed image.
The possible geometric transformations with the specified 2x2 Matrix include
The resulting ImageOut, which is created via CreateCompatibleImage, has the default coordinate system. The resulting width and height is defined by the bounding box of the matrix transformed image area.
The following BytesPerPixel for signed and unsigned integer cvbdatatype_t values are supported: 1, 2, 4, and 8. For floating point cvbdatatype_t values only 4 and 8 BytesPerPixel are supported.
[in] | ImageIn | Image object handle of the source image to be transformed. |
[in] | Matrix | Matrix with which the image is transformed. |
[out] | ImageOut | Variable to receive the handle of the output image. |
Computes the inverse of matrix A, if possible.
determinant
is not zero [in] | A | Input matrix. |
[out] | AInv | TMatrix object to be filled with the coefficients of the inverted matrix. |
|
related |
Calculates the determinant of the given matrix A.
[in] | A | Matrix for which the determinant is calculated. |
|
related |
Calculates the transformation for the input vector (Xin, Yin) based on the matrix A.
The transformation is calculated with double precision floating point arithmetic and then rounded (mathematically) to the next integer.
[in] | Xin | X coordinate of input vector. |
[in] | Yin | Y coordinate of input vector. |
[in] | A | Matrix with which the vector is multiplied. |
[out] | Xout | Variable to be filled with X coordinate of the output vector. |
[out] | Yout | Variable to be filled with Y coordinate of the output vector. |
|
related |
Calculates the transformation for the input vector (Xin, Yin) based on the matrix A.
[in] | Xin | X coordinate of input vector. |
[in] | Yin | Y coordinate of input vector. |
[in] | A | Matrix with which the vector is multiplied. |
[out] | Xout | Variable to be filled with X coordinate of the output vector. |
[out] | Yout | Variable to be filled with Y coordinate of the output vector. |
Performs a matrix transformation on a given area.
[in] | AreaIn | Input area. |
[in] | A | Transformation matrix. |
[out] | AreaOut | Area to receive the transformed point coordinates. |
Multiplies two matrices A and B.
[in] | A | A on the left side of the multiplication. |
[in] | B | A on the right side of the multiplication. |
[out] | R | TMatrix object to be filled with the result of the multiplication. |
|
related |
Calculates the rotation matrix coefficients for a given Angle.
[in] | Angle | Rotation angle (in degrees). |
[out] | R | TMatrix object to be filled with rotation matrix coefficients. |
|
related |
Sets the coordinates to the given Area.
This simply assigns the values to the Area.
[in] | X0 | X coordinate of point 0. |
[in] | Y0 | Y coordinate of point 0. |
[in] | X1 | X coordinate of point 1. |
[in] | Y1 | Y coordinate of point 1. |
[in] | X2 | X coordinate of point 2. |
[in] | Y2 | Y coordinate of point 2. |
[out] | Area | TArea object to be filled with given coordinates. |
|
related |
Sets the components to a 2x2 matrix A.
This simply assigns the values to the matrix A as defined in TMatrix.
[in] | A11 | Top left element of matrix. |
[in] | A12 | Top right element of matrix. |
[in] | A21 | Bottom left element of matrix. |
[in] | A22 | Bottom right element of matrix. |
[out] | A | TMatrix object to be filled with given coefficients. |
|
related |
Sets the Area points P0, P1, and P2 based on the given rectangle borders.
P0: (Left, Top)
P1: (Right, Top)
P2: (Left, Bottom)
[in] | Left | Left border coordinate of area. |
[in] | Top | Top border coordinate of area. |
[in] | Right | Right border coordinate of area (inclusive). |
[in] | Bottom | Bottom border coordinate of area (inclusive). |
[out] | Area | TArea object which points are set based on the given borders. |