54 #include "../include/xf_warp_transform_config.h"
63 hls::stream<float> &sTxMatrix
66 if(!sTxMatrix.empty()){
69 transform_matrix[i] = sTxMatrix.read();
84 ap_uint<INPUT_PTR_WIDTH>* img_in,
float* transform, ap_uint<OUTPUT_PTR_WIDTH>* img_out,
int rows,
int cols) {
86 const int pCOLS =
WIDTH;
87 const int pNPC1 =
NPIX;
89 xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX> imgInput(
rows,
cols);
91 #pragma HLS stream variable=imgInput.data depth=2
93 xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX> imgOutput(
rows,
cols);
95 #pragma HLS stream variable=imgOutput.data depth=2
103 float transform_matrix[9];
105 for (
unsigned int i = 0; i < 9; ++i) {
109 transform_matrix[i] = transform[i];
112 xf::cv::Array2xfMat<INPUT_PTR_WIDTH, TYPE, HEIGHT, WIDTH, NPC1>(img_in, imgInput);
114 XF_USE_URAM>(imgInput, imgOutput, transform_matrix);
115 xf::cv::xfMat2Array<OUTPUT_PTR_WIDTH, XF_8UC1, HEIGHT, WIDTH, NPIX>(imgOutput, img_out);
118 #ifndef FAKE_WarpTransform
130 hls::stream<ap_uint<INPUT_PTR_WIDTH>>& img_in_axi_stream,
131 hls::stream<ap_uint<OUTPUT_PTR_WIDTH>>& img_out_axi_stream,
135 #pragma HLS INLINE off
137 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> imgInput(
rows,
cols);
139 #pragma HLS stream variable=imgInput.data depth=2
142 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> imgOutput(
rows,
cols);
144 #pragma HLS stream variable=imgOutput.data depth=2
154 accel_utils accel_utils_obj;
156 int dstMat_cols_align_npc = ((imgInput.cols + (
NPIX - 1)) >> XF_BITSHIFT(
NPIX)) << XF_BITSHIFT(
NPIX);
162 XF_USE_URAM>(imgInput, imgOutput, transform_matrix);
164 int srcMat_cols_align_npc = ((imgOutput.cols + (
NPIX - 1)) >> XF_BITSHIFT(
NPIX)) << XF_BITSHIFT(
NPIX);
167 srcMat_cols_align_npc);
180 hls::stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> >& img_in_axi_stream,
181 hls::stream<ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0> >& img_out_axi_stream,
182 unsigned int min_rx_loops,
183 unsigned int min_tx_loops,
186 #pragma HLS INLINE off
188 ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> tmp_in;
189 ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0> tmp_out;
190 for (
unsigned int i=0, j=0, k=0; k < 5 * (min_rx_loops + min_tx_loops); k++) {
191 cout <<
"Consuming input...i=" << i << endl;
192 if (!img_in_axi_stream.empty() && (i < min_rx_loops)) {
193 tmp_in = img_in_axi_stream.read();
197 tmp_out.data = tmp_in.data;
198 cout <<
"Filling output...j=" << j << endl;
199 if (!(img_out_axi_stream.full()) && (j < min_tx_loops)) {
200 img_out_axi_stream.write(tmp_out);
204 if (j == min_tx_loops) {
205 cout <<
"Full" << endl;
227 hls::stream<float> &sTxMatrix
230 #pragma HLS INLINE off
232 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> imgInput(
rows,
cols);
234 #pragma HLS stream variable=imgInput.data depth=4
237 #ifndef FAKE_WarpTransform
238 xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> imgOutput(
rows,
cols);
240 #pragma HLS stream variable=imgOutput.data depth=4
255 xf::cv::Array2xfMat<MEMDW_512, XF_8UC1, HEIGHT, WIDTH, NPIX>(img_inp, imgInput);
257 #ifdef FAKE_WarpTransform
259 xf::cv::xfMat2Array<MEMDW_512, XF_8UC1, HEIGHT, WIDTH, NPIX>(imgInput, img_out);
264 XF_USE_URAM>(imgInput, imgOutput, transform_matrix);
267 xf::cv::xfMat2Array<MEMDW_512, XF_8UC1, HEIGHT, WIDTH, NPIX>(imgOutput, img_out);