HDR Merge module generates the High Dynamic Range (HDR) image from a set of different exposure frames. Usually, image sensors has limited dynamic range and it’s difficult to get HDR image with single image capture. From the sensor, the frames are collected with different exposure times and will get different exposure frames. HDRMerge will generate the HDR frame with those exposure frames. The HDRMerge in RGB domain is complex and expensive interms of latency, because of camera response function. But,in Bayer domain the camera resonse function is linear. The radiance value which passes through the lens of the image sensor is converted into pixel intensity value. The camera response function relates the radiance value to pixel value. The CRF function in
here,
The CRF function f(x) linearly express as
To compute the weight in pixel value domain,
API Syntax
template <int SRC_T, int DST_T, int ROWS, int COLS, int NPC = 1, int NO_EXPS, int W_SIZE, int XFCVDEPTH_IN_1 = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_IN_2 = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_OUT = _XFCVDEPTH_DEFAULT>
void Hdrmerge_bayer(xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN_1>& _src_mat1,
xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN_2>& _src_mat2,
xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_OUT>& _dst_mat,
short wr_hls[NO_EXPS * NPC * W_SIZE])
The following table describes the template and the function parameters.
Parameter | Description |
---|---|
SRC_T | Input Pixel Type. |
DST_T | Output Pixel Type. |
ROWS | Maximum height of input and output image (Must be multiple of NPC) |
COLS | Maximum width of input and output image (Must be multiple of NPC) |
NPC | Number of Pixels to be processed per cycle. |
NO_EXPS | Number exposure frames to be merged in the module |
W_SIZE | W_SIZE is should be 2 power pixel width. |
XFCVDEPTH_IN_1 | Depth of the input image. |
XFCVDEPTH_OUT_1 | Depth of the output image. |
_src_mat1 | Short exposure frame |
_src_mat2 | Long exposure frame |
_dst_mat | Output HDR image |
wr_hls | Lookup table for weight values. Computing the weights LUT in host side and passing as input to the function.weight values are Q1.15 |
Resource Utilization
The following table summarizes the resource utilization in different configurations, generated using Vitis HLS 2021.1 tool for the xczu9eg-ffvb1156-2-e, to process a bayer HD image.
Operating Mode | Pixel Type | Operating Frequency (MHz) |
Utilization Estimate | ||||
---|---|---|---|---|---|---|---|
BRAM_18K | DSP | FF | LUT | CLB | |||
1 Pixel | 8bit | 300 | 2 | 8 | 5824 | 4886 | 1079 |
10bit | 300 | 2 | 8 | 5826 | 4919 | 1034 |
Performance Estimate
The following table summarizes the latency numbers in different configurations, generated using Vitis HLS 2021.1 tool for the xczu9eg-ffvb1156-2-e, to process a HD image.
Operating Mode | Operating Frequency (MHz) |
Latency Estimate |
---|---|---|
Max (ms) | ||
1 pixel | 300 | 7.3 |
2 pixel | 300 | 3.7 |