Pyramid Down - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English
The 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:
image89

Down-scaling is performed by dropping pixels in the even rows and the even columns. The resulting image size is image90.

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.

Table 597 Table . pyrDown Parameter Description
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.

Table 598 Table . pyrDown Function Resource Utilization Summary
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.

Table 599 Table . pyrDown Function Resource Utilization Summary
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.

Table 600 Table . pyrDown Function Resource Utilization Summary 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.

Table 601 Table . pyrDown Function Performance Estimate Summary
Operating Mode

Operating Frequency

(MHz)

Input Image Size Latency Estimate
Max (ms)
1 pixel 300 1920x1080 6.99