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.
- Read the image using
cv::imread()
. - Copy the data to
xF::Mat
. - Call the processing function(s) in xfOpenCV.
- Copy the data from
xF::Mat
tocv::Mat
. - 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.
- 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.
- Processing system (PS) reads the image frame from the SD Card and stores it in the DRAM.
- The xfOpenCV kernel reads the image from the DRAM, processes it and stores the output back in the DRAM memory.
- 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.
- Video capture IPs receive a frame and store it in the DRAM.
- The xfOpenCV kernel fetches the image from the DRAM, processes the image, and stores the output in the DRAM.
- 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