Sunday, 23 November 2014

Forensics - High Dynamic Range Imaging (HDRI)

Dynamic Range and HDRI
Typically high dynamic range comes into play on a bright, sunny day.  A camera's dynamic range cannot cope with the full range of light intensity from details captured in deep shade to details in highlights under such lighting conditions.  For those who are not very familiar with Dynamic Range and High Dynamic Range Imaging (HDRI) here is a really nice video that will quickly bring you up to speed.

Scope and Objective
If you open any field guide and look at the plates, the illustrator in almost every case has chosen to depict a bird as it might appear under ideal, neutral and relatively low intensity lighting.  Most birders, starting out would find the challenge of bird identification made all the more difficult due to the ever-changing nature of normal ambient light.  If ones first experience of birding were a day in the field on a sunny winter's day, it might well turn out to be ones last experience of birding, such is the added challenge posed by the often harsh, forbidding light conditions in winter!  

The diagram above hopefully illustrates the potential use of HDRI for forensic image analysis.  From the perspective of bird identification from digital images, we hope to use HDRI to bring the lighting in an image more in line with the ideal lighting we are familiar with from illustrated field guides.

HDRI Using Exposure Bracketing
Most HDR images are created by using exposure bracketing to make three or more exposures in quick succession with different exposure times, designed to capture three discrete exposure brackets within the dynamic range of a scene.  When I photographed the subject of the next few images it was a wonderful day for birding, except that, due to the time of year, the sun was never very high in the sky and the light was very harsh at times.  In other words, the ambient lighting exceeded the dynamic range of the camera.  I grabbed three exposures of this Robin Erithacus rubecula sitting on a black-capped white pillar late late in the afternoon.  These were created using exposure bracketing.  Due to the camera's limited dynamic range, the light was too contrasting, and consequently none of these exposures worked out great.  The bird was stood facing the sun, so from the point of view of the camera the bird was side lit.  This image most closely matches the lower of the four images displayed above and is a good candidate for HDRI.

What would it be like to combine the three bracketed exposures, extract the good bits of each exposure and disregard the bits that are either over or underexposed?  Well that is the whole basis of HDRI.  The goal is to try and flatten out the contrast in the image, bring up the detail of the parts of the bird that are currently in shade, and subdue the brightness and saturation of those bits that are in full sun.
Using Adobe Elements Photomerge tool I have attempted to create a HDR image from these three exposures.  But, it has not worked out.  Why?  In the milliseconds it took to create the three exposures I moved the camera and the bird also moved.  This is a common problem with HDR images and the main reason why many people don't bother trying to create and use them.  Well there is an alternative solution.  

We know that RAW format images contain a lot of hidden detail.  Why not create multiple exposures using one RAW image file?  The three images to the left below were all created from the same RAW image.  All of their image settings are identical with the exception of exposure.  I adjusted exposure to roughly match the exposures I had made in the field.  I have now combined them in Photomerge to create a HDR image from them.
Here is a comparison between the original JPEG and the HDR image made from RAW.
The main difference between these images is a reduction in contrast in the HDR image.  A HDR image is the scene's dynamic range compressed to fit within the dynamic range of the camera / display device.  In turn, this more closely matches, or rather mimics the dynamic range of the human visual system.  While this hasn't quite flattened the image to the point that it might appear ideally lit, there is certainly a marked improvement.  It is much easier to appreciate fine details and subtle colours throughout the tonal range of the subject from highlights to shadows.  

Could this HDR image have been created from RAW following the normal RAW work flow from a single image, without the need for all of this multiple-exposure merging?  The short answer is yes!  Further down I have done just that.  But there is a bit more digging to be done first, so please keep reading.

HDRI versus a Contrast Tool
As we have seen, the major change brought about in a HDR image when compared with an original JPEG is in the contrast of the image, what is the difference between HDRI and simple Contrast tools?  Here are a couple of images comparing HDRI and the Contrast Tools in Adobe Elements and Camera Raw.
I made the above comparison image using the 256 tonal grid I had used earlier for the Adobe Lighting Tools posting (HERE).  The HDR image (created from the three images on the right) and Contrast Tool set to maximum contrast reduction (-50) look quite similar but the histograms show there is a bit more going on in the HDRI image.  As noted in the posting linked above, the exposure tool in Adobe Elements doesn't treat brightening and darkening of an image in quite the same way.  Darkening an image produces a flatter histogram than an equivalently lightened image, for whatever reason.  This possibly accounts for the jumbled HDRI histogram.  So, perhaps exposures created using Elements do not make the best example.

The HDRI and Contrast images below have both been created from RAW so that is possibly a more valid comparison than one made in Elements.  The HDR image and the image created by merely flattening contrast certainly look much more similar and their histograms support that conclusion.  The HDR image just looks that little bit more compressed.

This image emphasises the clear link between HDRI and simple Contrast tools.  A Contrast tool can be used to create a rudimentary HDRI image.  For a nice example comparing a HDRI image with one obtained using a simple contrast tool skip to the end of the page linked HERE.  Clearly, if done right, a HDRI image produces much better tonal detail and vibrant colours.

HDRI versus a RAW work flow
As the image above illustrates, most of the work done by Photomerge could have been replicated by simply using the contrast slider in Camera Raw.  So where is the added benefit in creating multiple exposures and combining them using a bespoke HDRI software?  That is certainly a legitimate question and one I have sought to address below.

HDRI Software
Firstly, lets take a look at perhaps the best regarded of the HDRI software packages, Photomatix Pro.

There are quite a number of HDRI software packages and plug ins on the market, most intended for artistic/aesthetic image-finishing purposes.  These are powerful editing programs.  Could they offer us any advantages as image forensic tools?  

I have come across another very good video using the same multiple exposure from RAW technique that I used above.  While this video is much more about the aesthetic/artistic value of HDRI, hopefully it provides another interesting insight into HDRI and the powerful image editing tools provided by some of these programs.  Clearly, there is more to HDRI than a simple merging of exposures.

Adobe Elements Photomerge V Photomatix Essentials
Having seen what Photomatix Pro can do I first downloaded the trial version of Photomatix Essentials.  Below I have compared the results using Photomatix Essentials with the results I previously had obtained using the simple Photomerge tool in Adobe Elements.

The upper two images compare the results obtained with the three bracketed exposures.  In theory HDRI images from bracketed exposures should offer the best HDRI results because each exposure bracket is a proper standalone image, with minimal noise and maximum tonal range preserved.  But the camera wasn't held perfectly steady and the Robin moved.  This is the big problem with HDRI from exposure bracketing.  The resulting 'ghosting' renders the Photomerge tool pretty useless for HDRI using bracketed exposures.  Photomatix has a tool to remove ghosting but it does not work perfectly, and, not surprisingly introduces some artefacts of it's own.  In this case there is a big improvement but there is still slight ghosting of the bill, and the rear crown is also affected.  

Comparing the lower two images, the Photomerge Tool does a good job with the three copies from the same RAW image.  Photomatix Essentials produces a slightly better, more natural result, with more detail but I am not convinced that Photomatix Essentials would so a better job than a normal RAW work flow (see below).  Photomatix Essentials costs around €/$40.  

Verdict:- possibly not worth the money unless working from exposure bracketed images.

Camera RAW V Camera RAW + Photomatix Pro
Photomatix Essentials' more expensive cousin Photomatix Pro obviously has a lot more useful functionality but at around €/$100 has the price tag to match.  The question is, does this added functionality push it far enough beyond a normal RAW image work flow capability to warrant adding it to the forensics tool bag?  Full credit to the manufacturers of Photomatix Pro - one can freely download and play around with the full package on trial and this is what I have done here. 

For this comparison test I have created the lowest contrast, yet reasonable result I could manage in Camera RAW.  The process of creating a single HDR-like image from a single image is called Tone Mapping so this is what I have done in Camera Raw.  I have then taken that image and used the additional Tonal Mapping functionality in Photomatix Pro to try and bring out more detail and tonal quality from the resulting image.

Verdict:- Once again it is hard to justify paying extra money for arguably no real improvement in image quality.  As with Photomatix Essentials the real benefit of having Photomatix Pro would only come about where in-camera bracketed exposures were obtained in the field.  

In Summary
The high contrast light that characterises bright sunny days challenges and often defeats the dynamic range of digital cameras.  The solution is High Dynamic Range Imaging (HDRI).  However there are some practical difficulties in obtaining good bracketed exposures.  One might be better off taking the time to shift position and get a better angle on the subject relative to the sun rather than trying to create steady bracketed exposures!  As for HDRI software?  There are certainly some high performance software packages out there but they don't appear to offer anything above the standard Camera Raw workflow, unless of course you have obtained good bracketed exposures, in which case Photomatix should easily outperform the Camera Raw work flow which is based on a single exposure.

Last video...a Tone Mapping example to show the HDRI capabilities of Adobe Lightroom from RAW.  It might be time I upgraded from Elements!

No comments:

Post a Comment