![]() |
VisionWorks Toolkit ReferenceSeptember 29, 2015 | 1.0 Release |
NvMedia Camera Capture Sample user guide.
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 inner sub-rectangle only to make the effect of equalization more obvious. The sample is available for Vibrante platform only and is tested with four MAXIM DT0614 (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] | [IPA step] | [PreProcess step] / \ / \ / \ [ISP step] ... [ISP step] | | [PostISP step] ... [PostISP step] | | [I2D step] ... [I2D step] \ / \ / \ / [PostProcess step] | [Histogram Equalization] | [Rendering] IPA = Image Processing Accelerator ISP = Image Signal Processing IPP = Image Processing Pipeline
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. The Capture2D, IPA, PreProcess and PostProcess steps are common for all cameras. The PreProcess step splits captured image to per-camera frames, and the PostProcess step joins all these frames back to a single image. Communication between the PostProcess 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:
main_nvmedia_camera.cpp
implements EGL, OpenGL ES, CUDA consumer and VisionWorks initialization, computer vision, and rendering steps.capture2d.cpp
implements NvMedia pipeline and camera initialization, plus all NvMedia-based steps.ics_*.c
files contain camera drivers and code for their control.*_utils.c
files provide different utilities for buffer management, logging, and other supplementary routings.Cameras must be attached to the correct port to work. The following images illustrate the camera connections.
NVIDIA 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.
Drive PX provides GMSL, USB, and Ethernet camera interfaces. The GMSL camera interfaces:
Each GMSL camera group can be routed to one or both Tegra chips via a GMSL Deserializer.
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.
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.
$ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ab.ini -n 2
$ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ab-e2379.ini -n 2
$ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ef-e2580.ini -n 2
This topic provides a list of supported options and the values they consume.
Space
to toggle histogram equalization mode.ESC
to close the sample.