VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
(Vibrante) NvMedia Camera Capture Sample App

NvMedia Camera Capture Sample user guide.

Introduction

Note
This sample is available for Vibrante platform only.

nvx_sample_nvmedia_camera demonstrates frame grabbing from 1, 2, or 4 CSI cameras with NvMedia API and basic VisionWorks-NvMedia interop facilities. As a basic VisionWorks processing step, histogram equalization is used. Histogram equalization is applied to the inner sub-rectangle only to make the effect of equalization more obvious. The sample is tested with four OV10635 CSI cameras.

After VisionWorks installation, nvx_sample_nvmedia_camera is installed in the following directory:

/usr/share/visionworks/sources/samples/nvmedia_camera

For the steps to build sample applications, see the Linux: Building and Running Samples and Demos section.

The sample organization on the global level is illustrated by the flowchart.

              [Capture2D step]
                     |
   [Convertion from YUV/RAW12 to RGBA step]
                     |
          [Histogram Equalization]
                     |
                [Rendering]

The sample builds the chain of hardware-based NvMedia image processing steps that are executed in a dedicated thread for each active camera. Thread communication is based on queues without actual data copying. Communication between the Convertion step and VisionWorks is implemented with EGLStream EGL extension. The main thread implements histogram equalization and then rendering to exclude EGL and OpenVX context sharing between threads.

File layout:

Attaching the Cameras

Cameras must be attached to the correct port to work. The following images illustrate the camera connections.

Note
There are multiple CSI connectors on the board. You must connect cameras in the correct order:
  • For Jetson Pro, connect in ascending order starting from connector 0.
  • For NVIDIA® DRIVE™ PX, attach the connectors in reverse order as shown in the DRIVE PX picture below.
For more details, see the Platform Quick Start for your board.

DRIVE PX Camera Connections

DRIVE PX provides multiple video and camera ports. Before using these cameras with the NvMedia sample applications, you must attach the cameras to the ports in a specific order. If you fail to do so, NvMedia raises errors.

Warning
Before connecting/disconnecting cameras to/from the platform, remove power. Failure to do so may damage the platform.
emb_vib_drivepx_front.jpg

DRIVE PX Camera Interfaces

DRIVE PX provides GMSL, USB, and Ethernet camera interfaces. The GMSL camera interfaces:

Mapping Connectors to Tegra Chips

Each GMSL camera group can be routed to one or both Tegra chips via a GMSL Deserializer.

emb_nvmedia_drivepx_cam_to_tegras.jpg

Connecting Cameras to DRIVE PX

When you connect cameras to a specific camera group, you must attach the cameras in sequential order. For example, within Group A:

If you fail to attach cameras in this order, NvMedia generates an error message.

emb_nvmedia_drivepx_cam_connector_map.jpg

Default Aggregator Link Mapping

The following diagram shows how the digitized camera pictures are aggregated into a frame, where the image from the first camera appears first in the frame and the image from the last camera appears last in the frame. The frame size changes depending on how many cameras are connected.

All the sample applications that process images provide a aggregate n option to specify the number of aggregated images in the frame. In this option, n maps as follows:

The number of cameras connected must match the number specified in the aggregate option.

emb_nvmedia_drivepx_cam_agg_link_map.jpg

Jetson TK1 Pro Camera Connections

jetson-tk1-pro.png

E2580 Camera Connections

E2580_Camera_Connections.jpg

DRIVE CX (P2382) Camera Connections

drive_cx_camera_connections.jpg

Executing the NvMedia Camera Sample

Command Line Options

This topic provides a list of supported options and the values they consume.

-c, --camera

Warning
Do not modify config files. An incorrect value of any property leads to cameras startup failures.

-n, --camera_number

-h, --help

Operational Keys