Histogram Computation
calcHist function computes the histogram of
given input image. Where, H is the array of 256 elements.
API Syntax
template<int SRC_T,int ROWS, int COLS,int NPC=1>
void calcHist(xF::Mat<SRC_T, ROWS, COLS, NPC> & _src, uint32_t *histogram)
Parameter Descriptions
The following table describes the template and the function parameters.
| Parameter | Description |
|---|---|
| SRC_T | Input 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 |
| _src | Input image |
| histogram | Output array of 256 elements |
Resource Utilization
The following table summarizes the resource utilization of the calcHist function for Normal Operation (1 pixel) and Resource Optimized (8 pixel) configurations, generated using Vivado HLS 2017.1 version tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA at 300 MHz for 1 pixel case and at 150 MHz for 8 pixel mode.
| Name | Resource Utilization | |
|---|---|---|
|
Normal Operation (1 pixel) |
Resource Optimized (8 pixel) |
|
| BRAM_18K | 2 | 16 |
| DSP48E | 0 | 0 |
| FF | 196 | 274 |
| LUT | 240 | 912 |
| CLB | 57 | 231 |
Performance Estimate
The following table summarizes a performance estimate of the calcHist function for Normal Operation (1 pixel) and Resource Optimized (8 pixel) configurations, generated using Vivado HLS 2017.1 version tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA at 300 MHz for 1 pixel and 150 MHz for 8 pixel mode.
| Operating Mode | Latency Estimate |
|---|---|
| Max (ms) | |
| Normal Operation | 6.9 |
| Resource Optimized | 1.7 |