The OpenVX Specification
dba1aa3
|
Implements the Gradient Magnitude Computation Kernel. The output image dimensions should be the same as the dimensions of the input images.
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) ) ) ) + 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... | |
vx_status VX_API_CALL | vxuMagnitude (vx_context context, vx_image grad_x, vx_image grad_y, vx_image mag) |
[Immediate] Invokes an immediate Magnitude. More... | |
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.
[in] | graph | The reference to the graph. |
[in] | grad_x | The input x image. This must be in VX_DF_IMAGE_S16 format. |
[in] | grad_y | The input y image. This must be in VX_DF_IMAGE_S16 format. |
[out] | mag | The magnitude image. This is in VX_DF_IMAGE_S16 format. Must have the same dimensions as the input image. |
VX_KERNEL_MAGNITUDE
vx_node
. vx_node | A node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus |
vx_status VX_API_CALL vxuMagnitude | ( | vx_context | context, |
vx_image | grad_x, | ||
vx_image | grad_y, | ||
vx_image | mag | ||
) |
[Immediate] Invokes an immediate Magnitude.
[in] | context | The reference to the overall context. |
[in] | grad_x | The input x image. This must be in VX_DF_IMAGE_S16 format. |
[in] | grad_y | The input y image. This must be in VX_DF_IMAGE_S16 format. |
[out] | mag | The magnitude image. This will be in VX_DF_IMAGE_S16 format. |
vx_status_e
enumeration. VX_SUCCESS | Success |
* | An error occurred. See vx_status_e . |