VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

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

This section illustrates the usage of user custom nodes.

The user custom nodes can be created and used along with VisionWorks standard nodes in graphs:

registerKeypointArraySortKernel(context);
vx_image image = vxCreateImage(context, 640, 480, VX_DF_IMAGE_U8);
vx_array tmp_keypoints = vxCreateArray(context, VX_TYPE_KEYPOINT, 1000);
vx_array final_keypoints = vxCreateArray(context, VX_TYPE_KEYPOINT, 1000);
vx_float32 fast_strength_threshold = 50.0f;
vx_scalar fast_strength_threshold_scalar = vxCreateScalar(context, VX_TYPE_FLOAT32, &fast_strength_threshold);
vx_bool use_strength = vx_true_e;
vx_scalar use_strength_scalar = vxCreateScalar(context, VX_TYPE_BOOL, &use_strength);
vx_graph graph = vxCreateGraph(context);
vx_node detector_node = vxFastCornersNode(graph, image, fast_strength_threshold_scalar, vx_true_e, tmp_keypoints, NULL);
vx_node sort_node = keypointArraySortNode(graph, tmp_keypoints, final_keypoints, use_strength_scalar);
vxVerifyGraph(graph);
vxReleaseNode(&detector_node);
vxReleaseNode(&sort_node);
vxReleaseGraph(&graph);
vxReleaseScalar(&fast_strength_threshold_scalar);
vxReleaseScalar(&use_strength_scalar);
vxReleaseImage(&image);
vxReleaseArray(&final_keypoints);
vxReleaseContext(&context);