Deconstructing an image

Friends, I’ve been wanting to tell you about this for a while, and now that the beta public version of MATLAB R2007b is out, I can finally post. This will be the first of a series of articles about high dynamic range imaging. Let’s start by looking at a picture:

This is my office. It’s a window office. I don’t say that out of pride, rather to highlight that there’s a bright, sunny world out there beyond the window. It’s comparatively dark inside. In fact, it’s so much brighter outside in this scene, that contemporary digital cameras and films can’t record the full “dynamic range” of the image. The outside would be overexposed or the interior would be underexposed. High dynamic range (HDR) imagery solves the problem.

I will write more about dynamic range later, but I want to get around to deconstructing the image’s content. For now I hope the following pair of images show how amazing high dynamic range imagery really is.

The description of these images gets a little technical, and you can safely skip this paragraph . . . or you can pick up some new highfalutin party lingo. The image on the left shows the relative luminance (i.e., brightness) of the scene. The darkest value is black; the brightest value is white; and everything in between is linearly scaled. As you can see, the wide range of luminance values hides most of the scene’s information. If we take the base-2 logarithm of the values, linearly map the result, and apply a false coloring (as shown in the right image) you can see that all of the detail is actually there in the HDR image. (Click on any of the images for a larger version.)

For this image, knowing the way that it’s constructed may help you understand some of the visual content of the image. Right now — in what will soon be the olden days — the easiest way to get the “best” exposure is to use a handheld lightmeter and then change the lighting throughout the scene to produce even illumination. You can see one of these soon-to-be-antiquated devices on the right-hand side of my desk right next to a wee cowboy and dinosaur facing off and a copy of what I was reading at the time. A tiny version of this device (minus dinosaur and cowboy) appears inside almost every camera.

Using a light meter and portable lighting can be very time consuming and a bit expensive. You need equipment. You need assistants to set up and move the equipment. You need time to set it all up, make the test images, adjust the light output, take the “best” shot, and tear it all down again. I predict that HDR technology will appear in consumer electronics devices in the next few years — it’s already in Adobe Photoshop — and, while professionals will still need lighting rigs and serfs assistants, the rest of us will get most of the benefits without extra equipment. Mark my words, the move from traditional imagery to HDR imaging is going to be (almost) as big as the shift from film to digital.

MATLAB and the Image Processing Toolbox are used by the engineers who will likely develop those fancy consumer devices for you. So I created this image as a sample that ships with the toolbox to help show what we can do. One day I brought in my sturdy tripod, and Alex Taylor (who went to a trade show in California with me last February) brought in his new Nikon digital camera. We took seventeen “normal” low dynamic range images at different exposure values, ran it through some software I wrote in MATLAB to merge the different exposure values into one “properly exposed” image, called a function in the Image Processing Toolbox to create a “tone mapped” image, and voilà.

The last time I did something like this was six years ago when I needed to make a new colorful image for the toolbox. Being a perfectionist (and a bit of an artiste) it took me forever to think of what I wanted to do. Then one morning I remembered Edward Weston’s sexy peppers, grabbed my tripod and an old bed sheet, and bought thirteen dollars worth of peppers at the Stop & Shop. A couple days later I went to San Diego for my first trade show, and my coworkers ate the peppers. (Déjà vu…) My inspiration appears on the left below, along with the image that still ships with the toolbox and appears in multiple product demos.


The first image I made for the toolbox appears in the new image. (That’s MATLAB in the background.) I also put an apple in the picture as an homage to the earlier picture and a reference to my absent Mac laptop.

Finally, there are a bunch of dinosaurs in the picture because everyone loves dinosaurs. Or at least, they should.

This entry was posted in Color and Vision, Computing, Photography. Bookmark the permalink.

2 Responses to Deconstructing an image

  1. Simon says:

    Hi Jeff,

    Could you possibly describe exactly how you made the false-color visualization for the HDR image (the third image from the top of the post), including the color scale on the right. Thanks.

    - Simon

  2. Jeff Mather says:

    Simon: Thanks for your interest. It’s been a while since I made the image, and I don’t have the exact commands, but this will give you a similar output. The main differences seem to be in the choice of colormap and the actual conversion I used to go from RGB HDR to log-2 LDR; hopefully, this is close enough to get you started.

    RGB = hdrread(‘office.hdr’);
    X2 = rgb2gray(RGB);
    L = log2(X2);
    figure; imshow(L,[]); colormap(jet); colorbar

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>