This function converts the input xf::cv::Mat to output array. The output of the xf::kernel function will be xf::cv::Mat, and it will require to convert that to output pointer. xfMat2Array supports line stride. Line stride is the number of pixels which needs to be added to the address in the first pixel of a row in order to access the first pixel of the next row.
//Without Line stride support
template <int PTR_WIDTH, int MAT_T, int ROWS, int COLS, int NPC, int XFCVDEPTH = _XFCVDEPTH_DEFAULT, int FILLZERO = 1>
void xfMat2Array(xf::cv::Mat<MAT_T,ROWS,COLS,NPC,XFCVDEPTH>& srcMat, ap_uint< PTR_WIDTH > *dstPtr)
//With Line stride support
template <int PTR_WIDTH, int MAT_T, int ROWS, int COLS, int NPC, int XFCVDEPTH = _XFCVDEPTH_DEFAULT, int FILLZERO = 1>
void xfMat2Array(xf::cv::Mat<MAT_T,ROWS,COLS,NPC,XFCVDEPTH>& srcMat, ap_uint< PTR_WIDTH > *dstPtr, int stride)
Parameter | Description |
---|---|
PTR_WIDTH | Data width of the output pointer. The value must be power 2, from 8 to 512. |
MAT_T | Input Mat type. Example XF_8UC1, XF_16UC1, XF_8UC3 and XF_8UC4 |
ROWS | Maximum height of image |
COLS | Maximum width of image |
NPC | Number of pixels computed in parallel. Example XF_NPPC1, XF_NPPC8 |
XFCVDEPTH | Depth of the Input image. |
FILLZERO | Line padding Flag. Use when line stride support is needed. Default value is 1 |
dstPtr | Output pointer. Type of the pointer based on the PTR_WIDTH. |
srcMat | Input image of type xf::cv::Mat |
stride | Line stride. Default value is srcMat.cols |