1 <!-- Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. -->
3 @defgroup nvx_sample_nvmedia_camera (Vibrante) NvMedia Camera Capture Sample App
4 @brief NvMedia Camera Capture Sample user guide.
8 <a name=
"Introduction">
11 @note This sample is available
for Vibrante platform only.
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 CSI cameras.
19 After VisionWorks installation, `nvx_sample_nvmedia_camera` is installed in the
22 /usr/share/visionworks/sources/samples/nvmedia_camera
24 For the steps to build sample applications, see the
25 @ref nvx_sample_building_linux section.
27 The sample organization on the global level is illustrated by the flowchart.
31 [Convertion from YUV/RAW12 to RGBA step]
33 [Histogram Equalization]
37 The sample builds the chain of hardware-based NvMedia image processing steps that
38 are executed in a dedicated thread
for each active camera. Thread communication
39 is based on queues without actual data copying. Communication between the Convertion
40 step and VisionWorks is implemented with EGLStream EGL extension. The main thread
41 implements histogram equalization and then rendering to exclude EGL and OpenVX context
42 sharing between threads.
46 - `main_nvmedia_camera.cpp` performs EGL, CUDA consumer and VisionWorks
47 initialization, computer vision, and rendering steps.
48 - `imgcapture.cpp` implements NvMedia pipeline and camera, EGL and CUDA consumer
50 - `ics_*.c` files contain camera drivers and code
for their control.
51 - `*_utils.c` files provide different utilities
for buffer management, logging, and
52 other supplementary routings.
54 ## Attaching the Cameras ##
56 Cameras must be attached to the correct port to work. The following images
57 illustrate the camera connections.
60 @note There are multiple CSI connectors on the board. You must connect cameras
62 - For Jetson Pro, connect in ascending order starting from connector 0.
63 - For NVIDIA<sup>®</sup> DRIVE&tm; PX, attach the connectors in reverse order as shown in the
64 DRIVE PX picture below.
66 @note For more details, see the *Platform Quick Start*
for your board.
68 ### DRIVE PX Camera Connections
70 DRIVE PX provides multiple video and camera ports. Before
using these
71 cameras with the NvMedia sample applications, you must attach the cameras to
72 the ports in a specific order. If you fail to
do so, NvMedia raises errors.
74 @warning Before connecting/disconnecting cameras to/from the platform,
remove
75 power. Failure to
do so may damage the platform.
77 
79 #### DRIVE PX Camera Interfaces
81 DRIVE PX provides GMSL, USB, and Ethernet camera interfaces. The GMSL camera
84 - Provide 12 simultaneous GMSL camera inputs
85 - Route camera data to both Tegras
86 - Control any camera from either Tegra
87 - Synchronize cameras within each group
89 #### Mapping Connectors to Tegra Chips
91 Each GMSL camera group can be routed to one or both Tegra chips via a GMSL
94 
96 #### Connecting Cameras to DRIVE PX
98 When you connect cameras to a specific camera group, you must attach the
99 cameras in sequential order. For example, within Group A:
101 - Attach the first camera to A0.
102 - If used, attach the second camera to A1.
103 - If used, attach the second camera to A2.
104 - If used, attach the second camera to A3.
106 If you fail to attach cameras in
this order, NvMedia generates an error message.
108 
110 #### Default Aggregator Link Mapping
112 The following diagram shows how the digitized camera pictures are aggregated
113 into a frame, where the image from the first camera appears first in the frame
114 and the image from the last camera appears last in the frame. The frame size
115 changes depending on how many cameras are connected.
117 All the sample applications that process images provide a aggregate `n` option
118 to specify the number of aggregated images in the frame. In
this option, `n`
122 - n=2 maps to link0 and link1
124 - n=4 maps to
all links
126 The number of cameras connected must match the number specified in the aggregate
129 
131 ### Jetson TK1 Pro Camera Connections
133 
135 ### E2580 Camera Connections
137 
139 ### DRIVE CX (P2382) Camera Connections
141 
144 ## Executing the NvMedia Camera Sample ##
146 - On Jetson TK1 Pro with 2 OV10635 cameras, execute:
148 $ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ab.ini -n 2
150 - On DRIVE PX B00 with 2 OV10635 cameras, execute:
152 $ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ab-e2379.ini -n 2
154 - On E2580 with 2 OV10635 cameras, execute:
156 $ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ef-e2580.ini -n 2
158 - On NVIDIA<sup>®</sup> DRIVE&tm; CX with 2 OV10635 cameras, execute:
160 $ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ab-p2382.ini -n 2
162 ### Command Line Options ###
164 This topic provides a list of supported options and the values they consume.
166 #### \-c, \--camera ####
167 - Parameter: [Camera hardware configuration name]
168 - Description: Specifies the configuration file that describes the current
171 - Usage: \--camera=
"cameras/dvp-ov10635-yuv422-ab.ini"
173 @warning Do not modify config files. An incorrect value of any property leads
174 to cameras startup failures.
176 #### \-n, \--camera_number ####
177 - Parameter: [Number of connected cameras]
178 - Description: Specifies the number of connected cameras. 1, 2, or 4 cameras are
180 - Usage: \--camera_number=4
182 #### \-h, \--help ####
183 - Description: Prints the help message.
185 ### Operational Keys ###
186 - Use `Space` to toggle histogram equalization mode.
187 - Use `ESC` to close the sample.
Range< T > all()
Creates a range that includes all points.