The meanStdDev
function computes the mean and standard deviation of
input image. The output Mean value is in fixed point Q8.8 format, and
the Standard Deviation value is in Q8.8 format. Mean and standard
deviation are calculated as follows:
API Syntax
template<int SRC_T,int ROWS, int COLS,int NPC=1, int XFCVDEPTH_IN = _XFCVDEPTH_DEFAULT>
void meanStdDev(xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN> & _src,unsigned short* _mean,unsigned short* _stddev)
Parameter Descriptions
The following table describes the template and the function parameters.
Parameter | Description |
---|---|
SRC_T | Input and Output pixel type. Only 8-bit, unsigned, 1 and 3 channels are supported (XF_8UC1 and XF_8UC3) |
ROWS | Number of rows in the image being processed. |
COLS | Number of columns in the image being processed. Must be a multiple of 8, for 8-pixel operation. |
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. |
XFCVDEPTH_IN | Depth of the input image. |
XFCVDEPTH_OUT | Depth of the output image. |
_src | Input image |
_mean | 16-bit data pointer through which the computed mean of the image is returned. |
_stddev | 16-bit data pointer through which the computed standard deviation of the image is returned. |
Resource Utilization
The following table summarizes the resource utilization of the meanStdDev function, generated using Vivado HLS 2019.1 tool for the Xczu9eg-ffvb1156-1-i-es1 FPGA, to process a grayscale HD (1080x1920) image.
Operating Mode | Operating Frequency (MHz) | Utilization Estimate | ||||
---|---|---|---|---|---|---|
BRAM_18K | DSP_48Es | FF | LUT | CLB | ||
1 pixel | 300 | 0 | 6 | 896 | 461 | 121 |
8 pixel | 150 | 0 | 13 | 1180 | 985 | 208 |
The following table summarizes the resource utilization of the meanStdDev function, generated using Vivado HLS 2019.1 tool for the Xczu9eg-ffvb1156-1-i-es1 FPGA, to process a 4K 3Channel image.
Operating Mode | Operating Frequency (MHz) | Utilization Estimate | ||||
---|---|---|---|---|---|---|
BRAM_18K | DSP_48Es | FF | LUT | CLB | ||
1 pixel | 300 | 0 | 7 | 5075 | 3324 | 725 |
Performance Estimate
The following table summarizes the performance in different configurations, as generated using Vivado HLS 2019.1 tool for the Xczu9eg-ffvb1156-1-i-es1, to process a grayscale HD (1080x1920) image.
Operating Mode | Latency Estimate |
---|---|
Max Latency | |
1 pixel operation (300 MHz) | 6.9 ms |
8 pixel operation (150 MHz) | 1.69 ms |