Vision Programming Interface (nvm_vpi)
The NvMedia nvm_vpi sample application demonstrates how to use the NvMedia Vision Programming Interface (VPI) APIs to perform computer vision operations. The sample uses the NVIDIA® Tegra® PVA (Programmable Vision Accelerator) hardware engine.
nvm_vpi provides switches to select which algorithm to run, and which hardware engine to run it on. Test input data and reference output is currently part of the application.
Architecture
The following diagram shows the architecture of the nvm_vpi application.
In this diagram, “***” is a placeholder. For example, NvMediaVPI***UnRegister could be any of the following:
• NvMediaVPIArrayUnregister
• NvMediaVPIImageUnregister
• NvMediaVPIPyramidUnregister
Running the Sample Application
Prerequisites
To run the sample
1. Navigate to:
samples/nvmedia/vpi/
2. Launch the application:
$ nvm_vpi -e <engine ID> -t < test ID> -v <Logging Level>
Command Line Switches
This is the nvm_vpi command syntax:
$ nvm_vpi [-h] [-v <Logging Level>] [-e <Engine ID>] [-t Test ID>]
The following table describes the command line switches. All of the switches are optional.
If the application is run without any switches, it sequentially runs through all test IDs on engine 0.
Switch | Parameter | Description |
-h | N/A | Displays guidance on using this application. |
-e | [engine ID] | Specifies the hardware engine ID on which to run the test. The value may be 0 or 1. The default is 0. |
-t | [test ID] | Specifies the ID of the test to run. The value may be: • 0: All tests (the default) • 1: Convolution • 2: BoxFilter • 3: ProcessStereoPair with output motion vector hints • 4: ProcessStereoPair with output stereo disparity • 5: GetImagePyramid • 6: GetImagePyramid with no copy • 7: ConvolveImageSeparable • 8: GetKeyPointsFast • 9: SparseFlowPyrLK • 10: ConvertMV • 11: GetHarrisKeyPoints 3x3 track with mask • 12: GetHarrisKeyPoints 3x3 track without mask • 13: GetHarrisKeyPoints 7x7 detect only • 14: KLT tracking • 15: Stereo postprocess • 16: Stereo preprocess • 17: Stereo preprocess • 18: KLT tracking with CVSRAM scratchpad • 19: KLT tracking with DRAM scratchpad |
-kpi | | Enables key performance measurements. |
-v | [level] | Specifies the logging level. The value may be: • 0 = Errors • 1 = Warnings • 2 = Info • 3 = Debug If the ‑v switch is used with no level, it defaults to 3. If the switch is not used, it defaults to 0. |
Examples
Convolution on PVA 0
$ nvm_vpi -e 0 -t 1 -v 3
Harris Key Points on PVA 1
$ nvm_vpi -e 1 -t 8 -v 3