cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
479 Views
Registered: ‎05-02-2019

when I used the hls::Resize of HLS Video library,I met this error ,and I didn't know how to solve this problem,Can someone give me some suggestions?

Jump to solution

            I want to scale the image to one-eighth of the original,then according to the UG902,I find I can use hls::Resize which is provided by Xilinx HLS Video Library to achieve this function.

       So I code this :

       //define the type of data

       typedef hls::Mat GRAY_IMAGE;

       typedef hls::Mat GRAYFGF_IMAGE;

       int TYPE = HLS_32FC1;

       int rows = p_org.rows;

       int cols = p_org.cols;

       //start to resize

       int drows = rows/s;    // s=8

      int dcols = cols/s;

      GRAYFGF_IMAGE I(drows, dcols);

      GRAYFGF_IMAGE p(drows, dcols);

      hls::Resize(I_org, I);

      hls::Resize(p_org, p);

      Finally, when I run C simulation, the error is occured :

      E:/../hls_video_imgproc.h: In function 'void hls::Resize_opr_linear(hls::Mat&, hls::Mat&) [with int SRC_T = 5, int ROWS = 1280, int COLS = 1080, int DROWS = 160, int DCOLS = 135]':                         

      E:/.../hls/hls_video_imgproc.h:2451:9: instantiated from 'void hls::Resize(hls::Mat&, hls::Mat&, int) [with int SRC_T = 5, int ROWS = 1280, int COLS = 1080, int DROWS = 160, int DCOLS =135]'../A_coarse_prj/src/test5/dehaze_hls.cpp:507:2: a instantiated from 'void fastGuidedFilter(GRAY_IMAGE&, GRAY_IMAGE&, GRAY_IMAGE&, float, int) [with int KH = 5, int KW = 5, GRAY_IMAGE = hls::Mat<1280, 1080, 5>]' ../../../../../../A_coarse_prj/src/test5/dehaze_hls.cpp:608:53: instantiated from here        E:/vivado2017.4/Vivado/2017.4/include/hls/hls_video_imgproc.h:2413:21: error: ambiguous overload for 'operator*' in 'ap_ufixed<64, 32>(win.hls::Window<2, 2, hls::Scalar<1, float> >::val[0][0].hls::Scalar<1, float>::val[k]) * u'         E:/vivado2017.4/Vivado/2017.4/include/hls/hls_video_imgproc.h:2413:21: note: candidates are: E:/vivado2017.4/Vivado/2017.4/include/hls/hls_video_imgproc.h:2413:21: note: operator*(long double, hls::filter2d_traits, 4>::FILTER_CAST_T {aka float})

    why does this error occur in Xilinx HLS Video Library?Can someone give me some suggestions?Thinks you.

2.png
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
376 Views
Registered: ‎05-27-2018

Hi @mingyuexin447 ,

    Here is an example code using xf::resize, it looks like you haven't declared the right format of the input image.

    Try to change the TYPE = HLS_32FC1  into an ap_uint datatype.

typedef hls::Mat<SRC_HEIGHT, SRC_WIDTH, HLS_8UC3>     SRC_IMAGE;
typedef hls::Mat<DST_HEIGHT, DST_WIDTH, HLS_8UC3>     DST_IMAGE;

    Xilinx Chinese Forum is welcomed. 

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

View solution in original post

0 Kudos
1 Reply
Highlighted
Moderator
Moderator
377 Views
Registered: ‎05-27-2018

Hi @mingyuexin447 ,

    Here is an example code using xf::resize, it looks like you haven't declared the right format of the input image.

    Try to change the TYPE = HLS_32FC1  into an ap_uint datatype.

typedef hls::Mat<SRC_HEIGHT, SRC_WIDTH, HLS_8UC3>     SRC_IMAGE;
typedef hls::Mat<DST_HEIGHT, DST_WIDTH, HLS_8UC3>     DST_IMAGE;

    Xilinx Chinese Forum is welcomed. 

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

View solution in original post

0 Kudos