UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

取消
显示结果 
搜索替代 
您的意思是: 
Observer yanjian
Observer
578 次查看
注册日期: ‎11-28-2018

vivado hls 图像处理函数使用问题

hls::InitUndistortRectifyMap ()

hls::Remap().

这两个函数如何使用?  能否给实例!!!!谢谢!我按照UG902里面的参考,写得不对。

头文件:

typedef hls::Mat<MAX_HEIGHT, MAX_WIDTH,HLS_16SC2> MAP ;
typedef hls::Mat<3,3,HLS_32F> EYE_MAP ;
typedef hls::Mat<3, 3,HLS_32FC1> Matrix_type ;
typedef hls::Mat<1, 5,HLS_32FC1> Coeff_type ;

函数文件

MAP mapx;
MAP mapy;
EYE_MAP R ={1,0,0,0,1,0,0,0,1} ;
Matrix_type cameraMatrix = {2892.45384, -0.77943, 925.03464,0, 2896.55407, 587.20266,0, 0, 1};
Coeff_type distCoeffs ={ 0.12394, -10.03379, -0.00295, 0.00988, 174.17315};
gray_IMAGE dst(rows,cols);


hls::AXIvideo2Mat(src, src0);

hls::InitUndistortRectifyMapInverse(cameraMatrix,distCoeffs,R,mapx,mapy);
hls::Remap(src0,src00,mapx,mapy);

 

编译错误信息:

../../../../thin.cpp: In function 'void thinning(AXI_STREAM&, ap_int<11>, ap_int<11>, Point3f*)':
../../../../thin.cpp:102:34: error: in C++98 'R' must be initialized by constructor, not by '{...}'
../../../../thin.cpp:102:34: error: could not convert '{1, 0, 0, 0, 1, 0, 0, 0, 1}' from '<brace-enclosed initializer list>' to 'EYE_MAP {aka hls::Mat<3, 3, 5>}'
../../../../thin.cpp:103:96: error: in C++98 'cameraMatrix' must be initialized by constructor, not by '{...}'
../../../../thin.cpp:103:96: error: could not convert '{2.892453840000000127474777400493621826171875e+3, -7.79429999999999956195040340389823541045188903809e-1, 9.250346399999999675856088288128376007080078125e+2, 0, 2.896554070000000137952156364917755126953125e+3, 5.872026600000000371437636204063892364501953125e+2, 0, 0, 1}' from '<brace-enclosed initializer list>' to 'Matrix_type {aka hls::Mat<3, 3, 5>}'
../../../../thin.cpp:104:78: error: in C++98 'distCoeffs' must be initialized by constructor, not by '{...}'
../../../../thin.cpp:104:78: error: could not convert '{1.23939999999999994617638776617241092026233673096e-1, -1.00337899999999997646682459162548184394836425781e+1, -2.94999999999999993130495035131843906128779053688e-3, 9.87999999999999989341858963598497211933135986328e-3, 1.74173149999999992587618180550634860992431640625e+2}' from '<brace-enclosed initializer list>' to 'Coeff_type {aka hls::Mat<1, 5, 5>}'
../../../../thin.cpp:110:74: error: no matching function for call to 'InitUndistortRectifyMapInverse(Matrix_type&, Coeff_type&, EYE_MAP&, MAP&, MAP&)'
../../../../thin.cpp:110:74: note: candidate is:
C:/Xilinx/Vivado_HLS/2016.3/include/hls/hls_video_undistort.h:646:6: note: template<class CMT, class DT, class ICMT, int ROWS, int COLS, int MAP1_T, int MAP2_T, int N> void hls::InitUndistortRectifyMapInverse(hls::Window<3, 3, CMT>, DT (&)[N], hls::Window<3, 3, ICMT>, hls::Mat<ROWS, COLS, MAP1_T>&, hls::Mat<ROWS, COLS, MAP2_T>&, int)
../../../../thin.cpp:111:34: error: no matching function for call to 'Remap(gray_IMAGE&, gray_IMAGE&, MAP&, MAP&)'
../../../../thin.cpp:111:34: note: candidate is:
C:/Xilinx/Vivado_HLS/2016.3/include/hls/hls_video_undistort.h:383:6: note: template<int WIN_ROW, int ROWS, int COLS, int SRC_T, int DST_T, int MAP1_T, int MAP2_T> void hls::Remap(hls::Mat<ROWS, COLS, SRC_T>&, hls::Mat<ROWS, COLS, DST_T>&, hls::Mat<ROWS, COLS, MAP1_T>&, hls::Mat<ROWS, COLS, MAP2_T>&, int)
make: *** [obj/thin.o] Error 1
ERROR: [SIM 211-100] 'csim_design' failed: compilation error(s).

 

 

 

0 项奖励
1 条回复1
Moderator
Moderator
529 次查看
注册日期: ‎05-23-2018

回复: vivado hls 图像处理函数使用问题

Hi, @yanjian

建议参考一下xapp1167所带附件中的remap例程,其中有这两个函数的调用方法。附件链接如下所示。

https://www.xilinx.com/member/forms/download/design-license.html?cid=323570&filename=xapp1167.zip

 

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 项奖励