HDR Merge - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

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

HDRIMG1

here, HDRIMG2

The CRF function f(x) linearly express as

HDRIMG3

To compute the weight in pixel value domain,

HDRIMG4

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.

Table 526 Table HDRmerge Parameter Description
Parameter Description
SRC_T Input pixel type. XF_8UC1 ,XF_8UC3 are supported
DST_T Input pixel type. XF_8UC1 ,XF_8UC3 are supported
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; possible options are XF_NPPC1,XF_NPPC2,XF_NPPC4 and XF_NPPC8 for 1,2,4 pixel and 8 pixel operations respectively.
NO_EXPS Number exposure frames to be merged in the module.”2” is supported
W_SIZE W_SIZE should be 2 power pixel width.
USE_URAM Enable to map storage structures to UltraRAM.
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.

Table 527 Table HDRMerge Resource Utilization Summary
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.

Table 528 Table HDRMerge Latency Summary
Operating Mode

Operating Frequency

(MHz)

Latency Estimate
Max (ms)
1 pixel 300 7.3
2 pixel 300 3.7