Color correction matrix algorithm converts the input image color format to output image color format using the colorcorrection matrix provided by the user (CCM_TYPE).
API Syntax
template <int SRC_T, int DST_T, int ROWS, int COLS, int NPC = 1, int XFCVDEPTH_IN_1 = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_OUT_1 = _XFCVDEPTH_DEFAULT>
void colorcorrectionmatrix(xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN_1>& _src_mat,
xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_OUT_1>& _dst_mat
signed int ccm_matrix[3][3],
signed int offsetarray[3])
Parameter Descriptions
The following table describes template parameters and arguments of the function.
| Parameter | Description |
|---|---|
| SRC_T | Input pixel type. 8/10/12/16-bit unsigned, 3 channel are supported (XF_8UC3, XF_10UC3, XF_12UC3, XF_16UC3). |
| DST_T | Output pixel type. 8/10/12/16-bit unsigned, 3 channel are supported (XF_8UC3, XF_10UC3, XF_12UC3, XF_16UC3). |
| ROWS | Maximum height of input and output image |
| COLS | Maximum width of input and output image. In case of N-pixel parallelism, width should be multiple of N. |
| NPC | Number of pixels to be processed per cycle; possible options is XF_NPPC1, XF_NPPC2 AND so on |
| XFCVDEPTH_IN_1 | Depth of input image |
| XFCVDEPTH_OUT_1 | Depth of output image |
| _src_mat | Input image |
| _dst_mat | Output image |
| ccm_matrix | ccm_matrix Computed as (signed int)(ccm_matrix_float * 1048576) |
| offsetarray | offsetarray Computed as (signed int)(offsetarray_float * 1048576) |
Resource Utilization
The following table summarizes the resource utilization of the kernel in different configurations, generated using Vitis HLS 2020.2 tool, to process a FULL HD image.
| Operating Mode | Operating Frequency (MHz) | Utilization Estimate | ||||
|---|---|---|---|---|---|---|
| BRAM_18K | DSP_48Es | FF | LUT | CLB | ||
| 1 pixel-8U | 300 | 0 | 9 | 283 | 254 | 73 |
| 1 pixel-16U | 300 | 0 | 9 | 353 | 239 | 75 |
Performance Estimate
The following table summarizes a performance estimate of the kernel in different configurations, as generated using Vitis HLS 2020.2 tool, to process a FULL HD image.
| Operating Mode | Operating Frequency (MHz) | Latency Estimate Max (ms) |
|---|---|---|
| 1 pixel | 300 | 7 |
| 2 pixel | 300 | 3.6 |