The OpenVX Specification
dba1aa3
|
Computes the absolute difference between two images. The output image dimensions should be the same as the dimensions of the input images.
Absolute Difference is computed by:
\[ out(x,y) = |in_1(x,y) - in_2(x,y)| \]
If one of the input images is of type VX_DF_IMAGE_S16
, all values are converted to vx_int32
and the overflow policy VX_CONVERT_POLICY_SATURATE
is used.
\[ out(x,y) = saturate_{int16} ( |(int32)in_1(x,y) - (int32)in_2(x,y)| ) \]
The output image can be VX_DF_IMAGE_U8
only if both source images are VX_DF_IMAGE_U8
and the output image is explicitly set to VX_DF_IMAGE_U8
. It is otherwise VX_DF_IMAGE_S16
.
Functions | |
vx_node VX_API_CALL | vxAbsDiffNode (vx_graph graph, vx_image in1, vx_image in2, vx_image out) |
[Graph] Creates an AbsDiff node. More... | |
vx_status VX_API_CALL | vxuAbsDiff (vx_context context, vx_image in1, vx_image in2, vx_image out) |
[Immediate] Computes the absolute difference between two images. More... | |
[Graph] Creates an AbsDiff node.
[in] | graph | The reference to the graph. |
[in] | in1 | An input image in VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 format. |
[in] | in2 | An input image in VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 format. |
[out] | out | The output image in VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 format, which must have the same dimensions as the input image. |
vx_node | A node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus |
vx_status VX_API_CALL vxuAbsDiff | ( | vx_context | context, |
vx_image | in1, | ||
vx_image | in2, | ||
vx_image | out | ||
) |
[Immediate] Computes the absolute difference between two images.
[in] | context | The reference to the overall context. |
[in] | in1 | An input image in VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 format. |
[in] | in2 | An input image in VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 format. |
[out] | out | The output image in VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 format. |
vx_status_e
enumeration. VX_SUCCESS | Success |
* | An error occurred. See vx_status_e . |