The OpenVX Specification
r28647
|
Convolves the input with the client supplied convolution matrix.
The client can supply a vx_int16 typed convolution matrix \( C_{m,n} \). Outputs will be in the VX_DF_IMAGE_S16
format unless a VX_DF_IMAGE_U8
image is explicitly provided. If values would have been out of range of U8 for VX_DF_IMAGE_U8
, the values are clamped to 0 or 255.
\begin{eqnarray} k_0 &=& \frac{m}{2} \\ l_0 &=& \frac{n}{2} \\ sum &=& \sum_{k=0,l=0}^{k=m-1,l=n-1} input(x+k_0-k, y+l_0-l) C_{k,l} \end{eqnarray}
This translates into the C declaration:
For VX_DF_IMAGE_U8
output, an additional step is taken:
\[ output(x,y) = \begin{cases} \cr 0 & \text{if } sum < 0 \cr 255 & \text{if } sum / scale > 255 \cr sum / scale & \text{otherwise} \end{cases} \]
For VX_DF_IMAGE_S16
output, the summation is simply set to the output
\[ output(x,y) = sum / scale \]
The overflow policy used is VX_CONVERT_POLICY_SATURATE
.
Functions | |
vx_node | vxConvolveNode (vx_graph graph, vx_image input, vx_convolution conv, vx_image output) |
[Graph] Creates a custom convolution node. More... | |
vx_status | vxuConvolve (vx_context context, vx_image input, vx_convolution matrix, vx_image output) |
[Immediate] Computes a convolution on the input image with the supplied matrix. More... | |
vx_node vxConvolveNode | ( | vx_graph | graph, |
vx_image | input, | ||
vx_convolution | conv, | ||
vx_image | output | ||
) |
[Graph] Creates a custom convolution node.
[in] | graph | The reference to the graph. |
[in] | input | The input image in VX_DF_IMAGE_U8 format. |
[in] | conv | The vx_int16 convolution matrix. |
[out] | output | The output image in VX_DF_IMAGE_S16 format. |
vx_node
. 0 | Node could not be created. |
* | Node handle. |
vx_status vxuConvolve | ( | vx_context | context, |
vx_image | input, | ||
vx_convolution | matrix, | ||
vx_image | output | ||
) |
[Immediate] Computes a convolution on the input image with the supplied matrix.
[in] | context | The reference to the overall context. |
[in] | input | The input image in VX_DF_IMAGE_U8 format. |
[in] | matrix | The convolution matrix. |
[out] | output | The output image in VX_DF_IMAGE_S16 format. |
vx_status_e
enumeration. VX_SUCCESS | Success |
* | An error occurred. See vx_status_e . |