cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
greenleafone7
Observer
Observer
301 Views
Registered: ‎10-23-2020

Example project using OpenCV not working

I am following this official documentation (Page 49: Getting Started with HLS) to test OpenCV.

After Building and Simulating though I am receiving this error

ERROR: [HLS 200-70] Compilation errors found: In file included from xfopencv/examples/harris/xf_harris_accel.cpp:1:
In file included from xfopencv/examples/harris/xf_harris_accel.cpp:30:
In file included from xfopencv/examples/harris/xf_harris_config.h:37:
In file included from /home/esmerald/Documents/conv2d/testerinio/xfopencv/include/common/xf_common.h:34:
/home/esmerald/Documents/conv2d/testerinio/xfopencv/include/common/xf_structs.h:403:33: warning: unknown attribute 'xcl_array_geometry' ignored [-Wattributes]
    DATATYPE *data __attribute((xcl_array_geometry((ROWS)*(COLS>> (xfNPixelsPerCycle<NPC>::datashift)))));
                                ^
In file included from xfopencv/examples/harris/xf_harris_accel.cpp:1:
xfopencv/examples/harris/xf_harris_accel.cpp:34:55: error: use of undeclared identifier 'XF_USE_URAM'
    xf::cornerHarris<3,3,1,XF_8UC1,2160,3840,XF_NPPC1,XF_USE_URAM>(_src, _dst, Thresh, k);
                                                      ^
xfopencv/examples/harris/xf_harris_accel.cpp:34:72: error: expected ')'
    xf::cornerHarris<3,3,1,XF_8UC1,2160,3840,XF_NPPC1,XF_USE_URAM>(_src, _dst, Thresh, k);
                                                                       ^
xfopencv/examples/harris/xf_harris_accel.cpp:34:67: note: to match this '('
    xf::cornerHarris<3,3,1,XF_8UC1,2160,3840,XF_NPPC1,XF_USE_URAM>(_src, _dst, Thresh, k);
                                                                  ^
xfopencv/examples/harris/xf_harris_accel.cpp:34:68: error: C++ requires a type specifier for all declarations
    xf::cornerHarris<3,3,1,XF_8UC1,2160,3840,XF_NPPC1,XF_USE_URAM>(_src, _dst, Thresh, k);
                                                                  ~^
1 warning and 3 errors generated.
Failed during preprocessing.
    while executing
"source /home/esmerald/Documents/conv2d/testerinio/test/solution1/csynth.tcl"
    invoked from within
"hls::main /home/esmerald/Documents/conv2d/testerinio/test/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"
Finished C synthesis.

 

 

 

 

 

 

 

 

 

 

I am using version 2020.1.1 on Linux. Does anyone know what this problem means and how can I go about using OpenCV in Vivado?

Tags (1)
0 Kudos
1 Reply
greenleafone7
Observer
Observer
288 Views
Registered: ‎10-23-2020

By having a look at the following file I managed to Synthesize the project but even though I have opencv installed I can't seem to Simulate it.

 

Compiling ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp in debug mode
csim.mk:74: recipe for target 'obj/xf_dilation_tb.o' failed
In file included from ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_headers.h:62:0,
                 from ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:33:
../../../../xfopencv/include/common/xf_sw_utils.h: In function ‘xf::Mat<T, ROWS, COLS, NPC> xf::imread(char*, int)’:
../../../../xfopencv/include/common/xf_sw_utils.h:58:22: error: ‘imread’ is not a member of ‘cv’
   cv::Mat img_load = cv::imread(img,type);
                      ^~
../../../../xfopencv/include/common/xf_sw_utils.h:58:22: note: suggested alternative:
../../../../xfopencv/include/common/xf_sw_utils.h:56:38: note:   ‘xf::imread’
  xf::Mat<_PTYPE, _ROWS, _COLS, _NPC> imread(char *img,  int type){
                                      ^~~~~~
../../../../xfopencv/include/common/xf_sw_utils.h: In function ‘void xf::imwrite(const char*, xf::Mat<T, ROWS, COLS, NPC>&)’:
../../../../xfopencv/include/common/xf_sw_utils.h:80:4: error: ‘imwrite’ is not a member of ‘cv’
    cv::imwrite(str,input);
    ^~
../../../../xfopencv/include/common/xf_sw_utils.h:80:4: note: suggested alternative:
../../../../xfopencv/include/common/xf_sw_utils.h:73:7: note:   ‘xf::imwrite’
  void imwrite(const char *str, xf::Mat<_PTYPE, _ROWS, _COLS, _NPC> &output){
       ^~~~~~~
../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp: In function ‘int main(int, char**)’:
../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:54:12: error: ‘imread’ is not a member of ‘cv’
  in_gray = cv::imread(argv[1], 0);
            ^~
../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:54:12: note: suggested alternative:
In file included from ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_headers.h:62:0,
                 from ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:33:
../../../../xfopencv/include/common/xf_sw_utils.h:56:38: note:   ‘xf::imread’
  xf::Mat<_PTYPE, _ROWS, _COLS, _NPC> imread(char *img,  int type){
                                      ^~~~~~
../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:92:3: error: ‘imwrite’ is not a member of ‘cv’
   cv::imwrite("out_ocv.jpg", ocv_ref);
   ^~
../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:92:3: note: suggested alternative:
In file included from ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_headers.h:62:0,
                 from ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:33:
../../../../xfopencv/include/common/xf_sw_utils.h:73:7: note:   ‘xf::imwrite’
  void imwrite(const char *str, xf::Mat<_PTYPE, _ROWS, _COLS, _NPC> &output){
       ^~~~~~~
../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:133:2: error: ‘imwrite’ is not a member of ‘cv’
  cv::imwrite("out_error.jpg", diff);
  ^~
../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:133:2: note: suggested alternative:
In file included from ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_headers.h:62:0,
                 from ../../../../xfopencv/HLS_Use_Model/Standalone_HLS_Example/xf_dilation_tb.cpp:33:
../../../../xfopencv/include/common/xf_sw_utils.h:73:7: note:   ‘xf::imwrite’
  void imwrite(const char *str, xf::Mat<_PTYPE, _ROWS, _COLS, _NPC> &output){
       ^~~~~~~
make: *** [obj/xf_dilation_tb.o] Error 1
ERR: [SIM 100] 'csim_design' failed: compilation error(s).
INFO: [SIM 3] *************** CSIM finish ***************

 

I am pretty sure imread is part of OpenCV.

 

0 Kudos