VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Detailed Description

The FAST Track Primitive.

This primitive detects and tracks corners using the FAST algorithm.

The primitive uses the following identifiers:

Segment Test Detector

The FAST corner detector uses the pixels on a Bresenham circle to classify whether a candidate point \( p \) is actually a corner.

Given the following definitions:

The two conditions for FAST corner detection can be expressed as:

So when either of these two conditions is met, the candidate \( p \) is classified as a corner.

Optionally, a binary mask can be provided to filter out corners from specified regions. The primitive will only leave points with a non-zero mask value.

Corner Strength Computation

Once a corner has been detected, its strength (response, saliency or score) is computed. The corner response \( C_p \) function is defined as the largest threshold \( t \) for which the pixel \( p \) remains a corner.

Cell-based Non-max Suppression

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 highest strength is selected. If there are several corners with the same strength the bottom-most right corner is chosen.

Tracking

Additionally, the primitive can be used in tracking scenarios. 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.

See also
[7] and [9] for a description of the algorithm.

Example Code

Detection scenario
vx_uint32 type = 9;
vx_uint32 threshold = 30;
vx_uint32 cell_size = 18;
vx_array corners = vxCreateArray(context, VX_TYPE_KEYPOINT, 3000);
nvxuFastTrack(context, src, corners, NULL, NULL, type, threshold, cell_size, NULL);
Tracking scenario
vx_uint32 type = 9;
vx_uint32 threshold = 30;
vx_uint32 cell_size = 18;
vx_pyramid pyr_exemplar = vxCreatePyramid(context, pyr_levels, VX_SCALE_PYRAMID_HALF, width, height, VX_DF_IMAGE_U8);
vx_delay pyr_delay = vxCreateDelay(context, (vx_reference)pyr_exemplar, 2);
vxReleasePyramid(&pyr_exemplar);
vx_array tracked_points = vxCreateArray(context, NVX_TYPE_POINT2F, 3000);
vx_delay pts_delay = vxCreateDelay(context, (vx_reference)tracked_points, 2);
// Build pyramid for current image
vx_node pyr_node = vxGaussianPyramidNode(graph,
src,
// Calculate optical flow between current and previous images
vx_node opt_flow_node = vxOpticalFlowPyrLKNode(graph,
tracked_points, VX_TERM_CRITERIA_BOTH, lk_epsilon, lk_num_iters, lk_use_init_est, lk_win_size);
// Update lost points
vx_node fast_track_node = nvxFastTrackNode(graph, src,
mask, tracked_points,
type, threshold, cell_size,
NULL);
vxReleaseNode(&pyr_node);
vxReleaseNode(&opt_flow_node);
vxReleaseNode(&fast_track_node);
vxAgeDelay(pyr_delay);
vxAgeDelay(pts_delay);

Functions

vx_node nvxFastTrackNode (vx_graph graph, vx_image input, vx_array output, vx_image mask, vx_array tracked_points, vx_uint32 type, vx_uint32 threshold, vx_uint32 cell_size, vx_scalar num_corners)
 [Graph] Detects and tracks corners using the FAST algorithm. More...
 
vx_status nvxuFastTrack (vx_context context, vx_image input, vx_array output, vx_image mask, vx_array tracked_points, vx_uint32 type, vx_uint32 threshold, vx_uint32 cell_size, vx_scalar num_corners)
 [Immediate] Detects and tracks corners using the FAST algorithm. More...
 

Function Documentation

vx_node nvxFastTrackNode ( vx_graph  graph,
vx_image  input,
vx_array  output,
vx_image  mask,
vx_array  tracked_points,
vx_uint32  type,
vx_uint32  threshold,
vx_uint32  cell_size,
vx_scalar  num_corners 
)

[Graph] Detects and tracks corners using the FAST algorithm.

Parameters
[in]graphSpecifies the graph.
[in]inputSpecifies the input image. Only VX_DF_IMAGE_U8 format is supported. The image size must be not greater than \( 2^{32} \) pixels.
[out]outputSpecifies 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]maskSpecifies the optional mask. Only VX_DF_IMAGE_U8 format is supported. The mask should have the same size as input image.
[in]tracked_pointsSpecifies the optional tracked features list. If specified, it should have the same item type as output array.
[in]typeSpecifies the number of neighborhoods to test. Supported values : 9, 10, 11, 12.
[in]thresholdSpecifies the threshold on difference between intensity of the central pixel and pixels of a circle around this pixel. The threshold value should be less than 255.
[in]cell_sizeSpecifies the size of cells for cell-based non-max suppression. The cell_size should be less than input image dimensions.
[out]num_cornersSpecifies the total number of detected corners in image (optional). It should be VX_TYPE_SIZE scalar.
Returns
A valid node reference or an error object (use vxGetStatus).
vx_status nvxuFastTrack ( vx_context  context,
vx_image  input,
vx_array  output,
vx_image  mask,
vx_array  tracked_points,
vx_uint32  type,
vx_uint32  threshold,
vx_uint32  cell_size,
vx_scalar  num_corners 
)

[Immediate] Detects and tracks corners using the FAST algorithm.

Parameters
[in]contextSpecifies the context.
[in]inputSpecifies the input image. Only VX_DF_IMAGE_U8 format is supported. The image size must be not greater than \( 2^{32} \) pixels.
[out]outputSpecifies 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]maskSpecifies the optional mask. Only VX_DF_IMAGE_U8 format is supported. The mask should have the same size as input image.
[in]tracked_pointsSpecifies the optional tracked features list. If specified, it should have the same item type as output array.
[in]typeSpecifies the number of neighborhoods to test. Supported values : 9, 10, 11, 12.
[in]thresholdSpecifies the threshold on difference between intensity of the central pixel and pixels of a circle around this pixel. The threshold value should be less than 255.
[in]cell_sizeSpecifies the size of cells for cell-based non-max suppression. The cell_size should be less than input image dimensions.
[out]num_cornersSpecifies the total number of detected corners in image (optional). It should be VX_TYPE_SIZE scalar.
Returns
A vx_status enumerator.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCESupplied parameters are not a valid references.
VX_ERROR_INVALID_PARAMETERSSupplied parameters are not valid.
VX_ERROR_INVALID_SCOPESupplied parameters are virtual objects, which can't be used in immediate mode.
VX_FAILUREInternal error in primitive implementation, check log for detailed information (Framework: Log).