Wednesday, March 10, 2010

Activity 4 - High Dynamic Range Imaging

Cameras have a limited capability of accurately mapping the variation of light irradiances coming from a scene. Intensity values used to represent the irradiance captured by the camera are usually truncated, resulting to either the lowest or the highest value of digitization by the camera. Even if there is a difference between the light emanating from two different points on the scene, it may be mapped with the same intensity value, if the camera is saturated in this range. This is the reason why very bright and very dark parts of a scene could not be imaged with enough information to see most of its details.
High dynamic range (HDR) imaging is a technique of accurately mapping the irradiance map of a scene. The basic principle of this process is that by taking multiple images of the same scene with different exposures, a higher range of irradiances is captured. By combining the accurately mapped irradiance values (parts without saturation of intensity values) into a single image, a higher dynamic range image is formed.
Usually, HDR is applied for aesthetic and commercial purposes. A more accurate image can be constructed so that it can be appreciated even after the scene has changed. The human eyes have a larger dynamic range compared to cameras so the scene as viewed by an individual can be preserved in HDR images. HDR also have research applications. Irradiance maps are stored in HDR images. The amount of radiation emitted by a source or specimen of interest can be recovered in HDR.
In this activity, the algorithm of Debevec and Malik [1] for HDR is employed. The initial step is to find the transfer function of the camera. The transfer function describes how the camera translates the amount of irradiance it has detected to an intensity value (0-255 for an 8-bit camera channel) given an exposure time. In their paper, they provided a function for determining this. The input for the function is the log of the exposure times used to capture the scene. Intensity values are sampled from the images captured at each exposure times. By least-squares minimization, the transfer function is easily obtained using these inputs. The output is actually the log of the inverse of the transfer function of the camera.
Transfer function of red, green and blue camera channels

Once the transfer function is obtained, a simple mapping of irradiance for each pixel is performed. This process basically utilizes a backprojection procedure. Since the transfer function is known, the intensity value at an exposure time can be indexed in the transfer function to obtain the irradiance that it represents.
The whole process can be done for each channel of the camera (RGB) obtaining the transfer function for each channel. A weighting function is also introduced in the steps of least-squares minimization and backprojection. The weights provide a bias in the range where the intensity values of each image is accurately mapped, because the mapping is more accurate for intensity values far from the extremes (such as 0 and 255), or along the middle of the intensity range.
The output matrix of the algorithm should have high range of values. Most displays still have low dynamic range so there is still a limitation of viewing HDR images. Tone mapping should be applied to HDR images so that it can be displayed in low dynamic range monitors.

Set of images of a plasma taken at different exposure times

Colormap of the intensity of high dynamic range image of plasma

Histogram of high dynamic range image of plasma

From the outputs shown above, it can be seen that a high dynamic range image is obtained. The range of values now exceeds the range of pixel values of the camera (0 to 255), as seen in the colormap map and the histogram of the HDR image. Moreover, the values are no longer discrete. By inspecting the HDR image values, each pixel have decimal place values. This demonstrates the additional information contained in HDR images.
The values of the pixels are only relative values to irradiance. A calibration procedure should first be done to determine the actual irradiance of the object or scene. The calibration can be done by imaging a light source with emittance power that is already known.

(To be continued)

Reference:
[1] P. Debevec, J. Malik, "Recovering high dynamic range radiance maps from photographs," Proceedings of the 24th annual conference on Computer graphics and interactive techniques, pages 369–378, August, 1997.

No comments:

Post a Comment