xfOpenCV Kernel on the reVISION Platform

The xfOpenCV library is designed to be used with the SDx™ development environment. xfOpenCV kernels are evaluated on the reVISION™ platform.

The following steps describe the general flow of an example design, where both the input and the output are image files.

  1. Read the image using cv::imread().
  2. Copy the data to xF::Mat.
  3. Call the processing function(s) in xfOpenCV.
  4. Copy the data from xF::Mat to cv::Mat.
  5. Write the output to image using cv::imwrite().

The entire code is written as the host code for the pipeline , from which all the calls to xfOpenCV functions are moved to hardware. Functions from OpenCV are used to read and write images in the memory. The image containers for xfOpenCV library functions are xF::Mat objects. For more information, see the xF::Mat Image Container Class.

The reVISION platform supports both live and file input-output (I/O) modes. For more details, see the reVISION Getting Started Guide.
  • File I/O mode enables the controller to transfer images from SD Card to the hardware kernel. The following steps describe the file I/O mode.
    1. Processing system (PS) reads the image frame from the SD Card and stores it in the DRAM.
    2. The xfOpenCV kernel reads the image from the DRAM, processes it and stores the output back in the DRAM memory.
    3. The PS reads the output image frame from the DRAM and writes it back to the SD Card.
  • Live I/O mode enables streaming frames into the platform, processing frames with the xfOpenCV kernel, and streaming out the frames through the appropriate interface. The following steps describe the live I/O mode.
    1. Video capture IPs receive a frame and store it in the DRAM.
    2. The xfOpenCV kernel fetches the image from the DRAM, processes the image, and stores the output in the DRAM.
    3. Display IPs read the output frame from the DRAM and transmits the frame through the appropriate display interface.

Following figure shows the reVISION platform with the xfOpenCV kernel block:

Figure: xfOpenCV Kernel on the reVISION Platform



Note: For more information on the PS-PL interfaces and PL-DDR interfaces, see the (UG1085).