VisionWorks Toolkit Reference

April 8, 2016 | 1.4 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
stable/feature_tracker/feature_tracker_user_guide.md
Go to the documentation of this file.
1 <!-- Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. -->
2 
3 @defgroup nvx_demo_feature_tracker Feature Tracker Demo App
4 @brief Feature Tracker Demo user guide.
5 @ingroup nvx_demos
6 @{
7 
8 <a name="Introduction">
9 
10 ## Introduction ##
11 
12 `nvx_demo_feature_tracker` is a simple local feature tracking demo that
13 uses the Harris or FAST feature detector to get the initial list of features and
14 tracks them using the sparse pyramidal optical flow method (Lucas-Kanade).
15 
16 In the first frame, Gaussian pyramid is created and initial points are detected
17 so that the features can be found quickly at low resolution and can also be located
18 more accurately as you go down the pyramid.
19 
20 The initial points are detected using Harris Corner detector.
21 The NVIDIA extended Harris and FAST Corner functions divide the image into cells
22 of the same size and look for corners independently in each cell. This way,
23 corners are uniformly detected across the image. These corners are the keypoints
24 that are tracked in the next frames.
25 
26  (frame)
27  |
28  [ColorConvert]
29  |
30  +-------------------+-------------------+
31  | |
32  [GaussianPyramid] [CornerTrack]
33  | |
34  (initial pyramid) (initial points)
35 
36 
37 
38 In subsequent frames, points are tracked with the Lucas-Kanade method between two pyramid images.
39 Then, corner detection is performed to restore lost points.
40 
41  (frame)
42  |
43  [ColorConvert]
44  |
45  [ChannelExtract]
46  |
47  [GaussianPyramid]
48  |
49  (previous pyramid) (current pyramid) (points to track in the previous frame)
50  | | |
51  +------------------------------+--------------------------------------+
52  |
53  [OpticalFlowPyrLK]
54  |
55  (tracked points)
56  |
57  [CornerTrack]
58  |
59  (points to track in the next frame)
60 
61 
62 @note In the figure above, the entities inside () denote data and the entities
63 inside [] denote the vision functions.
64 
65 @note Current implementation of Harris and FAST corner detectors supports input
66 frames only with total number of pixels less than \f$2^{32}\f$.
67 
68 ## Installation and Usage ##
69 
70 `nvx_demo_feature_tracker` is installed in the following directory:
71 
72  /usr/share/visionworks/sources/demos/feature_tracker
73 
74 For the steps to build sample applications, see the @ref nvx_samples_and_demos_user_guides
75 section for your OS.
76 
77 <a name="Executing">
78 ## Executing the Feature Tracker Demo ##
79 
80  ./nvx_demo_feature_tracker [options]
81 
82 ### Command Line Options ###
83 
84 This topic provides a list of supported options and the values they consume.
85 
86 #### \-s, \--source ####
87 - Parameter: [inputUri]
88 - Description: Specifies the input URI. Accepted parameters include a video,
89 an image, an image sequence (in .png, .jpg, .jpeg, .bmp, or .tiff format),
90 or camera.
91 - Usage:
92 
93  - `--source=/path/to/video.avi` for video
94  - `--source=/path/to/image.png` for image
95  - `--source=/path/to/image_%04d_sequence.png` for image sequence
96  - `--source="device:///v4l2?index=0"` for the first V4L2 camera
97  - `--source="device:///v4l2?index=1"` for the second V4L2 camera.
98  - `--source="device:///nvcamera?index=0"` for the GStreamer NVIDIA camera (Jetson TX1 only).
99  - `--source="device:///nvmedia?config=dvp-ov10635-yuv422-ab-e2379&number=4"` for the GStreamer NVIDIA camera (Vibrante for Linux only).
100 
101 @note The V4L platform has a permissions issue. The hardware decoder is used and
102 the sample must be executed with super user permissions, i.e., with `sudo`.
103 
104 
105 #### \-c, \--config ####
106 - Parameter: [Config file path]
107 - Description: Specifies the path to the configuration file. The file contains the
108  parameters of the algorithm stored in key=value format.
109 
110  This file contains the following parameters:
111 
112  - **pyr_levels**
113  - Parameter: [integer value greater than or equal to 1 and less than or
114  equal to 8]
115  - Description: The number of levels in Gaussian pyramid. Default is 6.
116 
117  - **lk_num_iters**
118  - Parameter: [integer value greater than or equal to 1 and less than or
119  equal to 100]
120  - Description: The number of iterations in the Lucas-Kanade method. Default
121  is 5.
122 
123  - **lk_win_size**
124  - Parameter: [integer value greater than or equal to 3 and less than or
125  equal to 32]
126  - Description: The window size in the Lucas-Kanade method. Default is 6.
127 
128  - **array_capacity**
129  - Parameter: [integer value greater than or equal to 1]
130  - Description: The capacity of points array. Default is 2000.
131 
132  - **detector_cell_size**
133  - Parameter: [integer value greater than or equal to 1]
134  - Description: The size of non-maximum suppression cell for corner detector.
135  Default is 18.
136 
137  - **detector**
138  - Parameter: [harris or fast]
139  - Description: The corner detector algorithm. Default is "harris".
140 
141  - **harris_k**
142  - Parameter: [floating point value greater than zero]
143  - Description: The Harris corner detector "k" parameter. Default is 0.04.
144 
145  - **harris_thresh**
146  - Parameter: [floating point value greater than zero]
147  - Description: The Harris corner detector threshold. Default is 2000.
148 
149  - **fast_type**
150  - Parameter: [9, 10, 11 or 12]
151  - Description: The type of FAST corner detector. Default is 9.
152 
153  - **fast_thresh**
154  - Parameter: [integer value less than 255]
155  - Description: The FAST corner detector threshold. Default is 25.
156 
157 - Usage:
158 
159  `./nvx_demo_feature_tracker --source=/path/to/video.avi --config=/path/to/config_file.ini`
160 
161 - If the argument is omitted, the default configuration file is used.
162 
163 #### \-m, \--mask ####
164 - Parameter: [path to image]
165 - Description: Specifies an optional mask to filter out features. This must be
166 a grayscale image that is the same size as the input source. The demo uses features
167 only in the non-zero regions on the mask. The parameter is available only if the
168 demo is built with either OpenCV or GStreamer support.
169 
170 #### \-h, \--help ####
171 - Parameter: true
172 - Description: Prints the help message.
173 
174 ### Operational Keys ###
175 - Use `Space` to pause/resume the demo.
176 - Use `ESC` to close the demo.
177 
178 @}