<< Chapter < Page | Chapter >> Page > |
Since no consumer-grade digital cameras can produce HDR images (of say 32-bits per color channel), how can one get an HDR image to manipulate?
One can estimate an HDR image by combining multiple images across a wide dynamic range. For example, by averaging an overexposed and an underexposed image of the exact same scene, one gets a low-contrast image containing more data of the scene than either of the previous images. This is because each image added information to the scene--the overexposed image adds details in the shadows, while the underexposed image adds details in the highlights.
These example images would be combined to generate the HDR image by some method, as described below:
So, the development of the simplest algorithm to generate an HDR image was rather simple--it is just a straight average of all the source LDR images multiplied by the factor difference between the LDR bitrate and the HDR bitrate. This can be viewed as a straight averaging function, like:
where is the ith input color matrix, H is the HDR bitrate (say ), L is the LDR bitrate (say ), and N is the number of input images. Please also note that bringing the division factor inside the summation is necessary in the real algorithm, as otherwise the resulting value could have overflow and produce inaccurate results.
Now, while we cannot view this directly since we can't visualize the HDR image on conventional displays, we can use a simple tone-mapping operator to view the HDR image mapped back down to LDR. Using the Quantizing Operator, we get this result for using averaging of the input images:
While this produces decent results given the input images, we think we could help the tone-mapping operators by generating the HDR image with the largest possible dynamic range, and thus most information. The next consideration was an upsampling technique, where randomly determined ranges were interpolated differently. That is, a similar averaging technique was used, but instead of using the raw input color data, it was shifted in a random manner, to be either higher or lower in brightness. So after multiplying by the difference of the ranges given by the HDR and LDR bitrates, a random number was added on the same order. This could be thought of something like:
where is the ith input color matrix, H is the HDR bitrate (say ), L is the LDR bitrate (say ), x is a lower bound coefficient (0.75), y is an upper bound coefficient (1.25), rand generates a random integer between the two inputs, and N is the number of input images.
Again using the Quantizing Operator, we get this result for using upsampling of the input images:
This lead to the final algorithm, a weighted average, that put more emphasis on certain input images if their average luminances fell into certain ranges (with the upsampling from above also included). For example, if an image is pure white, it probably doesn't contain much useful information, so that image should have less of an impact on the final HDR image. Another thought was also that the middle-tone images probably contain the most overall information, so they should be weighted more highly. This algorithm is piecewise and thus harder to write in a standard form, so please look in the source code section for how this works.
Again using the Quantizing Operator, we get this result for using a weighted average of the input images:
While these images all look very similar, the weighted average does produce the best results in terms of the histogram. The weighted average generally seemed to perform better for the shadows and blow out more highlights than the others, but a histogram comparison clearly shows it is superior. Despite this, given how similar the results of each creation algorithm are, it did not play much in actually tone-mapping the HDR image back down to a displayable LDR range. So, while the goal was to try to help the tone-mapping algorithms by producing the best HDR image possible, it did not have much of a visible effect for any resulting algorithm.
Now, we should explore how the real work happens, in pulling more information from the HDR image to create the best LDR image possible; that is, the one with the highest dynamic range.
Notification Switch
Would you like to follow the 'Elec 301 projects fall 2006' conversation and receive update notifications?