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!

cancel
Showing results for 
Search instead for 
Did you mean: 
1,237 Views
Registered: ‎07-05-2017

hls::mean example error

Jump to solution

Hi, I'm writing a very simple program to obtain the mean value of an image:

 

typedef hls::Mat<IMG_HEIGHT_OR_ROWS, IMG_WIDTH_OR_COLS, HLS_8UC1> HLS_MATUC1;
    HLS_MATUC1 imagenEntrada(IMG_HEIGHT_OR_ROWS, IMG_WIDTH_OR_COLS);
#pragma HLS dataflow
    hls::AXIvideo2Mat(inStream, imagenEntrada);
    hls::Mean(imagenEntrada);

 

 

But I'm getting this error:

 

@E [HLS-70] Compilation errors found:
HLS/core.cpp:24:2: error: no matching function for call to 'Mean'
        hls::Mean(imagenEntrada1);
        ^~~~~~~~~
/opt/Xilinx/Vivado_HLS/2015.4/include/hls/hls_video_arithm.h:1077:7: note: candidate template ignored: couldn't infer template argument 'DST_T'
DST_T Mean(
      ^
/opt/Xilinx/Vivado_HLS/2015.4/include/hls/hls_video_arithm.h:1086:7: note: candidate function template not viable: requires 2 arguments, but 1 was provided
DST_T Mean(
      ^
1 error generated.
Failed checking during preprocessing.
    while executing
"source /home/angel_doctorado/Escritorio/03/TDC_Conv2D_OpenCV/HLS/solution1/csynth.tcl"
    invoked from within
"hls::main /home/angel_doctorado/Escritorio/03/TDC_Conv2D_OpenCV/HLS/solution1/csynth.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 hls::main {*}$args"
    (procedure "hls_proc" line 5)
    invoked from within
"hls_proc $argv"

 

 

I really don't understand what I'm doing wrong.

 

Hope you can point me in the right direction, thank you very much!

 

Angel P.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Participant valato
Participant
1,577 Views
Registered: ‎09-29-2017

Re: hls::mean example error

Jump to solution
Did you try to store result in a variable?
unsigned char result = hls::Mean(imagenEntrada);
HLS is probably unable to find Mean definition with no return value.
----- Please mark the post as an answer "Accept as solution" in case it helped to solve your problem. Give kudos in case the post guided you to the solution.

View solution in original post

0 Kudos
2 Replies
Highlighted
Participant valato
Participant
1,578 Views
Registered: ‎09-29-2017

Re: hls::mean example error

Jump to solution
Did you try to store result in a variable?
unsigned char result = hls::Mean(imagenEntrada);
HLS is probably unable to find Mean definition with no return value.
----- Please mark the post as an answer "Accept as solution" in case it helped to solve your problem. Give kudos in case the post guided you to the solution.

View solution in original post

0 Kudos
1,186 Views
Registered: ‎07-05-2017

Re: hls::mean example error

Jump to solution
Hi Valato, indeed it was the problem. I didn't see your answer till now, sorry. Thank you very much for your attention.

For the newbies like myself and as Valato said, if we take a look at the mean function template:

template<typename DST_T, int ROWS, int COLS, int SRC_T>
DST_T hls::Mean( hls::Mat<ROWS, COLS, SRC_T>& src );

It tells us to store the function result in a variable with the type we choose (DST_T); I would recommend a float.

0 Kudos