pyrDown
function is an image down-sampling algorithm which
smoothens the image before down-scaling it. The image is smoothened
using a Gaussian filter with the following kernel:Down-scaling is performed by dropping pixels in the even rows and the
even columns. The resulting image size is .
API Syntax
template<int TYPE, int ROWS, int COLS, int NPC, bool USE_URAM=false, int XFCVDEPTH_IN = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_OUT = _XFCVDEPTH_DEFAULT>
void pyrDown (xf::cv::Mat<TYPE, ROWS, COLS, NPC, XFCVDEPTH_IN> & _src, xf::cv::Mat<TYPE, ROWS, COLS, NPC, XFCVDEPTH_OUT> & _dst)
Parameter Descriptions
The following table describes the template and the function parameters.
Parameter | Description |
---|---|
TYPE | Input and Output pixel type. Only 8-bit, unsigned, 1 and 3 channels are supported (XF_8UC1 and XF_8UC3) |
ROWS | Maximum Height or number of input rows to build the hardware for this kernel |
COLS | Maximum Width or number of input columns to build the hardware for this kernel |
NPC | Number of pixels to process per cycle. Currently, the kernel supports only 1 pixel per cycle processing (XF_NPPC1). |
USE_URAM | Enable to map storage structures to UltraRAM |
XFCVDEPTH_IN | Depth of the input image. |
XFCVDEPTH_OUT | Depth of the output image. |
_src | Input image stream |
_dst | Output image stream |
Resource Utilization
The following table summarizes the resource utilization of pyrDown for 1 pixel per cycle implementation, for a maximum input image size of 1920x1080 pixels. The results are after synthesis in Vivado HLS 2019.1 for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA at 300 MHz.
Operating Mode | Operating Frequency (MHz) |
Utilization Estimate | |||
---|---|---|---|---|---|
LUTs | FFs | DSPs | BRAMs | ||
1 Pixel | 300 | 1171 | 1238 | 1 | 5 |
The following table summarizes the resource utilization of pyrDown for 1 pixel per cycle implementation, for a maximum input image size of 4K with BGR image. The results are after synthesis in Vivado HLS 2019.1 for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA at 300 MHz.
Operating Mode | Operating Frequency (MHz) |
Utilization Estimate | |||
---|---|---|---|---|---|
LUTs | FFs | DSPs | BRAMs | ||
1 Pixel | 300 | 2158 | 1983 | 2 | 30 |
The following table summarizes the resource utilization of pyrDown for 1 pixel per cycle implementation, for a maximum input image size of 3840x2160 pixels. The results are after synthesis in Vivado HLS 2019.1 for the Xilinx xczu7eg-ffvb1156-1 FPGA at 300 MHz with UltraRAM enabled.
Operating Mode | Operating Frequency (MHz) |
Utilization Estimate | ||||
---|---|---|---|---|---|---|
LUTs | FFs | DSPs | BRAMs | URAM | ||
1 Pixel | 300 | 1171 | 1243 | 0 | 0 | 1 |
Performance Estimate
The following table summarizes performance estimates of pyrDown function in Vivado HLS 2019.1 for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA.
Operating Mode | Operating Frequency (MHz) |
Input Image Size | Latency Estimate |
---|---|---|---|
Max (ms) | |||
1 pixel | 300 | 1920x1080 | 6.99 |