54 #include "../include/xf_sobel_config.h"
72 hls::stream<ap_uint<INPUT_PTR_WIDTH>>& img_in_axi_stream,
73 hls::stream<ap_uint<OUTPUT_PTR_WIDTH>>& img_out_axi_stream,
76 #pragma HLS INLINE off
78 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> imgInput(
rows,
cols);
80 #pragma HLS stream variable=imgInput.data depth=2
83 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> imgOutput(
rows,
cols);
85 #pragma HLS stream variable=imgOutput.data depth=2
92 accel_utils accel_utils_obj;
94 int dstMat_cols_align_npc = ((imgInput.cols + (
NPIX - 1)) >> XF_BITSHIFT(
NPIX)) << XF_BITSHIFT(
NPIX);
98 xf::cv::medianBlur<WINDOW_SIZE, XF_BORDER_REPLICATE, TYPE, HEIGHT, WIDTH, NPC1>(imgInput, imgOutput);
100 int srcMat_cols_align_npc = ((imgOutput.cols + (
NPIX - 1)) >> XF_BITSHIFT(
NPIX)) << XF_BITSHIFT(
NPIX);
103 srcMat_cols_align_npc);
116 hls::stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> >& img_in_axi_stream,
117 hls::stream<ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0> >& img_out_axi_stream,
118 unsigned int min_rx_loops,
119 unsigned int min_tx_loops) {
121 #pragma HLS INLINE off
126 ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> tmp_in;
127 ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0> tmp_out;
128 for (
unsigned int i=0, j=0, k=0; k < 5 * (min_rx_loops + min_tx_loops); k++) {
129 cout <<
"Consuming input...i=" << i << endl;
130 if (!img_in_axi_stream.empty() && (i < min_rx_loops)) {
131 tmp_in = img_in_axi_stream.read();
135 tmp_out.data = tmp_in.data;
136 cout <<
"Filling output...j=" << j << endl;
137 if (!(img_out_axi_stream.full()) && (j < min_tx_loops)) {
138 img_out_axi_stream.write(tmp_out);
142 if (j == min_tx_loops) {
143 cout <<
"Full" << endl;
165 #pragma HLS INLINE off
167 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> imgInput(
rows,
cols);
169 #pragma HLS stream variable=imgInput.data depth=2
173 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> _dstgx(
rows,
cols);
175 #pragma HLS stream variable=_dstgx.data depth=2
177 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> _dstgy(
rows,
cols);
179 #pragma HLS stream variable=_dstgy.data depth=2
188 xf::cv::Array2xfMat<MEMDW_512, XF_8UC1, HEIGHT, WIDTH, NPIX>(img_inp, imgInput);
192 xf::cv::xfMat2Array<MEMDW_512, XF_8UC1, HEIGHT, WIDTH, NPIX>(imgInput, img_out1);
194 xf::cv::xfMat2Array<MEMDW_512, XF_8UC1, HEIGHT, WIDTH, NPIX>(imgInput, img_out2);
204 xf::cv::xfMat2Array<MEMDW_512, XF_8UC1, HEIGHT, WIDTH, NPIX>(_dstgx, img_out1);
206 xf::cv::xfMat2Array<MEMDW_512, XF_8UC1, HEIGHT, WIDTH, NPIX>(_dstgy, img_out2);
void medianBlurAccelStream(hls::stream< ap_uint< 256 >> &img_in_axi_stream, hls::stream< ap_uint< 256 >> &img_out_axi_stream, int rows, int cols)
Top-level accelerated function of the Sobel Application with array I/Fadd SOBEL.
void sobelAccelMem(membus_t *img_inp, membus_t *img_out1, membus_t *img_out2, int rows, int cols)
Top-level accelerated function of the Sobel Application with memory mapped interfaces.
void fakeSobelAccelStream(hls::stream< ap_axiu< 256, 0, 0, 0 > > &img_in_axi_stream, hls::stream< ap_axiu< 256, 0, 0, 0 > > &img_out_axi_stream, unsigned int min_rx_loops, unsigned int min_tx_loops)