The OpenVX Specification  a73e458

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 [R00078]. Magnitude is computed as [R00079]:

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

The conceptual definition describing the overflow is given as [R00080]:

uint16 z = uint16( sqrt( double( uint32( int32(x) * int32(x) ) + uint32( int32(y) * int32(y) ) ) ) + 0.5);

int16 mag = z > 32767 ? 32767 : z;

Functions

vx_node VX_API_CALL vxMagnitudeNode (vx_graph graph, vx_image grad_x, vx_image grad_y, vx_image mag)
 [Graph] Create a Magnitude node. More...
 

Function Documentation

◆ vxMagnitudeNode()

vx_node VX_API_CALL 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 [R00178].
[in]grad_xThe input x image. This must be in VX_DF_IMAGE_S16 format [R00179].
[in]grad_yThe input y image. This must be in VX_DF_IMAGE_S16 format [R00180].
[out]magThe magnitude image. This is in VX_DF_IMAGE_S16 format [R00181].
See also
VX_KERNEL_MAGNITUDE
Returns
vx_node [R00182].
Return values
vx_nodeA node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus