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 inner sub-rectangle only to make the effect of equalization more
17 obvious. The sample is available
for Vibrante platform only and is tested with
18 four MAXIM DT0614 (OV10635) CSI cameras.
20 After VisionWorks installation, `nvx_sample_nvmedia_camera` is installed in the
23 /usr/share/visionworks/sources/samples/nvmedia_camera
25 For the steps to build sample applications, see the
26 @ref nvx_sample_building_linux section.
28 The sample organization on the global level is illustrated by the flowchart.
38 [ISP step] ... [ISP step]
40 [PostISP step] ... [PostISP step]
42 [I2D step] ... [I2D step]
48 [Histogram Equalization]
52 IPA = Image Processing Accelerator
53 ISP = Image Signal Processing
54 IPP = Image Processing Pipeline
56 The sample builds the chain of hardware-based NvMedia image processing steps that
57 are executed in a dedicated thread for each active camera. Thread communication
58 is based on queues without actual data copying. The Capture2D, IPA, PreProcess and
59 PostProcess steps are common for
all cameras. The PreProcess step splits captured
60 image to per-camera frames, and the PostProcess step joins
all these frames back
61 to a single image. Communication between the PostProcess step and VisionWorks is
62 implemented with EGLStream EGL extension. The main thread implements histogram
63 equalization and then rendering to exclude EGL and OpenVX context sharing between
68 - `main_nvmedia_camera.cpp` implements EGL, OpenGL ES, CUDA consumer and
69 VisionWorks initialization, computer vision, and rendering steps.
70 - `capture2d.cpp` implements NvMedia pipeline and camera initialization, plus
all
72 - `ics_*.c` files contain camera drivers and code for their control.
73 - `*_utils.c` files provide different utilities for buffer management, logging, and
74 other supplementary routings.
76 ## Attaching the Cameras ##
78 Cameras must be attached to the correct port to work. The following images
79 illustrate the camera connections.
82 @note There are multiple CSI connectors on the board. You must connect cameras
84 - For Jetson Pro, connect in ascending order starting from connector 0.
85 - For Drive PX, attach the connectors in reverse order as shown in the
86 Drive PX picture below.
88 @note For more details, see the *Platform Quick Start*
for your board.
90 ### Drive PX Camera Connections
92 NVIDIA Drive PX provides multiple video and camera ports. Before
using these
93 cameras with the NvMedia sample applications, you must attach the cameras to
94 the ports in a specific order. If you fail to
do so, NvMedia raises errors.
96 @warning Before connecting/disconnecting cameras to/from the platform,
remove
97 power. Failure to
do so may damage the platform.
99 
101 #### Drive PX Camera Interfaces
103 Drive PX provides GMSL, USB, and Ethernet camera interfaces. The GMSL camera
106 - Provide 12 simultaneous GMSL camera inputs
107 - Route camera data to both Tegras
108 - Control any camera from either Tegra
109 - Synchronize cameras within each group
111 #### Mapping Connectors to Tegra Chips
113 Each GMSL camera group can be routed to one or both Tegra chips via a GMSL
116 
118 #### Connecting Cameras to Drive PX
120 When you connect cameras to a specific camera group, you must attach the
121 cameras in sequential order. For example, within Group A:
123 - Attach the first camera to A0.
124 - If used, attach the second camera to A1.
125 - If used, attach the second camera to A2.
126 - If used, attach the second camera to A3.
128 If you fail to attach cameras in
this order, NvMedia generates an error message.
130 
132 #### Default Aggregator Link Mapping
134 The following diagram shows how the digitized camera pictures are aggregated
135 into a frame, where the image from the first camera appears first in the frame
136 and the image from the last camera appears last in the frame. The frame size
137 changes depending on how many cameras are connected.
139 All the sample applications that process images provide a aggregate `n` option
140 to specify the number of aggregated images in the frame. In
this option, `n`
144 - n=2 maps to link0 and link1
146 - n=4 maps to
all links
148 The number of cameras connected must match the number specified in the aggregate
151 
153 ### Jetson TK1 Pro Camera Connections
155 
157 ### E2580 Camera Connections
159 
162 ## Executing the NvMedia Camera Sample ##
164 - On Jetson TK1 Pro with 2 cameras, execute:
166 $ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ab.ini -n 2
168 - On Drive PX A00 / Drive PX B00, execute:
170 $ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ab-e2379.ini -n 2
174 $ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ef-e2580.ini -n 2
176 ### Command Line Options ###
178 This topic provides a list of supported options and the values they consume.
180 #### \-c, \--camera ####
181 - Parameter: [Camera hardware configuration name]
182 - Description: Specifies the configuration file that describes the current
185 - Usage: \--camera=
"cameras/dvp-ov10635-yuv422-ab.ini"
187 @warning Do not modify config files. An incorrect value of any
property leads
188 to cameras startup failures.
190 #### \-p, \--processor ####
191 - Parameter: [2D processor hardware configuration name]
192 - Description: Specifies the configuration file that describes the current
193 2D processor configuration.
194 - Usage: \--processor=
"cameras/2d-processor-default.ini"
196 #### \-n, \--camera_number ####
197 - Parameter: [Number of connected cameras]
198 - Description: Specifies the number of connected cameras. 1, 2, or 4 cameras are
200 - Usage: \--camera_number=4
202 #### \-h, \--help ####
203 - Description: Prints the help message.
205 ### Operational Keys ###
206 - Use `Space` to toggle histogram equalization mode.
207 - Use `ESC` to close the sample.
Range< T > all()
Creates a range that includes all points.