Remap

The xFRemapfunction takes pixels from one place in the image and relocates them to another position in another image. Two types of interpolation methods are used here for mapping the image from source to destination image.

API Syntax

template void xFRemap (xF::Mat &_src_mat, xF::Mat &_remapped_mat, xF::Mat &_mapx_mat, xF::Mat &_mapy_mat, int interpolation=XF_INTERPOLATION_NN);

Parameter Descriptions

The following table describes the template parameters.

Table 1.xFRemap template Parameter Descriptions
Parameter Description
WIN_ROWS Number of input image rows to be buffered inside. Must be set based on the map data. For instance, for left right flip, 2 rows are sufficient.
SRC_T Input image type. Grayscale image of type 8-bits and single channel. XF_8UC1.
MAP_T Map type. Single channel float type. XF_32FC1.
DST_T Output image type. Grayscale image of type 8-bits and single channel. XF_8UC1.
ROWS Height of input and output images
COLS Width of input and output images
NPC Number of pixels to be processed per cycle; this function supports only XF_NPPC1 or 1 pixel per cycle operations.

The following table describes the function parameters.

Table 2.xFRemap Function Parameter Descriptions
PARAMETERS DESCRIPTION
_src_mat Input xF Mat
_remapped_mat Output xF Mat
_mapx_mat mapX Mat of float type
_mapy_mat mapY Mat of float type
interpolation Type of interpolation, either XF_INTERPOLATION_NN (nearest neighbor) or XF_INTERPOLATION_BILINEAR (linear interpolation)

Resource Utilization

The following table summarizes the resource utilization of xFRemap, for HD (1080x1920) images generated in theVivado HLS 2017.1version tool for the Xilinx xczu9eg-ffvb1156-i-es1 FPGA at 300 MHz, with WIN_ROWS as 64.

Table 3.xFRemap Function Resource Utilization Summary
Name Resource Utilization
BRAM_18K 128
DSP48E 14
FF 2064
LUT 2277
CLB 500

Performance Estimate

The following table summarizes the performance of xFRemap(), for HD (1080x1920) images generated in theVivado HLS 2017.1version tool for the Xilinx xczu9eg-ffvb1156-i-es1 FPGA at 300 MHz, with WIN_ROWS as 64.

Table 4.xFRemap Function Performance Estimate Summary
Operating Mode

Operating Frequency

(MHz)

Latency Estimate

Max latency (ms)

1 pixel mode 300 7.2