Gaussian Filter
The xFGaussianBlur function applies Gaussian blur on the input image.
Gaussian filtering is done by convolving each point in the input image with a Gaussian
kernel.
Where ,
are the mean values and
,
are the variances in x and y
directions respectively. In the GaussianBlur function, values of
,
are considered as zeroes and the
values of
,
are equal.
API Syntax
template<int FILTER_SIZE, int BORDER_TYPE, int SRC_T, int ROWS, int COLS, int NPC = 1>
void xFGaussianBlur(xF::Mat<SRC_T, ROWS, COLS, NPC> & src, xF::Mat<SRC_T, ROWS, COLS, NPC> & dst, float sigma)
Parameter Descriptions
The following table describes the template and the function parameters.
| Parameter | Description |
|---|---|
| FILTER_SIZE | Filter size. Filter size of 3 (XF_FILTER_3X3), 5 (XF_FILTER_5X5) and 7 (XF_FILTER_7X7) are supported. |
| BORDER_TYPE | Border type supported is XF_BORDER_CONSTANT |
| SRC_T | Input and output 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 values are XF_NPPC1 and XF_NPPC8 for 1 pixel and 8 pixel operations respectively. |
| src | Input image |
| dst | Output image |
| sigma | Standard deviation of Gaussian filter |
Resource Utilization
The following table summarizes the resource utilization of the Gaussian Filter in different configurations, generated using Vivado HLS 2017.1 version tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA, to progress a grayscale HD (1080x1920) image.
| Operating Mode | Filter Size |
Operating Frequency (MHz) |
Utilization Estimate | ||||
|---|---|---|---|---|---|---|---|
| BRAM_18K | DSP_48Es | FF | LUT | CLB | |||
| 1 pixel | 3x3 | 300 | 3 | 17 | 3641 | 2791 | 610 |
| 5x5 | 300 | 5 | 27 | 4461 | 3544 | 764 | |
| 7x7 | 250 | 7 | 35 | 4770 | 4201 | 894 | |
| 8 pixel | 3x3 | 150 | 6 | 52 | 3939 | 3784 | 814 |
| 5x5 | 150 | 10 | 111 | 5688 | 5639 | 1133 | |
| 7x7 | 150 | 14 | 175 | 7594 | 7278 | 1518 | |
Performance Estimate
The following table summarizes a performance estimate of the Gaussian Filter in different configurations, as generated using Vivado HLS 2017.1 tool for Xilinx Xczu9eg-ffvb1156-1-i-es11 FPGA, to process a grayscale HD (1080x1920) image.
| Operating Mode | Filter Size | Latency Estimate |
|---|---|---|
| Max Latency (ms) | ||
| 1 pixel operation (300 MHz) | 3x3 | 7.01 |
| 5x5 | 7.03 | |
| 7x7 | 7.06 | |
| 8 pixel operation (150 MHz) | 3x3 | 1.6 |
| 5x5 | 1.7 | |
| 7x7 | 1.74 |