Abstract
Nature light has a dynamic range beyond the modern camera can capture. So lots of commercial software applies techniques to reconstruct high dynamic range (HDR) image from low dynamic range (LDR) images. One of the popular methods is to recover the radiance of scene from LDR stacks [2]. However it needs to know the exact exposure time of LDR images and costs much time to solve the camera response function. These defects make it impossible to be built in hardware or real time systems. In this paper, we propose a new technique to synthesize HDR image based on the intensity mapping function (IMF). We first solve the IMF based on cross-histogram map, and then synthesize the pixel values from LDRs as if they have the same exposure time. We test our technique on several demos and get satisfying results with good visual quality in bright and dark scenes. Besides, because our method costs less time than the ‘software’ method, it is more suitable for further hardware application.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
- Intensity mapping function
- Spatially varying pixel exposure
- High dynamic range image
- Contrast-preserving tone-mapping operator
1 Introduction
Nowadays, high dynamic range (HDR) image technology draws lots of attention from researchers and groups all around the world. The real scenes in the nature often have a range of light variance much broader than 255, thus causing the conventional cameras not able to capture the whole range in only a single shot. Scenes including both bright reflection and dark shadows are always difficult for photographers to capture. So, kinds of software develop the post-processing methods to synthesize HDR images for those photographers.
Promoted by the prosperity of HDR imaging, lots of commercial software and image signal processing (ISP) hardware develop the function to get HDR images. Among them, ‘software’ methods always recover the HDR scene radiances from a stack of low dynamic range images (LDRs) exposed at different periods. For example, [1, 2] solves camera response function (CRF) first, and then weights and sums the LDRs together, [3] fuses different LDRs together utilizing some characters such as contrast, saturation and exposure time, [4] averages float LDR pixel values by specially designed weighting function, [6] takes an original image with high resolution but low dynamic range as input, and generates an output image with extended dynamic range by applying the trade-off between the image resolution and the dynamic range, [14] develops a linear relation between with two LDRs and then fuse them together to a HDR one based on the linear function and [16] uses the gradient information of the visible regions and recovers the saturated regions by the energy minimization approach. However, always limited by time cost and delays, ‘ISP’ methods are less than ‘software’ methods and need specially design. One of them first gets the exposure ratio k by dividing the high exposure time by low exposure time as k = e1/e2, and then multiplies the low exposed pixels by the exposure ratio. The whole synthesis equation can be written as XHDR = Xlow*k + Xhigh. However, this method has some drawbacks, such as bad fidelity and low brightness.
In this paper, we propose an algorithm to synthesize HDR image based on the logarithm intensity mapping function (IMF), which denotes the relation between intensity values of same pixel location from LDRs. We first calibrate the logarithm IMF curve using least square method and then get HDR image by weighting and summing the mapped intensities from LDRs. To eliminate ghosting of HDR and avoid aligning LDR images, we capture different exposed images using spatially varying pixel exposures (SVEs) in one shot. Thus, we develop a low-computational-cost and ISP-suited method to synthesize HDR image. To illustrate the main method, the rest parts of our paper are organized as follows. In Sect. 2, the basic theories of HDR imaging are introduced such as camera response function, intensity mapping function, SVE and cross-histogram. Section 3 outlines theoretical framework of our main algorithm including the solving of IMF and the designing of weighting function. The experiment results are presented in Sect. 4 and the further discussions are included in Sect. 5.
2 Basic Knowledge of High Dynamic Imaging Work
In work [2, 10], the acquisition model of camera has been proposed. Given the scene radiance L, the irradiance E reach into the camera can be derived by E = epL, where e is the exposure and p is an optical factor. The exposure e can be further expressed as e = (πd2)t, where t is the exposure time and d is the aperture size. Then, the pixel value X of image and irradiance E are related by the non-linear camera response function (CRF) f expressed as:
And works [2, 4] hold the point view that obtaining the HDR image is a matter of recovering scene radiance E from the intensity values X by reverse response function g:
Finally, the obtained HDR pixel value Xi is expressed as follows in [2, 4].
In the above equation, w (i, j) is a weighting function, i is the index of pixel and j is the index of differently exposed image.
To solve out the reverse camera response function g, kinds of methods are utilized. The primary method makes use of uniformly illuminated chart with known reflectance patches and computes the function g based on the relationship between illumination and intensity value. However this method appears inconvenient for most situations. So, chart-free methods are introduced such as sampling and fitting [2], solving intensity mapping function (IMF) τ instead [5] and so on. These CRF-based methods are practical when built in software, but hardly applicable to real time system due to its huge computational cost and time delay.
To establish our method, IMF τ is deployed instead of function g. In two differently exposed LDR images, the intensity value in the corresponding pixel location can be paired together as (X1, X2), where X1 is from low exposure and X2 denotes is from high exposure. The number of these pairs is expressed as J(X1, X2) and shown in the figure called cross-histogram (see Fig. 2). And function τ well describes the relation between values X1, and X2. In [5], it has the expression as
Some important properties of IMF τ are as follows from [5]:
-
τ(0) = 0
-
τ monotonically increases
-
X <=τ (X)
-
\( \mathop {\lim }\limits_{n \to \infty } \tau^{ - n} (X) = 0 \)
As explained in [5], due to quantization and saturation of the pixel value, the cross-histogram curve may seem not so smooth and monotonic increasing as the theory describes. So it introduces accumulative histogram function and obtains the IMF τ. Different with algorithm from [5], we assume IMF have a logarithm formation and propose a fitting algorithm to calibrate the intensity mapping function after a partition of cross-histogram. Further on, we develop a weighting function and utilize it with IMF to construct HDR image. In the end, we test our algorithm on computer and get satisfying HDR image. The detail algorithm will be included in the following chapters and we will show that our algorithm is a better alterative suiting real-time ISP hardware system.
3 Algorithm to Construct HDR Image
We divide our method into several sections. Section 3.1 introduces our technology to get LDRs. Section 3.2 includes the algorithm to solving the intensity mapping function from the cross-histogram. The methods to synthesis HDR image based on the IMF is shown in Sect. 3.3. Section 3.4 takes a tone-mapping strategy to show HDR image on LDR screen.
3.1 Acquisition of Spatially Varying Pixel Exposures
Spatially varying pixel exposure (SVE) has been introduced by many CMOS systems and used in differently-exposed frames acquisition. To obtain SVEs, optical masks with spatially varying transmittance are put adjacent to the CMOS sensor (see Fig. 1a). And different number of pixels in one pattern can be applied in different CMOS systems. The optical masks control the amount of light transmits through them and producing differently exposed frames in one shot [8, 9]. With SVEs, we easily acquire the different exposed images. And thanks to the short duration of one shot, the effect of object motion and scene motion can be eliminated and thus avoid the global alignment before synthesis. Here, we make use of SVE masks with two different-exposed pixels in one pattern and obtain two frames, one long exposure and one short exposure, in one shot (see Fig. 1b).
3.2 Recovery of Intensity Mapping Function
The Grossberg’s Algorithm.
The cross-histogram of two different exposures contains all information to construct the intensity mapping function as proved in [5]. The function τ can be derived from the image’s cumulative histogram called H(x) which denotes the number of pixels with value between 0 and x. Given the continuous histogram function h(x) which indicates the number of pixels with intensity value x, H(x) can be solved by:
Actually the histogram function h(x) is discrete, so the above integration needs to be turned to accumulation. After the accumulation, the corresponding pixel values X1 and X2 from the same pixel location of two images have the following relation as (6) shows. It implies the numbers of pixels with smaller values than them is exactly the same [5].
And from IMF, we get \( X_{2} = \tau (X_{1} ) \). Then, substituting it into (6) yields
Supposing X is arbitrary value from the low exposure, IMF τ can be derived from reverse function of H as follows.
The Partitioning and Fitting Algorithm.
We first partition the cross-histogram into different parts and propose to calibrate the logarithm IMF in some of the parts. In [14], it illustrates a linear J-function which has similar sub-parts and properties with parts of IMF. Here we extend the partition strategy of J-function and apply it to our IMF. Partition of the cross-histogram is shown in Fig. 2b and explanations are as follows.
-
Part I. This part is named the low exposed zone. In this zone, the pixels’ abscissa values are almost the same and near a constant. These low abscissa values mean they are in the dark scene and lack of exposure in low exposed image. However, their ordinate values are not constants because they are exposed in a long period in the high exposed image.
-
Part II. We name this part the appropriate exposed zone. In this part, the abscissa value and ordinate value are both variables. Because this part of both images expose appropriately and the pixels here contains most information of the scene.
-
Part III. We call this part the noise zone. In this part, the pixel values are disperse from the ‘main curve’ due to the photoelectron noise and intensity quantization.
-
Part IV. We name this part the over exposed zone. Pixels in this part have the same ordinate values nearly 255. However, because exposed appropriately in low exposed image, the abscissa values are less than saturation.
We see that the low-exposed zone and over-exposed zone both loss some information from the scene. In reality, when exposed at a short period, the dark scene can’t be recognized, and when exposed at long period, the bright scene may show saturation and noising. The aim of HDR imaging is to include these dark and bright parts in one image by recover the intensity values from other zones. In one sense, the pixel values from zone I and IV are not reliable due to noise, so we chose zone II and III to recover the intensity mapping function. Different from [14], we extend the noise zone and then use a denoising method to make the data useful in this area.
Because all the values are discrete in the cross-histogram image, so we apply a fitting strategy to calibrate the curve that best satisfy the IMF in a least square error sense. And to recover the function means recovering a finite number of pixel values that satisfy X2 = τ(X1) in the range of (0, 255). To achieve it, we assume the IMF has a logarithm formation and solve the least squares problem in zone II and III. Here, we give the form of the function that
And we have the objective function written as:
In the objective function, xi denotes the abscissa value and yi denotes the ordinate value.
In it, ε1 and ε2 are the threshold values of zone II and III. To solve the function, we need to denoise the values in the zone III. Here we take a ‘denoising procedure’ by getting together the pixels have the same abscissa value X and then arranging their ordinate values from small to large. To get the “denoised” value Y, we get the middle 10 ordinate values and average them. This way, we eliminate the noised pixels in zone III and at the same time reduce the number of pixels involved in the later procedure from thousands to less than 255 (see Fig. 3a).
Then, to minimize the objective function in (10), we apply derivation on both sides and then solve the linear equations to get the two parameters. And the curve and the pixel values after fitting are shown in Fig. 3b. We see that in zone II and III, the logarithm curve fit the pixel values well.
3.3 HDR Imaging Based on the Intensity Mapping Function
After the recovery of IMF, we apply a weighting algorithm to the dark and bright scene in LDR images and synthesize the different exposures together to HDR image. As we know, the low exposure includes the information of saturated scene and the high exposure includes the information of dark scene, so we proposed to fuse these parts together based on the intensity mapping function. In [14], it proposed the zone I, II and III of high exposure contain the needed information of scene and try to fuse the zone IV of low exposure to high exposure linearly.
Here, we first map the zone IV from low exposure to the high exposure by substituting the pixel values to IMF. Given the intensity value of low exposure Xlow, we have the value after mapping written as:
Second, we develop a weighting function to fuse the different zone together. In the low exposure, the information in zone IV is weighted 1, while information in other zones is weighted 0. In the high exposure, information in zone I, II and III are weighted 1, while the other is weighted 0. In order to make the transition from zone III to IV smoother, we give the weighting function an S-shape increasing (and decreasing) between the intervals. The weighting functions W1 and W2 are shown below, in which \( \xi \) is the dividing value of zone III and IV. ε and α are the parameters which define the width of transition zone and can be manually changed to improve the visual sense.
Then, we take the weighted average of the intensity value from the high exposure and “mapped” low exposure to get the result, HDR intensity value. This procedure can be expressed as follows:
By the above procedures, we build up a pixel level synthesis algorithm to construct a HDR image from different SVEs. The LDR images and corresponding HDR images (tone-mapping operators are applied on HDRs) are shown in Figs. 5 and 6.
To extend our algorithm to synthesize more LDR images, we would like to choose a mid-exposed image as a reference map. Then, we obtain the IMF between the LDR stacks with the reference respectively and synthesize high dynamic stacks. Last, we weight and accumulate the HDR stack to a final HDR image (see Fig. 4). Although more LDRs are needed to get satisfied HDR image, we choose two LDRs for use because the time delay of hardware increases greatly due to the large LDR stack.
3.4 A Contrast-Preserving Tone-Mapping Operator
The aim of tone-mapping is to preserve contrast, brightness and details of a HDR image which is shown on a typical 255-intensity-level screen [11]. Here we use a global contrast-preserving mapping operator to reduce the intensity levels to 255.
First we normalize the pixel intensity from (0, Xmax) to (0, 1) by applying the equation:
After normalization, the pixel values all become float numbers. Then we take a few steps to apply the multipeak histogram equalization operator from [12] to enhance the contrast while compress the intensity value.
The algorithm in [12] detects N breakpoints {d1, d2 … dN} and N + 1 peaks of the histogram. Then the histogram B is divided into N + 1 subsections based on the breakpoints which can be expressed as:
For each Bj, the probability density function can be written as follows [15], where i denotes the index of peak and j denotes the index of intensity level:
Then the histogram equalization process is applied separately to each of the peaks of histogram. The cumulative intensity function is written as follows:
After the multipeak histogram equalization, the intensity levels of each peak are spread out between the breakpoints. Lastly, we extend the range of intensity value from (0, 1) to (0, 255). This way, we can preserve the contrast and compress the intensity levels.
4 Experiment Results
We test our algorithm on variety of scenes and then compare the HDR images with results from method of [2] and [6]. The respective low dynamic stacks are taken in different exposure time while other settings of camera are kept static during a shot.
In Fig. 5 the ‘office’ pictures which are taken under different exposures are shown in the first line. The low exposed image has dark areas in indoor scene like the book shelf and desk, while the high exposed image has saturated areas in the outdoor scene such as the tree and road. Shown in the second line, our HDR image has appropriately recovered missing information in LDRs. To contrast with the HDR image from our algorithm, the third line and fourth line show the ‘software’ results from [2] and [6]. Figure 6 shows another stack of images which include castles in bright light. In the first line are two LDRs, the second line is our HDR image while the third and last line are the ‘software’ results. In all our and [2] ’s HDR images, the missing areas clearly reappear and remain high contrast. However, some images based on [6] ’s method reappear with high quality, while some other images with excessive bright parts may have an even brighter appearance due to the summation of the intensity without any distinguish with pixels, and thus cause losing of some information.
The experiment results suggest that our HDR images can keep good or even better visual quality than those ‘software’ results. In fact, our method needs not to know the exact exposure time of the LDR stacks and thus becomes more convenient to photographers. Another advantage is the low time cost, mostly because our technology needs not to resolve the camera response function, which is always the most time-costly part. (In fact, the method from [6] has similar running time as ours, but it trades the quality of HDR picture (see Figs. 5 and 6’s details) for fast speed. So we didn’t satisfy with the method even the running time is short.) We simulate both algorithm on the same computer and show the running time in Table 1. (We run the MATLAB code of our own and from [2] respectively.) Table 1 demonstrates different size of images varies greatly in the computational time. To construct a better HDR image with more texture and higher contrast, higher-resolution LDR images are needed. Totally, our IMF-based method shows a time-cost superiority towards ‘software’ method. Thus, our algorithm is expected to be more suitable to build in the graphic hardware in the future. In addition, it makes capturing of HDR videos possible with an ordinary camera.
5 Conclusion and Discussion
HDR imaging has been a popular subject in the machine vision field in the past years. Lots of software techniques have been proposed to synthesize HDR image using a bracket of low dynamic exposures. However, most of them need to resolve the overdetermined camera response function and thus cost a lot of time. So we propose to synthesize HDR images based on the intensity mapping function. And then we apply a contrast-preserving tone-mapping operator to turn the intensity level range to (0, 255). Totally, our algorithm shows advantages of less computational cost to the ‘software’ methods and thus more suitable to be built in real-time ISP hardware.
In the future work, we would like to develop better denoising algorithm which can eliminate unreliable pixels and increase HDR’s SNR in the dark and saturated areas. Also, we would like to investigate different tone-mapping techniques to maintain better texture and more details.
References
Mei, Y., Qiu, G.: Recovering high dynamic range radiance maps from photographs revisited: a simple and important fix. In: 2013 Seventh International Conference on Image and Graphics (2013)
Debevec, P.E., Malik, J.: Recovering high dynamic range radiance maps from photographs (1997)
Mertens, T., Kautz, J., Van Reeth, F.: Exposure fusion-a simple and practical alternative to high dynamic rang photography. Comput. Graph. Forum 28(1), 161–171 (2009)
Mann, S., Picard, R.W.: On being ‘Undigital’ with digital cameras: extending dynamic range by combining differently exposed pictures. In: 48th Annual Conference, Cambridge (1995)
Grossberg, M.D., Nayar, S.K.: Determining the camera response from images: what is knowable. IEEE Trans. Pattern Anal. Mach. Intell. 25(11), 1455–1467 (2003)
Lin, H.-Y., Huang, J.-W.: Extended dynamic range imaging: a spatial down sampling approach. In: IEEE International Conference on Systems, Man, and Cybernetics, San Diego, CA, USA, 5–8 October 2014
Sakaue, S, Tamura, A., Nakayama, M., Maruno, S.: Adaptive gamma processing of the video cameras for the expansion of the dynamic range. In: IEEE Manuscript Received, 12 June 1995
Hirakawa, K., Simon, P.M.: Single-shot high dynamic range imaging with conventional camera hardware. In: IEEE International Conference on Computer Vision (2011)
Aguerrebere, C., Almansa, A., Gousseau, Y.: Single shot high dynamic range imaging using piecewise linear estimators
Aguerrebere, C., Delon, J., Gousseau, Y., Muse, P.: Study of the digital camera acquisition process and statistical modeling of the sensor raw data (2013)
Qian, T.L., Shafie, S., Saripan, M.I.: A local tone mapping operator for high dynamic range images. In: IEEE (2011)
Wongsritong, K., Kittayaruasiriwat, K., Cheevasuvit, F., Dejhan, K., Somboonkaew, A.: Contrast enhancement using multipeak equalization with brightness preserving. In: IEEE (1998)
Vytla, L., Hassan, F., Carletta, J.E.: A real-time implementation of gradient domain high dynamic range compression using a local poisson. Solver. J. Real-Time Image Proc. 8, 153–167 (2013)
Shen, G.-Q.: Wide dynamic range algorithm design based on the image signal processor. In: Dissertation for the Master Degree in Engineering, Harbin Institute of Technology (2012)
Ooi, C.H., Kong, S.P.: Bi-histogram equalization with a plateau limit for digital image enhancement. IEEE Trans. Consum. Electron. 55(4), 2072–2080 (2009)
Cho, W.-H., Ki-Sang, H.: Extending dynamic range of two color images under different exposures. In: International Conference on Pattern Recognition (ICPR) (2005)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Zhang, S., Zhang, S., Cheng, H., Jiang, C. (2015). Synthesis of High Dynamic Range Image Based on Logarithm Intensity Mapping Function. In: Zhang, YJ. (eds) Image and Graphics. Lecture Notes in Computer Science(), vol 9219. Springer, Cham. https://doi.org/10.1007/978-3-319-21969-1_38
Download citation
DOI: https://doi.org/10.1007/978-3-319-21969-1_38
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-21968-4
Online ISBN: 978-3-319-21969-1
eBook Packages: Computer ScienceComputer Science (R0)