NVIDIA Performance Primitives (NPP)
Version 9.2
|
Functions | |
NppStatus | nppiGetAffineTransform (NppiRect oSrcROI, const double aQuad[4][2], double aCoeffs[2][3]) |
Computes affine transform coefficients based on source ROI and destination quadrilateral. More... |
|
NppStatus | nppiGetAffineQuad (NppiRect oSrcROI, double aQuad[4][2], const double aCoeffs[2][3]) |
Compute shape of transformed image. More... |
|
NppStatus | nppiGetAffineBound (NppiRect oSrcROI, double aBound[2][2], const double aCoeffs[2][3]) |
Compute bounding-box of transformed image. More... |
|
Compute bounding-box of transformed image.
The method effectively computes the bounding box (axis aligned rectangle) of the transformed source ROI (see nppiGetAffineQuad()).
oSrcROI | The source ROI. |
aBound | The resulting bounding box. |
aCoeffs | The afine transform coefficients. |
Compute shape of transformed image.
This method computes the quadrilateral in the destination image that the source ROI is transformed into by the affine transformation expressed by the coefficients array (aCoeffs).
oSrcROI | The source ROI. |
aQuad | The resulting destination quadrangle. |
aCoeffs | The afine transform coefficients. |
NppStatus nppiGetAffineTransform | ( | NppiRect | oSrcROI, |
const double | aQuad[4][2], | ||
double | aCoeffs[2][3] | ||
) |
Computes affine transform coefficients based on source ROI and destination quadrilateral.
The function computes the coefficients of an affine transformation that maps the given source ROI (axis aligned rectangle with integer coordinates) to a quadrilateral in the destination image.
An affine transform in 2D is fully determined by the mapping of just three vertices. This function's API allows for passing a complete quadrilateral effectively making the prolem overdetermined. What this means in practice is, that for certain quadrilaterals it is not possible to find an affine transform that would map all four corners of the source ROI to the four vertices of that quadrilateral.
The function circumvents this problem by only looking at the first three vertices of the destination image quadrilateral to determine the affine transformation's coefficients. If the destination quadrilateral is indeed one that cannot be mapped using an affine transformation the functions informs the user of this situation by returning a NPP_AFFINE_QUAD_INCORRECT_WARNING.
oSrcROI | The source ROI. This rectangle needs to be at least one pixel wide and high. If either width or hight are less than one an NPP_RECTANGLE_ERROR is returned. |
aQuad | The destination quadrilateral. |
aCoeffs | The resulting affine transform coefficients. |