The OpenVX Specification  r28647
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Detailed Description

Implements the Gradient Magnitude Computation Kernel.

This kernel takes two gradients in VX_DF_IMAGE_S16 format and computes the VX_DF_IMAGE_S16 normalized magnitude. Magnitude is computed as:

\[ mag(x,y) = \sqrt{grad_x(x,y)^2 + grad_y(x,y)^2} \]

The conceptual definition describing the overflow is given as: uint16 z = uint16( sqrt( double( uint32( int32(x) * int32(x) ) + uint32( int32(y) * int32(y) ) ) ) ); int16 r = z > 32767 ? 32767 : z;

Functions

vx_node vxMagnitudeNode (vx_graph graph, vx_image grad_x, vx_image grad_y, vx_image mag)
 [Graph] Create a Magnitude node. More...
 
vx_status vxuMagnitude (vx_context context, vx_image grad_x, vx_image grad_y, vx_image output)
 [Immediate] Invokes an immediate Magnitude. More...
 

Function Documentation

vx_node vxMagnitudeNode ( vx_graph  graph,
vx_image  grad_x,
vx_image  grad_y,
vx_image  mag 
)

[Graph] Create a Magnitude node.

Parameters
[in]graphThe reference to the graph.
[in]grad_xThe input x image. This must be in VX_DF_IMAGE_S16 format.
[in]grad_yThe input y image. This must be in VX_DF_IMAGE_S16 format.
[out]magThe magnitude image. This is in VX_DF_IMAGE_S16 format.
See also
VX_KERNEL_MAGNITUDE
Returns
vx_node.
Return values
0Node could not be created.
*Node handle.
vx_status vxuMagnitude ( vx_context  context,
vx_image  grad_x,
vx_image  grad_y,
vx_image  output 
)

[Immediate] Invokes an immediate Magnitude.

Parameters
[in]contextThe reference to the overall context.
[in]grad_xThe input x image. This must be in VX_DF_IMAGE_S16 format.
[in]grad_yThe input y image. This must be in VX_DF_IMAGE_S16 format.
[out]outputThe magnitude image. This will be in VX_DF_IMAGE_S16 format.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSSuccess
*An error occurred. See vx_status_e.