Erode

The xFerode function finds the minimum pixel intensity in the 3x3 neighborhood of a pixel and replaces the pixel intensity with the minimum value.



API Syntax

template<int BORDER_TYPE, int SRC_T, int ROWS, int COLS,int NPC=1>
void xFerode(xF::Mat<SRC_T, ROWS, COLS, NPC> & _src_mat, xF::Mat<SRC_T, ROWS, COLS, NPC> & _dst_mat)

Parameter Descriptions

The following table describes the template and the function parameters.

Table 1. xFerode Function Parameter Descriptions
Parameter Description
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 options are XF_NPPC1 and XF_NPPC8 for 1 pixel and 8 pixel operations respectively.
_src_mat Input image
_dst_mat Output image

Resource Utilization

The following table summarizes the resource utilization of the Erosion function generated using Vivado HLS 2017.1 version tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA.

Table 2. xFerode Function Resource Utilization Summary
Name Resource Utilization
1 pixel per clock operation 8 pixel per clock operation
300 MHz 150 MHz
BRAM_18K 3 6
DSP48E 0 0
FF 342 653
LUT 351 1316
CLB 79 230

Performance Estimate

The following table summarizes a performance estimate of the Erosion function for Normal Operation (1 pixel) and Resource Optimized (8 pixel) configurations, generated using Vivado HLS 2017.1 tool for Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA.

Table 3. xFerode Function Performance Estimate Summary
Operating Mode Latency Estimate
Min (ms) Max (ms)

1 pixel (300 MHz)

7.0 7.0

8 pixel (150 MHz)

1.85 1.85