The OpenVX Specification  a73e458
Warp Perspective

Detailed Description

Performs a perspective transform on an image.

This kernel performs an perspective transform with a 3x3 Matrix \( M \) with this method of pixel coordinate translation [R00121]:

\begin{eqnarray} x0 &=& M_{1,1}*x + M_{1,2}*y + M_{1,3} \\ y0 &=& M_{2,1}*x + M_{2,2}*y + M_{2,3} \\ z0 &=& M_{3,1}*x + M_{3,2}*y + M_{3,3} \\ output(x,y) &=& input(\frac{x0}{z0},\frac{y0}{z0}) \end{eqnarray}

This translates into the C declaration:

// x0 = a x + b y + c;
// y0 = d x + e y + f;
// z0 = g x + h y + i;
vx_float32 mat[3][3] = {
{a, d, g}, // 'x' coefficients
{b, e, h}, // 'y' coefficients
{c, f, i}, // 'offsets'
};
vx_matrix matrix = vxCreateMatrix(context, VX_TYPE_FLOAT32, 3, 3);

Functions

vx_node VX_API_CALL vxWarpPerspectiveNode (vx_graph graph, vx_image input, vx_matrix matrix, vx_enum type, vx_image output)
 [Graph] Creates a Perspective Warp Node. More...
 

Function Documentation

◆ vxWarpPerspectiveNode()

vx_node VX_API_CALL vxWarpPerspectiveNode ( vx_graph  graph,
vx_image  input,
vx_matrix  matrix,
vx_enum  type,
vx_image  output 
)

[Graph] Creates a Perspective Warp Node.

Parameters
[in]graphThe reference to the graph [R00351].
[in]inputThe input VX_DF_IMAGE_U8 image [R00352].
[in]matrixThe perspective matrix. Must be 3x3 of type VX_TYPE_FLOAT32 [R00353].
[in]typeThe interpolation type from Interpolation Constants [R00354]. VX_INTERPOLATION_AREA is not supported.
[out]outputThe output VX_DF_IMAGE_U8 image [R00355].
Note
The border modes VX_NODE_BORDER value VX_BORDER_UNDEFINED and VX_BORDER_CONSTANT are supported.
Returns
vx_node [R00356].
Return values
vx_nodeA node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus