Remap - 2024.1 English

Vitis Libraries

Release Date
2024-05-30
Version
2024.1 English
The remap function 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.
image146

API Syntax

template<int WIN_ROWS,int INTERPOLATION_TYPE, int SRC_T, int MAP_T, int DST_T, int ROWS, int COLS, int NPC = 1, bool USE_URAM=false, int XFCVDEPTH_IN = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_Remapped = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_MAPX = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_MAPY = _XFCVDEPTH_DEFAULT>

void remap (xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN> &_src_mat,
         xf::cv::Mat<DST_T, ROWS, COLS, NPC, XFCVDEPTH_Remapped> &_remapped_mat,
         xf::cv::Mat<MAP_T, ROWS, COLS, NPC, XFCVDEPTH_MAPX> &_mapx_mat,
         xf::cv::Mat<MAP_T, ROWS, COLS, NPC, XFCVDEPTH_MAPY> &_mapy_mat);

Parameter Descriptions

The following table describes the template parameters.

Table 705 Table . remap 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.
INTERPOLATIO N_TYPE Type of interpolation, either XF_INTERPOLATION_NN (nearest neighbor) or XF_INTERPOLATION_BILINEAR (linear interpolation)
SRC_T Input image pixel type. Only 8-bit, unsigned, 1 and 3 channels are supported (XF_8UC1 and XF_8UC3)
MAP_T Map type. Single channel float type. XF_32FC1.
DST_T Output image pixel type. Only 8-bit, unsigned, 1 and 3 channels are supported (XF_8UC1 and XF_8UC3)
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.
USE_URAM Enable to map some structures to UltraRAM instead of BRAM.
XFCVDEPTH_IN Depth of the input image.
XFCVDEPTH_Remapped Depth of the output image.
XFCVDEPTH_MAPX Depth of the input image.
XFCVDEPTH_MAPY Depth of the output image.

The following table describes the function parameters.

Table 706 Table . remap Parameter Description
PARAMETERS DESCRIPTION
_src_mat Input xF Mat
_remapped_m at Output xF Mat
_mapx_mat mapX Mat of float type
_mapy_mat mapY Mat of float type

Resource Utilization

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

Table 707 Table . remap Function Resource Utilization Summary
Name Resource Utilization
BRAM_18K 64
DSP48E 17
FF 1738
LUT 1593
CLB 360

The following table summarizes the resource utilization of remap, for 4K (3840x2160) images generated in the Vivado HLS 2019.1 version tool for the Xilinx xczu7ev-ffvc1156 FPGA at 300 MHz, with WIN_ROWS as 100 for the XF_INTERPOLATION_BILINEAR mode using UltraRAM .

Table 708 Table . remap Function Resource Utilization Summary with UltraRAM Enabled
Name Resource Utilization
BRAM_18K 3
DSP48E 10
URAM 24
FF 3196
LUT 3705

Performance Estimate

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

Table 709 Table . remap Function Performance Estimate Summary
Operating Mode

Operating Frequency

(MHz)

Latency Estimate

Max latency (ms)

1 pixel mode 300 7.2