和上篇类似(Vitis HLS 2020.2使用Vitis Vision实例代码实现图像处理dilation https://blog.csdn.net/u011747505/article/details/112545031)
source /home/cao/tools/Xilinx/Vitis_HLS/2020.2/settings64.sh
export DEVICE=/home/cao/workspace/zcu102/export/zcu102/zcu102.xpfm
export OPENCV_INCLUDE=/usr/local/include/opencv2/
export OPENCV_LIB=/usr/local/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
cd ~/git/repository/Vitis_Libraries-master/vision/L1/examples/sobelfilter
make run CSIM=1 CSYNTH=1 COSIM=0
vitis_hls -p sobelfilter.prj
打开工程后
修改图像尺寸
修改图片参数
#define WIDTH 636
#define HEIGHT 955
然后点击Project->Run C Simulation,修改输入参数图片路径
点击OK,开始仿真
完成,测试通过
INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
make: 'csim.exe' is up to date.
Array2xfMat .... !!!
Sobel .... !!!
xfMat2Array .... !!!
Minimum error in intensity = 0
Maximum error in intensity = 0
Percentage of pixels above error threshold = 0
Minimum error in intensity = 0
Maximum error in intensity = 0
Percentage of pixels above error threshold = 0
Test Passed .... !!!
The maximum depth reached by any of the 6 hls::stream() instances in the design is 607380
INFO: [SIM 1] CSim done with 0 errors.
INFO: [SIM 3] *************** CSIM finish ***************
程序运行结果图片位于/home/cao/git/repository/Vitis_Libraries-master/vision/L1/examples/sobelfilter/sobelfilter.prj/sol1/csim/build目录下
左图为原始图像,中间为x方向边缘检测结果,右侧为y方向边缘检测结果
参考链接
https://blog.csdn.net/u011747505/article/details/112545031
https://github.com/Xilinx/Vitis_Libraries/tree/master/vision/L1