Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pmi432 / LR07 / 2read / image processing toolbox guide.pdf
Скачиваний:
166
Добавлен:
18.03.2015
Размер:
18.08 Mб
Скачать

Working with High Dynamic Range Images

Working with High Dynamic Range Images

In this section...

“Understanding Dynamic Range” on page 3-21 “Reading a High Dynamic Range Image” on page 3-21 “Creating a High Dynamic Range Image” on page 3-22 “Viewing a High Dynamic Range Image” on page 3-22

“Writing a High Dynamic Range Image to a File” on page 3-23

Understanding Dynamic Range

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.

Reading a 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

3-21

3 Reading and Writing Image Data

image. For more information, see “Viewing a High Dynamic Range Image” on page 3-22.

Creating a 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);

Viewing a High Dynamic Range Image

If you try to view a HDR image using imshow, the image does not display correctly.

To view an HDR image, you must first convert the data to a dynamic range that can be displayed correctly on a computer. Use the tonemap function to

3-22

Working with High Dynamic Range Images

perform this conversion. tonemap converts the high dynamic range image into an RGB image of class uint8.

rgb = tonemap(hdr_image);

whos

 

 

 

 

Name

Size

Bytes

Class

Attributes

hdr_image

665x1000x3

7980000

single

 

rgb

665x1000x3

1995000

uint8

 

After converting the HDR image, try to display the image again.

imshow(rgb);

Writing a High Dynamic Range Image to a File

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

3-23

3 Reading and Writing Image Data

hdrwrite(hdr,'filename');

3-24

4

Displaying and Exploring

Images

This section describes the image display and exploration tools provided by the Image Processing Toolbox software.

“Image Display and Exploration Overview” on page 4-2

“Displaying Images Using the imshow Function” on page 4-4

“Using the Image Tool to Explore Images” on page 4-11

“Exploring Very Large Images” on page 4-21

“Using Image Tool Navigation Aids” on page 4-23

“Getting Information about the Pixels in an Image” on page 4-30

“Measuring the Distance Between Two Pixels” on page 4-37

“Getting Information About an Image Using the Image Information Tool” on page 4-40

“Adjusting Image Contrast Using the Adjust Contrast Tool” on page 4-42

“Cropping an Image Using the Crop Image Tool” on page 4-51

“Viewing Image Sequences” on page 4-54

“Displaying Different Image Types” on page 4-66

“Adding a Colorbar to a Displayed Image” on page 4-73

“Printing Images” on page 4-75

“Setting Toolbox Preferences” on page 4-77

Соседние файлы в папке 2read