1 <!-- Copyright (c) 2015-2016, 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 and OV10640 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:
29 - For Omni Vision 10635 cameras:
32 [Capture2D step: output is YUV422]
34 [Convertion YUV422 to RGBA step]
38 [VisionWorks RGBX to NV12]
40 [VisionWorks Histogram Equalization of Y plane]
42 [VisionWorks NV12 to RGBX]
47 - For Omni Vision 10640 cameras:
50 [Capture2D step: output is RAW12]
52 [NvMedia IPP post-processing: output is NV12]
56 [VisionWorks RGBX to NV12]
58 [VisionWorks Histogram Equalization of Y plane]
60 [VisionWorks NV12 to RGBX]
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.
72 ## Attaching the Cameras ##
74 Cameras must be attached to the correct port to work. The following images
75 illustrate the camera connections.
78 @note There are multiple CSI connectors on the board. You must connect cameras
80 - For Jetson Pro, connect in ascending order starting from connector 0.
81 - For NVIDIA<sup>®</sup> DRIVE&tm; PX, attach the connectors in reverse order as shown in the
82 DRIVE PX picture below.
84 @note For more details, see the *Platform Quick Start*
for your board.
86 ### DRIVE PX Camera Connections
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.
92 @warning Before connecting/disconnecting cameras to/from the platform,
remove
93 power. Failure to
do so may damage the platform.
95 
97 #### DRIVE PX Camera Interfaces
99 DRIVE PX provides GMSL, USB, and Ethernet camera interfaces. The GMSL camera
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
107 #### Mapping Connectors to Tegra Chips
109 Each GMSL camera group can be routed to one or both Tegra chips via a GMSL
112 
114 #### Connecting Cameras to DRIVE PX
116 When you connect cameras to a specific camera group, you must attach the
117 cameras in sequential order. For example, within Group A:
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.
124 If you fail to attach cameras in
this order, NvMedia generates an error message.
126 
128 #### Default Aggregator Link Mapping
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.
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`
140 - n=2 maps to link0 and link1
142 - n=4 maps to
all links
144 The number of cameras connected must match the number specified in the aggregate
147 
149 ### Jetson TK1 Pro Camera Connections
151 
154 ## Executing the NvMedia Camera Sample ##
156 - On Jetson TK1 Pro with 2 OV10635 cameras, execute:
158 $ ./nvx_sample_nvmedia_camera -c dvp-ov10635-yuv422-ab -n 2
160 - On DRIVE PX B00 with 2 OV10635 cameras, execute:
162 $ ./nvx_sample_nvmedia_camera -c dvp-ov10635-yuv422-ab-e2379 -n 2
164 - On DRIVE PX B00 with 4 OV10640 cameras, execute:
166 $ ./nvx_sample_nvmedia_camera -c dvp-ov10640-raw12-ab-e2379 -n 4
168 ### Command Line Options ###
170 This topic provides a list of supported options and the values they consume.
172 #### \-c, \--camera ####
173 - Parameter: [Camera hardware configuration name]
174 - Description: Specifies the configuration name that describes the current
177 - Usage: \--camera=
"dvp-ov10635-yuv422-ab"
179 #### \-n, \--camera_number ####
180 - Parameter: [Number of connected cameras]
181 - Description: Specifies the number of connected cameras. 1, 2, or 4 cameras are
183 - Usage: \--camera_number=4
185 #### \-h, \--help ####
186 - Description: Prints the help message.
188 ### Operational Keys ###
189 - Use `Space` to toggle histogram equalization mode.
190 - Use `ESC` to close the sample.
Range< T > all()
Creates a range that includes all points.