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.
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.
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
High dynamic range image, specified as 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 quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
'AdjustLightness' — Overall lightness of the rendered image 2-element vector
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
'AdjustSaturation' — Saturation of colors in the rendered image 1 (default) | positive scalar
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
'NumberOfTiles' — Number of tiles used during adaptive histogram equalization [4 4] (default) | 2-element vector of positive integers
Number of tiles used during the adaptive histogram equalization part of the tone mapping
operation, specified as a 2-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.