|
|
VisionWorks Toolkit ReferenceApril 8, 2016 | 1.4 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 and OV10640 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: output is YUV422]
|
[Convertion YUV422 to RGBA step]
|
[EGLStream]
|
[VisionWorks RGBX to NV12]
|
[VisionWorks Histogram Equalization of Y plane]
|
[VisionWorks NV12 to RGBX]
|
[NVXIO Rendering]
[Capture2D step: output is RAW12]
|
[NvMedia IPP post-processing: output is NV12]
|
[EGLStream]
|
[VisionWorks RGBX to NV12]
|
[VisionWorks Histogram Equalization of Y plane]
|
[VisionWorks NV12 to RGBX]
|
[NVXIO 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 NvMedia step and VisionWorks is implemented with the EGLStream EGL extension. The main thread implements histogram equalization and then rendering to exclude EGL and OpenVX context sharing between threads.
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 dvp-ov10635-yuv422-ab -n 2
$ ./nvx_sample_nvmedia_camera -c dvp-ov10635-yuv422-ab-e2379 -n 2
$ ./nvx_sample_nvmedia_camera -c dvp-ov10640-raw12-ab-e2379 -n 4
This topic provides a list of supported options and the values they consume.
Space to toggle histogram equalization mode.ESC to close the sample.