Work with High Dynamic Range Images

Dynamic range refers to the range of brightness levels, from dark to light. The dynamic range of real-world scenes can be quite high. High dynamic range (HDR) images attempt to capture the whole tonal range of real-world scenes (called scene-referred), using 32-bit floating-point values to store each color channel. HDR images contain a high level of detail, close to the range of human vision. The toolbox includes functions for reading, creating, and writing HDR images, and a tone-map operator for displaying HDR images on a computer monitor.

Read High Dynamic Range Image

To read a high dynamic range image into the MATLAB® workspace, use the hdrread function.

hdr_image = hdrread('office.hdr');

The output image hdr_image is an m-by-n-by-3 image of type single.

whos
  Name        Size            Bytes    Class     Attributes

  hdr_image   665x1000x3      7980000  single

Note, however, that before you can display a high dynamic range image, you must convert it to a dynamic range appropriate to a computer display, a process called tone mapping. Tone mapping algorithms scale the dynamic range down while attempting to preserve the appearance of the original image. For more information, see Display High Dynamic Range Image.

Create High Dynamic Range Image

To create a high dynamic range image from a group of low dynamic range images, use the makehdr function. Note that the low dynamic range images must be spatially registered and the image files must contain EXIF metadata. Specify the low-dynamic range images in a cell array.

hdr_image = makehdr(files);

Write High Dynamic Range Image to File

To write a high dynamic range image from the MATLAB workspace into a file, use the hdrwrite function.

hdrwrite(hdr,'filename');

See Also

| |

Related Topics