VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
stable/hough_transform/hough_transform_user_guide.md
Go to the documentation of this file.
1 <!-- Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. -->
2 
3 @defgroup vwx_sample_hough_transform Hough Transform Demo App
4 @brief Hough Transform Demo user guide.
5 @ingroup nvx_demos
6 @{
7 
8 <a name="Introduction">
9 ## Introduction ##
10 
11 `nvx_demo_hough_transform` demonstrates lines and circles detection via Hough Transform.
12 
13 ## Details of the pipeline ##
14 
15 The demo uses the following pipeline:
16 
17  (frame)
18  |
19  [ColorConvert]
20  |
21  [ChannelExtract]
22  |
23  [ScaleImage (down)]
24  |
25  [Median3x3]
26  |
27  [EqualizeHist]
28  |
29  +----------------------+----------------------+
30  | |
31  [CannyEdgeDetector] |
32  | |
33  +---+---------------------+----+ [Sobel3x3]
34  | | | |
35  | | +------------------+
36  | | |
37  [ScaleImage (up)] [HoughSegments] [HoughCircles]
38  | | |
39  (edges) (segments) (circles)
40 
41 The input frame is converted to grayscale, downscaled, blurred with Median filter,
42 and equalized. The equalized frame is then processed by Canny Edge Detector and Sobel operator, and
43 the resulting edges image and derivatives are passed to the Hough Circle node to
44 get the final array with detected circles. The edges image is also passed to the
45 Hough Segments node to get the final array with detected lines.
46 
47 ## Installation and Usage ##
48 
49 `nvx_demo_hough_transform` is installed in the following directory:
50 
51  /usr/share/visionworks/sources/demos/hough_transform
52 
53 For the steps to build sample applications, see the @ref nvx_samples_and_demos section for your OS.
54 
55 <a name="Executing">
56 ## Executing the Hough Transform Demo ##
57 
58  ./nvx_demo_hough_transform [options]
59 
60 ### Command Line Options ###
61 
62 This topic provides a list of supported options and the values they consume.
63 
64 #### \-s, \--source ####
65 - Parameter: [inputUri]
66 - Description: Specifies the input URI. Accepted parameters include a video (in .avi format), an image or an image sequence (in .png, .jpg, .jpeg, .bmp, or .tiff format), or camera.
67 - Usage:
68 
69  - `--source=/path/to/video.avi` for video
70  - `--source=/path/to/image` for image
71  - `--source=/path/to/image_%04d_sequence` for image sequence
72  - `--source=device://camera0` for the first camera
73  - `--source=device://camera1` for the second camera.
74 
75 @note The V4L platform has a permissions issue. The hardware decoder is used and the demo must be
76 executed with super user permissions, i.e., with `sudo`.
77 
78 
79 #### \-c, \--config ####
80 - Parameter: [config file path]
81 - Description: Specifies the path to the configuration file.
82 
83  This file contains the following parameters:
84 
85  - **switchPeriod**
86  - Parameter: [integer value greater than or equal to zero]
87  - Description: The period in frames between source/edges auto switch (0 - no auto switch). The default is 400.
88 
89  - **scaleFactor**
90  - Parameter: [floating point value greater than 0 and less than or equal to 1]
91  - Description: [ScaleImage] The scale factor. Default is 0.5.
92 
93  - **scaleType**
94  - Parameter: [nearest, bilinear, or area]
95  - Description: [ScaleImage] The scale interpolation type. Default is bilinear.
96 
97  - **CannyLowerThresh**
98  - Parameter: [integer value greater than zero]
99  - Description: [CannyEdgeDetector] The lower threshold. Default is 230.
100 
101  - **CannyUpperThresh**
102  - Parameter: [integer value greater than zero]
103  - Description: [CannyEdgeDetector] The upper threshold. Default is 250.
104 
105  - **dp**
106  - Parameter: [floating point value greater than or equal to 1]
107  - Description: [HoughCircles] Inverse ratio of the accumulator resolution to the image resolution for the downscaled frame. Default is 2.
108 
109  - **minDist**
110  - Parameter: [floating point value greater than zero]
111  - Description: [HoughCircles] Minimum distance between the centers of the detected circles for the downscaled frame. Default is 10.
112 
113  - **minRadius**
114  - Parameter: [integer value greater than zero]
115  - Description: [HoughCircles] Minimum circle radius for the downscaled frame. Default is 1.
116 
117  - **maxRadius**
118  - Parameter: [integer value greater than zero]
119  - Description: [HoughCircles] Maximum circle radius for the downscaled frame. Default is 25.
120 
121  - **accThreshold**
122  - Parameter: [integer value greater than zero]
123  - Description: [HoughCircles] The accumulator threshold for the circle centers at the detection stage for the downscaled frame. Default is 110.
124 
125  - **circlesCapacity**
126  - Parameter: [integer value greater than zero and less than or equal to 1000]
127  - Description: [HoughCircles] The capacity of output array for detected circles. Default is 300.
128 
129  - **rho**
130  - Parameter: [float value greater than zero]
131  - Description: [HoughSegments] The distance resolution of the accumulator in pixels for the downscaled frame. Default is 1.0.
132 
133  - **theta**
134  - Parameter: [float value greater than zero and less then 180]
135  - Description: [HoughSegments] The angle resolution of the accumulator in degrees for the downscaled frame. Default is 1.0.
136 
137  - **votesThreshold**
138  - Parameter: [integer value greater than zero]
139  - Description: [HoughSegments] The accumulator threshold parameter for the downscaled frame. Default is 100.
140 
141  - **minLineLength**
142  - Parameter: [integer value greater than zero]
143  - Description: [HoughSegments] The minimum line length for the downscaled frame. Default is 25.
144 
145  - **maxLineGap**
146  - Parameter: [integer value greater than or equal t0 zero]
147  - Description: [HoughSegments] The maximum allowed gap between points on the same line for the downscaled frame. Default is 2.
148 
149  - **linesCapacity**
150  - Parameter: [integer value greater than zero and less than or equal to 1000]
151  - Description: [HoughSegments] The capacity of output array for detected lines. Default is 300.
152 
153 - Usage:
154 
155  `./nvx_demo_hough_transform --config=/path/to/config_file.ini`
156 
157 - If the argument is omitted, the default config file will be used.
158 
159 #### \-h, \--help ####
160 - Description: Prints the help message.
161 
162 ### Operational Keys ###
163 - Use `M` to switch source/edges.
164 - Use `Space` to pause/resume the demo.
165 - Use `ESC` to close the demo.
166 
167 @}