|
|
VisionWorks Toolkit ReferenceApril 8, 2016 | 1.4 Release |
The Hough Lines primitive finds lines in a binary image using Hough transform.
The primitive uses the following identifiers:
vxGetKernelByEnum function;"com.nvidia.nvx.hough_lines" and "com.nvidia.nvx.hough_segments" for vxGetKernelByName function.The primitive has these two modes:
Standard—Standard Hough transform is explained here: [10]
Each line is represented by a two-element vector \( (\rho, \theta) \).
\( \rho \) is the distance from the coordinate origin. \( (0, 0) \) (top-left corner of the image).
\( \theta \) is the line rotation angle in radians. \( (0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}) \).
Probabilistic—Probabilistic Hough transform is described in [5].
Probabilistic Hough transform is more efficient if the picture contains a few long linear segments. It returns line segments rather than the whole line.
Each line is represented by a 4-element vector \( (x_1, y_1, x_2, y_2) \), where \( (x_1, y_1) \) and \( (x_2, y_2) \). are the ending points of each detected line segment.
Functions | |
| vx_node | nvxHoughLinesNode (vx_graph graph, vx_image input, vx_array output, vx_float32 rho, vx_float32 theta, vx_uint32 threshold, vx_scalar num_lines) |
| [Graph] Finds lines on image using standard Hough transform. More... | |
| vx_node | nvxHoughSegmentsNode (vx_graph graph, vx_image input, vx_array output, vx_float32 rho, vx_float32 theta, vx_uint32 threshold, vx_uint32 minLineLength, vx_uint32 maxLineGap, vx_scalar num_segments) |
| [Graph] Finds line segments in a binary image using the probabilistic Hough transform. More... | |
| vx_status | nvxuHoughLines (vx_context context, vx_image input, vx_array output, vx_float32 rho, vx_float32 theta, vx_uint32 threshold, vx_scalar num_lines) |
| [Immediate] Finds lines on image using standard Hough transform. More... | |
| vx_status | nvxuHoughSegments (vx_context context, vx_image input, vx_array output, vx_float32 rho, vx_float32 theta, vx_uint32 threshold, vx_uint32 minLineLength, vx_uint32 maxLineGap, vx_scalar num_segments) |
| [Immediate] Finds line segments in a binary image using the probabilistic Hough transform. More... | |
| vx_node nvxHoughLinesNode | ( | vx_graph | graph, |
| vx_image | input, | ||
| vx_array | output, | ||
| vx_float32 | rho, | ||
| vx_float32 | theta, | ||
| vx_uint32 | threshold, | ||
| vx_scalar | num_lines | ||
| ) |
[Graph] Finds lines on image using standard Hough transform.
| [in] | graph | Specifies the graph. |
| [in] | input | Specifies the input image. Only VX_DF_IMAGE_U8 format is supported. The image width and height must be less than \( 2^{16} \). |
| [out] | output | Specifies the output lines list. Only NVX_TYPE_POINT3F item type is supported. The array capacity must be explicitly provided, even for virtual arrays. |
| [in] | rho | Specifies the distance resolution of the accumulator in pixels. It must be a positive value. |
| [in] | theta | Specifies the angle resolution of the accumulator in radians. It must be in range \( (0, \pi] \). |
| [in] | threshold | Specifies the accumulator threshold parameter. Only lines that get enough votes (> threshold) are returned. |
| [out] | num_lines | Specifies the total number of detected lines in image (optional). It must be a VX_TYPE_UINT32 scalar. |
vxGetStatus).| vx_node nvxHoughSegmentsNode | ( | vx_graph | graph, |
| vx_image | input, | ||
| vx_array | output, | ||
| vx_float32 | rho, | ||
| vx_float32 | theta, | ||
| vx_uint32 | threshold, | ||
| vx_uint32 | minLineLength, | ||
| vx_uint32 | maxLineGap, | ||
| vx_scalar | num_segments | ||
| ) |
[Graph] Finds line segments in a binary image using the probabilistic Hough transform.
| [in] | graph | Specifies the graph. |
| [in] | input | Specifies the input image (8-bit grayscale). Only VX_DF_IMAGE_U8 format is supported. The image width and height must be less than \( 2^{16} \). |
| [out] | output | Specifies the output lines list. Only NVX_TYPE_POINT4F item type is supported. The array capacity must be explicitly provided, even for virtual arrays. |
| [in] | rho | Specifies the distance resolution of the accumulator in pixels. It must be a positive value. |
| [in] | theta | Specifies the angle resolution of the accumulator in radians. It must be in range \( (0, \pi] \). |
| [in] | threshold | Specifies the accumulator threshold parameter. Only lines that get enough votes (> threshold) are returned. |
| [in] | minLineLength | Specifies the minimum line length. Shorter segments are rejected. |
| [in] | maxLineGap | Specifies the maximum allowed gap between points on the same line to link them. |
| [out] | num_segments | Specifies the total number of detected segments in image (optional). It should be VX_TYPE_UINT32 scalar. |
vxGetStatus).| vx_status nvxuHoughLines | ( | vx_context | context, |
| vx_image | input, | ||
| vx_array | output, | ||
| vx_float32 | rho, | ||
| vx_float32 | theta, | ||
| vx_uint32 | threshold, | ||
| vx_scalar | num_lines | ||
| ) |
[Immediate] Finds lines on image using standard Hough transform.
| [in] | context | Specifies the context. |
| [in] | input | Specifies the input image (8-bit grayscale). Only VX_DF_IMAGE_U8 format is supported. The image width and height must be less than \( 2^{16} \). |
| [out] | output | Specifies the output lines list. Only NVX_TYPE_POINT3F item type is supported. The array capacity must be explicitly provided, even for virtual arrays. |
| [in] | rho | Specifies the distance resolution of the accumulator in pixels. It must be a positive value. |
| [in] | theta | Specifies the angle resolution of the accumulator in radians. It must be in range \( (0, \pi] \). |
| [in] | threshold | Specifies the accumulator threshold parameter. Only those lines are returned that get enough votes (> threshold). |
| [out] | num_lines | Specifies the total number of detected lines in image (optional). It should be VX_TYPE_UINT32 scalar. |
vx_status enumerator. | VX_SUCCESS | No errors. |
| VX_ERROR_INVALID_REFERENCE | Supplied parameters are not a valid references. |
| VX_ERROR_INVALID_PARAMETERS | Supplied parameters are not valid. |
| VX_ERROR_INVALID_SCOPE | Supplied parameters are virtual objects, that cannot be used in immediate mode. |
| VX_FAILURE | Internal error in primitive implementation; check the log for detailed information (Framework: Log). |
| vx_status nvxuHoughSegments | ( | vx_context | context, |
| vx_image | input, | ||
| vx_array | output, | ||
| vx_float32 | rho, | ||
| vx_float32 | theta, | ||
| vx_uint32 | threshold, | ||
| vx_uint32 | minLineLength, | ||
| vx_uint32 | maxLineGap, | ||
| vx_scalar | num_segments | ||
| ) |
[Immediate] Finds line segments in a binary image using the probabilistic Hough transform.
| [in] | context | Specifies the context. |
| [in] | input | Specifies the input image (8-bit grayscale). Only VX_DF_IMAGE_U8 format is supported. The image width and height must be less than \( 2^{16} \). |
| [out] | output | Specifies the output lines list. Only NVX_TYPE_POINT4F item type is supported. The array capacity must be explicitly provided, even for virtual arrays. |
| [in] | rho | Specifies the distance resolution of the accumulator in pixels. It must be a positive value. |
| [in] | theta | Specifies the angle resolution of the accumulator in radians. It must be in range \( (0, \pi] \). |
| [in] | threshold | Specifies the accumulator threshold parameter. Only lines that get enough votes (> threshold) are returned. |
| [in] | minLineLength | Specifies the minimum line length. Shorter segments are rejected. |
| [in] | maxLineGap | Specifies the maximum allowed gap between points on the same line to link them. |
| [out] | num_segments | Specifies the total number of detected segments in image (optional). It should be VX_TYPE_UINT32 scalar. |
vx_status enumerator. | VX_SUCCESS | No errors. |
| VX_ERROR_INVALID_REFERENCE | Supplied parameters are not a valid references. |
| VX_ERROR_INVALID_PARAMETERS | Supplied parameters are not valid. |
| VX_ERROR_INVALID_SCOPE | Supplied parameters are virtual objects, that cannot be used in immediate mode. |
| VX_FAILURE | Internal error in primitive implementation, check log for detailed information (Framework: Log). |