@@ -167,6 +167,8 @@ RunVX is a command line tool used to execute OpenVX graphs. As input, RUNVX take
167167 virtual data object won't be available after graph reset.
168168 graph launch [<graphName(s)>]
169169 Launch the default or specified graph(s).
170+ graph info [<graphName(s)>]
171+ Show graph details for debug.
170172
171173 init <dataName> <initial-value>
172174 Initialize data object with specified value.
@@ -361,3 +363,82 @@ File **skintonedetect.gdf**:
361363 node org.khronos.openvx.and and1 B20 and2 # compute B20 & and1
362364 node org.khronos.openvx.and RmG15 RmB0 and3 # compute RmG15 & RmB0
363365 node org.khronos.openvx.and and2 and3 output # compute and2 & and3 as output
366+
367+ ### Feature Tracker
368+ The feature tracker example demonstrates building an application with two
369+ separate graphs that uses Harris Corners and Optical Flow kernels.
370+ This example requires use of delay data objects that contain
371+ multiple pyramid and array objects.
372+ Use [ PETS09-S1-L1-View001.avi] ( http://ewh.ieee.org/r6/scv/sps/openvx-material/PETS09-S1-L1-View001.avi ) as input video sequence.
373+
374+ % runvx[.exe] file feature_tracker.gdf
375+
376+ File ** feature_tracker.gdf** :
377+
378+ # create image object for the input video sequence.
379+ data input = image:768,576,RGB2
380+ read input PETS09-S1-L1-View001.avi
381+
382+ # create output keypoint array objects inside a delay object with two slots.
383+ # two slots are needed to keep track current keypoints from previous time.
384+ data exemplarArr = array:KEYPOINT,10000 # max trackable keypoints are 10,000
385+ data delayArr = delay:exemplarArr,2 # two slots inside the delay object
386+
387+ # request for displaying input with keypoints from delay slot[0].
388+ view input feature_tracker
389+ view delayArr feature_tracker
390+
391+ # create pyramid objects inside a delay object with two slots.
392+ # two slots of pyramids are needed for optical flow kernel.
393+ data exemplarPyr = pyramid:6,half,768,576,U008
394+ data delayPyr = delay:exemplarPyr,2
395+
396+ # create first graph to initialize keypoints using Harris Corners and
397+ # compute pyramid for by Optical Flow later using another graph
398+ data iyuv = image-virtual:0,0,IYUV
399+ data luma = image-virtual:0,0,U008
400+ data strength_thresh = scalar:FLOAT32,0.0005
401+ data min_distance = scalar:FLOAT32,5.0
402+ data sensitivity = scalar:FLOAT32,0.04
403+ data grad_size = scalar:INT32,3
404+ data block_size = scalar:INT32,3
405+ node org.khronos.openvx.color_convert input iyuv
406+ node org.khronos.openvx.channel_extract iyuv !CHANNEL_Y luma
407+ node org.khronos.openvx.harris_corners luma strength_thresh min_distance sensitivity \
408+ grad_size block_size delayArr[0] null
409+ node org.khronos.openvx.gaussian_pyramid luma delayPyr[0]
410+
411+ # request vxAgeDelay call for delay objects after each frame with
412+ # current graph and save current graph with the name "harris"
413+ graph auto-age delayPyr delayArr
414+ graph save-and-reset harris
415+
416+ # create second graph to track keypoints using Optical Flow assuming that
417+ # pyramid/keypoints in delay objects have been initialized with previous frame
418+ data iyuv = image-virtual:0,0,IYUV
419+ data luma = image-virtual:0,0,U008
420+ data termination = scalar:ENUM,CRITERIA_BOTH
421+ data epsilon = scalar:FLOAT32,0.01
422+ data num_iterations = scalar:UINT32,5
423+ data use_initial_estimate = scalar:BOOL,0
424+ data window_dimension = scalar:SIZE,6
425+ node org.khronos.openvx.color_convert input iyuv
426+ node org.khronos.openvx.channel_extract iyuv !CHANNEL_Y luma
427+ node org.khronos.openvx.gaussian_pyramid luma delayPyr[0]
428+ node org.khronos.openvx.optical_flow_pyr_lk delayPyr[-1] delayPyr[0] \
429+ delayArr[-1] delayArr[-1] delayArr[0] \
430+ termination epsilon num_iterations \
431+ use_initial_estimate window_dimension
432+
433+ # request vxAgeDelay call for delay objects after each frame with
434+ # current graph and save current graph with the name "opticalflow"
435+ graph auto-age delayPyr delayArr
436+ graph save-and-reset opticalflow
437+
438+ # launch "harris" graph to process first frame in the video sequence
439+ set frames 1
440+ graph launch harris
441+
442+ # launch "opticalflow" graph to process remaining frames in the video sequence
443+ set frames default
444+ graph launch opticalflow
0 commit comments