xfOpenCV Kernel on the reVISION Platform
ThexfOpenCVlibrary is designed to be used with the SDx™ development environment.xfOpenCVkernels 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) inxfOpenCV.
- 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 toxfOpenCVfunctions are moved to hardware. Functions fromOpenCVare used to read and write images in the memory. The image containers forxfOpenCVlibrary functions arexF::Mat
objects. For more information, see thexF::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.
- Processing system (PS) reads the image frame from the SD Card and stores it in the DRAM.
- ThexfOpenCVkernel 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 thexfOpenCVkernel, 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.
- ThexfOpenCVkernel 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 thexfOpenCVkernel block:
Figure:xfOpenCV Kernel on the reVISION Platform
Note:For more information on the PS-PL interfaces and PL-DDR interfaces, see the
(UG1085).