![]() |
VisionWorks Toolkit ReferenceDecember 18, 2015 | 1.2 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 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:
main_nvmedia_camera.cpp
performs EGL, CUDA consumer and VisionWorks initialization, computer vision, and rendering steps.imgcapture.cpp
implements NvMedia pipeline and camera, EGL and CUDA consumer initialization.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.
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
$ ./nvx_sample_nvmedia_camera -c data/cameras/dvp-ov10635-yuv422-ab-p2382.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.