VisionWorks Toolkit Reference

April 8, 2016 | 1.4 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
stable/nvmedia_camera/nvmedia_camera_user_guide.md
Go to the documentation of this file.
1 <!-- Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. -->
2 
3 @defgroup nvx_sample_nvmedia_camera (Vibrante) NvMedia Camera Capture Sample App
4 @brief NvMedia Camera Capture Sample user guide.
5 @ingroup nvx_samples
6 @{
7 
8 <a name="Introduction">
9 ## Introduction ##
10 
11 @note This sample is available for Vibrante platform only.
12 
13 `nvx_sample_nvmedia_camera` demonstrates frame grabbing from 1, 2, or 4 CSI cameras
14 with NvMedia API and basic VisionWorks-NvMedia interop facilities. As a basic
15 VisionWorks processing step, histogram equalization is used. Histogram equalization
16 is applied to the inner sub-rectangle only to make the effect of equalization more
17 obvious. The sample is tested with four OV10635 and OV10640 CSI cameras.
18 
19 After VisionWorks installation, `nvx_sample_nvmedia_camera` is installed in the
20 following directory:
21 
22  /usr/share/visionworks/sources/samples/nvmedia_camera
23 
24 For the steps to build sample applications, see the
25 @ref nvx_sample_building_linux section.
26 
27 The sample organization on the global level is illustrated by the flowchart:
28 
29  - For Omni Vision 10635 cameras:
30 
31 
32  [Capture2D step: output is YUV422]
33  |
34  [Convertion YUV422 to RGBA step]
35  |
36  [EGLStream]
37  |
38  [VisionWorks RGBX to NV12]
39  |
40  [VisionWorks Histogram Equalization of Y plane]
41  |
42  [VisionWorks NV12 to RGBX]
43  |
44  [NVXIO Rendering]
45 
46 
47  - For Omni Vision 10640 cameras:
48 
49 
50  [Capture2D step: output is RAW12]
51  |
52  [NvMedia IPP post-processing: output is NV12]
53  |
54  [EGLStream]
55  |
56  [VisionWorks RGBX to NV12]
57  |
58  [VisionWorks Histogram Equalization of Y plane]
59  |
60  [VisionWorks NV12 to RGBX]
61  |
62  [NVXIO Rendering]
63 
64 
65 The sample builds the chain of hardware-based NvMedia image processing steps that
66 are executed in a dedicated thread for each active camera. Thread communication
67 is based on queues without actual data copying. Communication between the NvMedia
68 step and VisionWorks is implemented with the EGLStream EGL extension. The main thread
69 implements histogram equalization and then rendering to exclude EGL and OpenVX context
70 sharing between threads.
71 
72 ## Attaching the Cameras ##
73 
74 Cameras must be attached to the correct port to work. The following images
75 illustrate the camera connections.
76 
77 
78 @note There are multiple CSI connectors on the board. You must connect cameras
79 in the correct order:
80  - For Jetson Pro, connect in ascending order starting from connector 0.
81  - For NVIDIA<sup>&reg;</sup> DRIVE&tm; PX, attach the connectors in reverse order as shown in the
82  DRIVE PX picture below.
83 
84 @note For more details, see the *Platform Quick Start* for your board.
85 
86 ### DRIVE PX Camera Connections
87 
88 DRIVE PX provides multiple video and camera ports. Before using these
89 cameras with the NvMedia sample applications, you must attach the cameras to
90 the ports in a specific order. If you fail to do so, NvMedia raises errors.
91 
92 @warning Before connecting/disconnecting cameras to/from the platform, remove
93 power. Failure to do so may damage the platform.
94 
95 ![](docs-user/images/emb_vib_drivepx_front.jpg)
96 
97 #### DRIVE PX Camera Interfaces
98 
99 DRIVE PX provides GMSL, USB, and Ethernet camera interfaces. The GMSL camera
100 interfaces:
101 
102 - Provide 12 simultaneous GMSL camera inputs
103 - Route camera data to both Tegras
104 - Control any camera from either Tegra
105 - Synchronize cameras within each group
106 
107 #### Mapping Connectors to Tegra Chips
108 
109 Each GMSL camera group can be routed to one or both Tegra chips via a GMSL
110 Deserializer.
111 
112 ![](docs-user/images/emb_nvmedia_drivepx_cam_to_tegras.jpg)
113 
114 #### Connecting Cameras to DRIVE PX
115 
116 When you connect cameras to a specific camera group, you must attach the
117 cameras in sequential order. For example, within Group A:
118 
119 - Attach the first camera to A0.
120 - If used, attach the second camera to A1.
121 - If used, attach the second camera to A2.
122 - If used, attach the second camera to A3.
123 
124 If you fail to attach cameras in this order, NvMedia generates an error message.
125 
126 ![](docs-user/images/emb_nvmedia_drivepx_cam_connector_map.jpg)
127 
128 #### Default Aggregator Link Mapping
129 
130 The following diagram shows how the digitized camera pictures are aggregated
131 into a frame, where the image from the first camera appears first in the frame
132 and the image from the last camera appears last in the frame. The frame size
133 changes depending on how many cameras are connected.
134 
135 All the sample applications that process images provide a aggregate `n` option
136 to specify the number of aggregated images in the frame. In this option, `n`
137 maps as follows:
138 
139 - n=1 maps to link0
140 - n=2 maps to link0 and link1
141 - etc.
142 - n=4 maps to all links
143 
144 The number of cameras connected must match the number specified in the aggregate
145 option.
146 
147 ![](docs-user/images/emb_nvmedia_drivepx_cam_agg_link_map.jpg)
148 
149 ### Jetson TK1 Pro Camera Connections
150 
151 ![](docs-user/images/jetson-tk1-pro.png)
152 
153 <a name="Executing">
154 ## Executing the NvMedia Camera Sample ##
155 
156 - On Jetson TK1 Pro with 2 OV10635 cameras, execute:
157 
158  $ ./nvx_sample_nvmedia_camera -c dvp-ov10635-yuv422-ab -n 2
159 
160 - On DRIVE PX B00 with 2 OV10635 cameras, execute:
161 
162  $ ./nvx_sample_nvmedia_camera -c dvp-ov10635-yuv422-ab-e2379 -n 2
163 
164 - On DRIVE PX B00 with 4 OV10640 cameras, execute:
165 
166  $ ./nvx_sample_nvmedia_camera -c dvp-ov10640-raw12-ab-e2379 -n 4
167 
168 ### Command Line Options ###
169 
170 This topic provides a list of supported options and the values they consume.
171 
172 #### \-c, \--camera ####
173 - Parameter: [Camera hardware configuration name]
174 - Description: Specifies the configuration name that describes the current
175  camera setup.
176 
177 - Usage: \--camera="dvp-ov10635-yuv422-ab"
178 
179 #### \-n, \--camera_number ####
180 - Parameter: [Number of connected cameras]
181 - Description: Specifies the number of connected cameras. 1, 2, or 4 cameras are
182  supported.
183 - Usage: \--camera_number=4
184 
185 #### \-h, \--help ####
186 - Description: Prints the help message.
187 
188 ### Operational Keys ###
189 - Use `Space` to toggle histogram equalization mode.
190 - Use `ESC` to close the sample.
191 
192 @}
Range< T > all()
Creates a range that includes all points.
Definition: Range.hpp:163