The OpenVX Specification
dba1aa3
|
Provides a Canny edge detector kernel. The output image dimensions should be the same as the dimensions of the input image.
This function implements an edge detection algorithm similar to that described in [2]. The main components of the algorithm are:
The details of each of these steps are described below.
VX_NORM_L1
or \( \sqrt{dx^{2} + dy^{2}} \) for VX_NORM_L2
. The gradient orientation image is quantized into 4 values: 0, 45, 90, and 135 degrees. \[ \mathbf{sobel}_{x}= \begin{vmatrix} -1 & 0 & 1\\ -2 & 0 & 2\\ -1 & 0 & 1 \end{vmatrix} \]
\[ \mathbf{sobel}_{y}=transpose({sobel}_{x})= \begin{vmatrix} -1 & -2 & -1\\ 0 & 0 & 0\\ 1 & 2 & 1 \end{vmatrix} \]
\[ \mathbf{sobel}_{x}= \begin{vmatrix} -1 & -2 & 0 & 2 & 1\\ -4 & -8 & 0 & 8 & 4\\ -6 & -12 & 0 & 12 & 6\\ -4 & -8 & 0 & 8 & 4\\ -1 & -2 & 0 & 2 & 1\\ \end{vmatrix} \]
\[ \mathbf{sobel}_{y}=transpose({sobel}_{x}) \]
\[ \mathbf{sobel}_{x}= \begin{vmatrix} -1 & -4 & -5 & 0 & 5 & 4 & 1\\ -6 & -24 & -30 & 0 & 30 & 24 & 6\\ -15 & -60 & -75 & 0 & 75 & 60 & 15\\ -20 & -80 & -100 & 0 & 100 & 80 & 20\\ -15 & -60 & -75 & 0 & 75 & 60 & 15\\ -6 & -24 & -30 & 0 & 30 & 24 & 6\\ -1 & -4 & -5 & 0 & 5 & 4 & 1\\ \end{vmatrix} \]
\[ \mathbf{sobel}_{y}=transpose({sobel}_{x}) \]
Enumerations | |
enum | vx_norm_type_e { VX_NORM_L1 = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_NORM_TYPE << 12)) + 0x0, VX_NORM_L2 = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_NORM_TYPE << 12)) + 0x1 } |
A normalization type. More... | |
Functions | |
vx_node VX_API_CALL | vxCannyEdgeDetectorNode (vx_graph graph, vx_image input, vx_threshold hyst, vx_int32 gradient_size, vx_enum norm_type, vx_image output) |
[Graph] Creates a Canny Edge Detection Node. More... | |
vx_status VX_API_CALL | vxuCannyEdgeDetector (vx_context context, vx_image input, vx_threshold hyst, vx_int32 gradient_size, vx_enum norm_type, vx_image output) |
[Immediate] Computes Canny Edges on the input image into the output image. More... | |
enum vx_norm_type_e |
A normalization type.
Enumerator | |
---|---|
VX_NORM_L1 |
The L1 normalization. |
VX_NORM_L2 |
The L2 normalization. |
Definition at line 1378 of file vx_types.h.
vx_node VX_API_CALL vxCannyEdgeDetectorNode | ( | vx_graph | graph, |
vx_image | input, | ||
vx_threshold | hyst, | ||
vx_int32 | gradient_size, | ||
vx_enum | norm_type, | ||
vx_image | output | ||
) |
[Graph] Creates a Canny Edge Detection Node.
[in] | graph | The reference to the graph. |
[in] | input | The input VX_DF_IMAGE_U8 image. |
[in] | hyst | The double threshold for hysteresis. The VX_THRESHOLD_INPUT_FORMAT shall be either VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 . The VX_THRESHOLD_OUTPUT_FORMAT is ignored. |
[in] | gradient_size | The size of the Sobel filter window, must support at least 3, 5, and 7. |
[in] | norm_type | A flag indicating the norm used to compute the gradient, VX_NORM_L1 or VX_NORM_L2 . |
[out] | output | The output image in VX_DF_IMAGE_U8 format with values either 0 or 255. |
vx_node
. vx_node | A node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus |
vx_status VX_API_CALL vxuCannyEdgeDetector | ( | vx_context | context, |
vx_image | input, | ||
vx_threshold | hyst, | ||
vx_int32 | gradient_size, | ||
vx_enum | norm_type, | ||
vx_image | output | ||
) |
[Immediate] Computes Canny Edges on the input image into the output image.
[in] | context | The reference to the overall context. |
[in] | input | The input VX_DF_IMAGE_U8 image. |
[in] | hyst | The double threshold for hysteresis. The VX_THRESHOLD_INPUT_FORMAT shall be either VX_DF_IMAGE_U8 or VX_DF_IMAGE_S16 . The VX_THRESHOLD_OUTPUT_FORMAT is ignored. |
[in] | gradient_size | The size of the Sobel filter window, must support at least 3, 5 and 7. |
[in] | norm_type | A flag indicating the norm used to compute the gradient, VX_NORM_L1 or VX_NORM_L2 . |
[out] | output | The output image in VX_DF_IMAGE_U8 format with values either 0 or 255. |
vx_status_e
enumeration. VX_SUCCESS | Success |
* | An error occurred. See vx_status_e . |