Xilinx / xfopencv

Other
328 stars 143 forks source link

Symbol 'Array2xfMat' could not be resolved #33

Closed microlijun closed 5 years ago

microlijun commented 5 years ago

Hi, I want to computes the histogram of given input image and put the output into a Mat. But I got error: 'Symbol 'Array2xfMat' could not be resolved'

   `unsigned int *g_hist;
xf::Mat<XF_8UC1, HEIGHT, WIDTH, XF_NPPC1> &hist;
xf::calcHist<XF_8UC1, HEIGHT, WIDTH, XF_NPPC1>(input_img,g_hist);
xf::Array2xfMat< 8,XF_8UC1, HEIGHT, WIDTH, XF_NPPC1>(g_hist, hist);`
bgouthamb commented 5 years ago

xf::Array2xfMat is defined in _xfutility.h file.

For this function to work, the memory allocation for the input pointer should be equal to the size of the input xf::Mat.

microlijun commented 5 years ago

xf::Array2xfMat is defined in _xfutility.h file.

For this function to work, the memory allocation for the input pointer should be equal to the size of the input xf::Mat.

The output of xf::calcHist is an array of 256 elements, so xf::Mat<XF_8UC1, 256, 1, XF_NPPC1> &hist; xf::calcHist<XF_8UC1, HEIGHT, WIDTH, XF_NPPC1>(input_img,g_hist); xf::Array2xfMat< 8,XF_8UC1, 256, 1, XF_NPPC1>(g_hist, hist);

But still, "Invalid argumen"

bgouthamb commented 5 years ago

You have specified the PTR_WIDTH as 8, but passing a 32-bit pointer. You need to call it as: xf::Array2xfMat< 32, XF_8UC1, 256, 1, XF_NPPC1>(g_hist, hist);