Gradient Phase
The xFphase function computes the polar angles
of two images. The input images are x-gradient and y-gradient images of type 16S. The output
image is of same type as the input image.
For radians:
For degrees:
API Syntax
template<int RET_TYPE ,int SRC_T,int DST_T, int ROWS, int COLS,int NPC=1 >
void xFphase(xF::Mat<SRC_T, ROWS, COLS, NPC> & _src_matx,xF::Mat<DST_T, ROWS, COLS, NPC> & _src_maty,xF::Mat<DST_T, ROWS, COLS, NPC> & _dst_mat)
Parameter Descriptions
The following table describes the template and the function parameters.
| Parameter | Description |
|---|---|
| RET_TYPE | Output format can be either in radians or degrees. Options are XF_RADIANS or
XF_DEGREES.
|
| SRC_T | Input pixel type. Only 16-bit, signed, 1 channel is supported (XF_16SC1) |
| DST_T | Output pixel type. Only 16-bit, signed, 1 channel is supported (XF_16SC1) |
| 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_matx | First input, x-gradient image. |
| _src_maty | Second input, y-gradient image. |
| _dst_mat | Output, phase computed image. |
|
|
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-es11 FPGA, to process a grayscale HD (1080x1920) image.
| Name | Resource Utilization | |
|---|---|---|
| 1 pixel | 8 pixel | |
| 300 MHz | 150 MHz | |
| BRAM_18K | 6 | 24 |
| DSP48E | 6 | 19 |
| FF | 873 | 2396 |
| LUT | 753 | 3895 |
| CLB | 185 | 832 |
Performance Estimate
The following table summarizes the performance of the kernel in 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.
| Operating Mode |
Operating Frequency (MHz) |
Latency Estimate (ms) |
|---|---|---|
| 1 pixel | 300 | 7.2 |
| 8 pixel | 150 | 1.7 |
Deviation from OpenCV
In xFphase implementation, the output is returned in a fixed point format. If XF_RADIANS option is selected, xFphase API will return result in Q4.12 format. The output range is (0, 2 pi). If XF_DEGREES option is selected, xFphase API will return result in Q10.6 degrees and output range is (0, 360);