Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

tonemap

Render high dynamic range image for viewing

Syntax

RGB = tonemap(HDR)
RGB = tonemap(HDR,Name,Value)

Description

RGB = tonemap(HDR) converts the high dynamic range image HDR to a lower dynamic range image, RGB, suitable for display, using a process called tone mapping. Tone mapping is a technique used to approximate the appearance of high dynamic range images on a display with a more limited dynamic range.

example

RGB = tonemap(HDR,Name,Value) allows parameters to control various aspects of the tone mapping.

Examples

collapse all

This example shows how to display a high dynamic range (HDR) image. To view an HDR image, you must first convert the data to a dynamic range that can be displayed correctly on a computer.

Read a high dynamic range (HDR) image, using hdrread. If you try to display the HDR image, notice that it does not display correctly.

hdr_image = hdrread('office.hdr');
imshow(hdr_image)

Convert the HDR image to a dynamic range that can be viewed on a computer, using the tonemap function. This function converts the HDR 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               

Display the RGB image.

imshow(rgb)

Input Arguments

collapse all

High dynamic range image, specified by an m-by-n-by-3 array.

Data Types: single | double

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example:

collapse all

Overall lightness of the rendered image, specified as a two-element vector. The vector takes the form [low high], where low and high are luminance values of the low dynamic range image, in the range (0, 1]. These values are passed to imadjust.

Data Types: double

Saturation of colors in the rendered image, specified as a positive scalar. When the value is greater than 1, the colors are more saturated. When the value is in the range (0, 1], colors are less saturated.

Data Types: double

Number of tiles used during the adaptive histogram equalization part of the tone mapping operation, specified as a two-element vector of positive integers. The vector takes the form [rows cols], where rows and cols specify the number of rows and columns of tiles. Both rows and cols must be at least 2. The total number of image tiles is equal to rows*cols. A larger number of tiles results in an image with greater local contrast.

Data Types: double

Output Arguments

collapse all

Low dynamic range image, specified as an m-by-n-by-3 array.

Data Types: uint8

Introduced in R2007b

Was this topic helpful?