WarpPerspective
The xFperspective function performs the perspective transformation on the
image. It takes inverse transformation as input and applies perspective transformation with
a 3x3 matrix.
Calculate the input position corresponding to every output pixel as following:
API Syntax
template< int INTERPOLATION_TYPE ,int SRC_T, int ROWS, int COLS,int NPC>
void xFperspective(xF::Mat<SRC_T, ROWS, COLS, XF_NPPC8> & _src_mat,xF::Mat<SRC_T, ROWS, COLS, XF_NPPC8> & _dst_mat,float *transformation_matrix)
Parameter Descriptions
The following table describes the template and the function parameters.
| Parameter | Description |
|---|---|
| INTERPOLATION_TYPE |
Interpolation technique to be used XF_INTERPOLATION_NN - Nearest Neightbour XF_INTERPOLATION_BILINEAR - Bilinear |
| SRC_T | Input pixel type. Only 8-bit, unsigned, 1 channel is supported (XF_8UC1) |
| ROWS | Maximum height of input and output image (must be a multiple of 8) |
| COLS | Maximum width of input and output image (must be a multiple of 8) |
| NPC | Number of pixels to be processed per cycle; possible options are XF_NPPC1 and XF_NPPC8 for 1 pixel and 8 pixel operations respectively. |
| _src_mat | Input image |
| _dst_mat | Output image |
| transformation_matrix | Inverse Perspective Transformation matrix |
Resource Utilization
The following table summarizes the resource utilization of the kernel in different configurations, generated using Vivado HLS 2017.1 tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA, to process a grayscale HD (1080x1920) image for Bilinear interpolation.
|
Name |
Resource Utilization | |
|---|---|---|
| 1 pixel | 8 pixel | |
| 300 MHz | 150 MHz | |
| BRAM_18K | 223 | 233 |
| DSP48E | 191 | 293 |
| FF | 17208 | 14330 |
| LUT | 14458 | 18969 |
| CLB | 3230 | 3876 |
Performance Estimate
The following table summarizes the performance of kernel for different configurations, as generated using Vivado HLS 2017.1 tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1, to process a grayscale HD (1080x1920) image for Bilinear interpolation.
| Operating Mode |
Operating Frequency (MHz) |
Latency Estimate |
|---|---|---|
| Max (ms) | ||
| 1 pixel | 300 | 19.3 |
| 8 pixel | 150 | 15.5 |