High Dynamic Range Experiments

What I did:

  1. Took three pretty crappy pictures through a dirty window of a not bad sunset. The pictures were taken using different EV light compensation values (-2.0, 0.0, 2.0). Normally one would just manually adjust the shutter speed instead to get the different light exposures, but my camera is just a simple point and shoot with limited features.
  2. Using some Java code I wrote, I loaded the pictures up and extracted the red, green, blue values into separate arrays.
  3. I added the arrays of the same colors together from the three images. Three is an arbitrary number. Any number of images would do as long as they concentrate on having the right light level for different areas of the picture. The idea (in my head anyways) is that the normal range for a given color is 256 levels. By taking multiple pictures at a different light levels then we increase the range. In the case of 3 images we have a potential range of 256 + 256 + 256 = 768 levels. In addition to a higher dynamic range, theoretically you should also have less noise since the noise will get averaged out slightly ( the more images the better in that case), which allows other techniques to be more effective (such as 'sharpening').
  4. Using Java code again that I wrote, I did a histogram equalization; and this is the important part - the equalization is done on the full 768 levels and the only way I could figure out how to do that was to write code to do it.
  5. Remapped the values back into 256 levels and output as image to be manipulated in other programs (I just used Picasa for the remaining steps).
  6. Increased the color saturation and applied sharpening ( which is more effective now on the less noisy image).

The result, while still crappy, is a nice proof of concept as it is considerably better. I used to think of HDR as 'cheating', but now I think that really it is just compensating for the lack of dynamic range of the camera itself. The actual sunset looked much closer to the HDR image to my eyes than the other three. Our eyes have an incredible dynamic range compared to a digital camera.

Part 2

Another example ... this time I cleaned the window first :) I used Picturenaut for these, which is a free program. I tried my technique and it worked pretty well except that I was using one of those flexible tripods and so I still moved a little bit between shots. Picturenaut knows how to line up the images, while my simple technique just stacks one on top of the other resulting in image-destroying blurring. I like how my technique seem to show the foreground better. In Picturenaut the foreground is basically black, whereas in mine you could actually see the houses. However, Picturenaut's ability to line up the images made its end result superior by far.

Overall HDR is great, and again I don't consider it cheating since cameras have a very narrow dynamic range which does not match what our eyes see. One way to compensate is to control the lighting, (which is what most professional photographers do when they can). Essentially this flattens the real range to be within the range of the camera. Another approach is to take several images at different exposures and use software to put it all together. One day cameras will come with HDR capability built in and of course the native sensor dynamic range will continue to improve. Until then, manual techniques combined with software is a good approach.