Using the xfOpenCV library on a Xiinx FPGA board
xfOpenCV包含許多硬體加速函數,幫助開發者於SDx,使用類OpenCV的呼叫方式,快速實現基於FPGA的影像處理。
1. xfOpenCV function (Refer to : Xilinx OpenCV User Guide, OpenCV on Zynq Webinar 1)
1. xfOpenCV function (Refer to : Xilinx OpenCV User Guide, OpenCV on Zynq Webinar 1)
(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().
Note: For reVISION platform, there is no need to explicitly add the xfOpenCV library as an additional source locally in the SDx project.
2. User defined function (Refer to: Opencv on Zynq Webinar 2 (P14~))
(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().
Note: For reVISION platform, there is no need to explicitly add the xfOpenCV library as an additional source locally in the SDx project.
- For ZCU102 based platforms, the xfOpenCV library is available in the <platform_root>/sw/a53_linux/inc/xfopencv folder.
- For the ZC702 based platforms, the xfOpenCV library is available in the <platform_root>/sw/a9_linux/inc/xfopencv folder. (ex: home/shomin/zc702_trd/sw/a9_linux/inc/xfopencv)
Changing the Hardware Kernel Configuration (For importing xfOpenCV examples):
- Update the <path to xfOpenCV git folder>/ xfOpenCV/examples/<function>/xf_config_params.h file.
- Update the makefile along with the xf_config_params.h file.
xf::Mat Image Container Class:
- The xf::Mat image container class is similar to the cv::Mat class of the OpenCV library.
- Class Definition refer to Xilinx OpenCV User Guide (P21~P25)
留言
張貼留言