Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no matching function for call to 'erode" #18

Open
lochoang75 opened this issue Mar 9, 2019 · 3 comments
Open

no matching function for call to 'erode" #18

lochoang75 opened this issue Mar 9, 2019 · 3 comments

Comments

@lochoang75
Copy link

lochoang75 commented Mar 9, 2019

I try to build example same as tutorial and document but i got some problem with argument in xf: :erode, xf::dilate with wrong matching function call.
error log:
/home/fallinlove/SDx_workspace/opencvsample/src/colordetect_accel.cpp:24:2: error: no matching function for call to 'erode'
xf::erode<XF_BORDER_CONSTANT, XF_8UC1, HEIGHT, WIDTH, XF_NPPC1>(_range, _erode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fallinlove/SDx_workspace/opencvsample/libs/xfopencv/include/imgproc/xf_erosion.hpp:323:6: note: candidate function template not viable: requires 3 arguments, but 2 were provided
void erode (xf::Mat<TYPE, ROWS, COLS, NPC> & _src, xf::Mat<TYPE, ROWS, COLS, NPC> & _dst,unsigned char _kernel[K_ROWSK_COLS])
^
/home/fallinlove/SDx_workspace/opencvsample/src/colordetect_accel.cpp:25:2: error: no matching function for call to 'dilate'
xf::dilate<XF_BORDER_CONSTANT, XF_8UC1, HEIGHT, WIDTH, XF_NPPC1>(_erode, _dilate1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fallinlove/SDx_workspace/opencvsample/libs/xfopencv/include/imgproc/xf_dilation.hpp:318:6: note: candidate function template not viable: requires 3 arguments, but 2 were provided
void dilate (xf::Mat<TYPE, ROWS, COLS, NPC> & _src, xf::Mat<TYPE, ROWS, COLS, NPC> & _dst,unsigned char _kernel[K_ROWS
K_COLS])
^
/home/fallinlove/SDx_workspace/opencvsample/src/colordetect_accel.cpp:26:2: error: no matching function for call to 'dilate'
xf::dilate<XF_BORDER_CONSTANT, XF_8UC1, HEIGHT, WIDTH, XF_NPPC1>(_dilate1, _dilate2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fallinlove/SDx_workspace/opencvsample/libs/xfopencv/include/imgproc/xf_dilation.hpp:318:6: note: candidate function template not viable: requires 3 arguments, but 2 were provided
void dilate (xf::Mat<TYPE, ROWS, COLS, NPC> & _src, xf::Mat<TYPE, ROWS, COLS, NPC> & _dst,unsigned char _kernel[K_ROWSK_COLS])
^
/home/fallinlove/SDx_workspace/opencvsample/src/colordetect_accel.cpp:27:2: error: no matching function for call to 'erode'
xf::erode<XF_BORDER_CONSTANT, XF_8UC1, HEIGHT, WIDTH, XF_NPPC1>(_dilate2, _dst);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fallinlove/SDx_workspace/opencvsample/libs/xfopencv/include/imgproc/xf_erosion.hpp:323:6: note: candidate function template not viable: requires 3 arguments, but 2 were provided
void erode (xf::Mat<TYPE, ROWS, COLS, NPC> & _src, xf::Mat<TYPE, ROWS, COLS, NPC> & _dst,unsigned char _kernel[K_ROWS
K_COLS])
^
ERROR: [SdsCompiler 83-5005] clang exited with non-zero code processing /home/fallinlove/SDx_workspace/opencvsample/src/colordetect_accel.cpp
sds++ log file saved as /home/fallinlove/SDx_workspace/opencvsample/Release/_sds/reports/sds_colordetect_accel.log
ERROR: [SdsCompiler 83-5004] Build failed

src/subdir.mk:21: recipe for target 'src/colordetect_accel.o' failed
make: *** [src/colordetect_accel.o] Error 1

15:43:25 Build Finished (took 17s.858ms)

@csjedi1
Copy link

csjedi1 commented Apr 4, 2019

The code in this tutorial in not correct. Please have a look at the source code of function erode, it is defined as:
void erode (xf::Mat<TYPE, ROWS, COLS, NPC> & _src, xf::Mat<TYPE, ROWS, COLS, NPC> & _dst,unsigned char _kernel[K_ROWS*K_COLS])
There are 3 parameters in the function, however the code in the tutorial only calls the erode with 2 parameters. You should edit the code to as following:

xf::erode<XF_BORDER_CONSTANT, XF_8UC1, HEIGHT, WIDTH, XF_SHAPE_RECT, 3,3,1,XF_NPPC1>(_range, _erode,kernal);

Add the 3rd parameter in the function call, the varialbe kernal is a 3*3 matrix, and I set all the element value to 1

@sgrace-xlnx
Copy link

Are you using the tutorial with the 2018.3 release of the reVISION platform and xfOpenCV library? If so, then you'd be needing to stay with the 2018.2 release of the platform and library. The tutorial is getting a major rework right now for 2018.3. The xfOpenCV library had gotten some major work done in 2018.3 with the function definitions and as you pointed out the kernel parameter.

@lochoang75
Copy link
Author

Thanks for your help. I have already seen that difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants