May 28, 2015

Tutorial 02: Execute OpenVX examples

The archive OpenVX examples contains some basic OpenVX programs, including a Makefile. To run a first example, just try make clean all run EXAMPLE=sobel. The code for this example (contained in examples/sobel.c) is listed below, with some notes following:

  • Line 20: Creation of an OpenVX context, representing the framework environment.
  • Line 23: Include the debug software module, containing functions to read/write data from/to disk.
  • Line 25: Creation of the OpenVX graph object used in this application.
  • Lines 29-34: Definition of image objects. Virtual images are not allocated in main memory and are not accessible using OpenVX functions, they are just used to enforce data dependencies between nodes.
  • Line 37: Read an image from disk into images[0].
  • Lines 47-50: Nodes of OpenVX applications, they refer to standard vision kernels that are included in the standard.
  • Line 61: Graph verification before execution (required by OpenVX standard).
  • Lines 69-71: OpenVX graph execution, with an additional support function to measure execution time (in cycles)
  • Line 75: Write the final image to disk.