![]() |
VisionWorks Toolkit ReferenceDecember 18, 2015 | 1.2 Release |
The Harris Track Primitive.
This primitive detects and tracks Harris corners for the input image.
The primitive uses the following identifiers:
vxGetKernelByEnum
function;"com.nvidia.nvx.harris_track"
for vxGetKernelByName
function.For each pixel the primitive calculates a gradient covariance matrix over a \( blockSize \times blockSize \) neighborhood:
\begin{eqnarray} G &=& \frac{blockSize}{2} \\ A(y, x) &=& \sum\limits_{v=-G}^G \sum\limits_{u=-G}^G (f_x(y + v, x + u))^2 \cdot w(v, u) \\ B(y, x) &=& \sum\limits_{v=-G}^G \sum\limits_{u=-G}^G (f_y(y + v, x + u))^2 \cdot w(v, u) \\ C(y, x) &=& \sum\limits_{v=-G}^G \sum\limits_{u=-G}^G f_x(y + v, x + u) \cdot f_y(y + v, x + u) \cdot w(v, u) \end{eqnarray}
Then, it computes the following characteristic:
\begin{eqnarray} trace(M(y, x)) &=& A(y, x) + B(y, x) \\ det(M(y, x)) &=& A(y, x) \cdot B(y, x) - C(y, x)^2 \\ H(y, x) &=& det(M(y, x)) - k \cdot trace(M(y, x))^2 \end{eqnarray}
A candidate pixel is classified as a corner, if its \( H(y, x) \) characteristic is greater than the specified threshold.
Optionally, a binary mask can be provided to filter out corners from specified regions. The primitive only leaves points with a non-zero mask value.
This primitive applies a cell-based, non-max suppression step on all detected corners to remove multiple or spurious responses.
The input image is split into cells (cell size is a primitive's parameter), and for each cell the corner with the highest strength is selected. If there are several corners with the same strength the bottom-most right corner is chosen.
Additionally, this primitive can be used in the tracking scenario. It accepts an optional tracked features list from optical flow. The primitive extracts corners only for those cells that do not contain any tracked points.
The primitive applies cell-based, non-max suppressions for input tracked points, too, so only non-lost points with the highest strength are left per cell.
Functions | |
vx_node | nvxHarrisTrackNode (vx_graph graph, vx_image input, vx_array output, vx_image mask, vx_array tracked_points, vx_float32 k, vx_float32 threshold, vx_uint32 cell_size, vx_scalar num_corners) |
[Graph] Detects and tracks Harris corners for the input image. More... | |
vx_status | nvxuHarrisTrack (vx_context context, vx_image input, vx_array output, vx_image mask, vx_array tracked_points, vx_float32 k, vx_float32 threshold, vx_uint32 cell_size, vx_scalar num_corners) |
[Immediate] Detects and tracks Harris corners for the input image. More... | |
vx_node nvxHarrisTrackNode | ( | vx_graph | graph, |
vx_image | input, | ||
vx_array | output, | ||
vx_image | mask, | ||
vx_array | tracked_points, | ||
vx_float32 | k, | ||
vx_float32 | threshold, | ||
vx_uint32 | cell_size, | ||
vx_scalar | num_corners | ||
) |
[Graph] Detects and tracks Harris corners for the input image.
[in] | graph | Specifies the graph. |
[in] | input | Specifies the input image. Only VX_DF_IMAGE_U8 format is supported. The image size must be not greater than \( 2^{32} \) pixels. |
[out] | output | Specifies the output list of corners. Only VX_TYPE_KEYPOINT , NVX_TYPE_KEYPOINTF and NVX_TYPE_POINT2F item types are supported. The array capacity must be explicitly provided, even for virtual arrays. |
[in] | mask | Specifies the optional mask. Only VX_DF_IMAGE_U8 format is supported. The mask should have the same size as input image. |
[in] | tracked_points | Specifies the optional tracked features list. If specified, it should have the same item type as output array. |
[in] | k | Specifies the Harris K parameter. The value of k has to be determined empirically, and in the literature values in the range \( [0.04, 0.15] \) have been reported as feasible. |
[in] | threshold | Specifies the Harris threshold. |
[in] | cell_size | Specifies the size of cells for cell-based non-max suppression. The cell_size should be less than input image dimensions. |
[out] | num_corners | Specifies the total number of detected corners in image (optional). It should be VX_TYPE_SIZE scalar. |
vxGetStatus
). vx_status nvxuHarrisTrack | ( | vx_context | context, |
vx_image | input, | ||
vx_array | output, | ||
vx_image | mask, | ||
vx_array | tracked_points, | ||
vx_float32 | k, | ||
vx_float32 | threshold, | ||
vx_uint32 | cell_size, | ||
vx_scalar | num_corners | ||
) |
[Immediate] Detects and tracks Harris corners for the input image.
[in] | context | Specifies the context. |
[in] | input | Specifies the input image. Only VX_DF_IMAGE_U8 format is supported. The image size must be not greater than \( 2^{32} \) pixels. |
[out] | output | Specifies the output list of corners. Only VX_TYPE_KEYPOINT , NVX_TYPE_KEYPOINTF and NVX_TYPE_POINT2F item types are supported. The array capacity must be explicitly provided, even for virtual arrays. |
[in] | mask | Specifies the optional mask. Only VX_DF_IMAGE_U8 format is supported. The mask should have the same size as input image. |
[in] | tracked_points | Specifies the optional tracked features list. If specified, it should have the same item type as output array. |
[in] | k | Specifies the Harris K parameter. The value of k has to be determined empirically, and in the literature values in the range \( [0.04, 0.15] \) have been reported as feasible. |
[in] | threshold | Specifies the Harris threshold. |
[in] | cell_size | Specifies the size of cells for cell-based non-max suppression. The cell_size should be less than input image dimensions. |
[out] | num_corners | Specifies the total number of detected corners in image (optional). It should be VX_TYPE_SIZE 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, which can't be used in immediate mode. |
VX_FAILURE | Internal error in primitive implementation, check log for detailed information (Framework: Log). |