www.gusucode.com > images 案例代码 matlab源码程序 > images/DisplayHighDynamicRangeImageExample.m

    %% Display High Dynamic Range Image
% 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.

% Copyright 2015 The MathWorks, Inc.

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
%%
% Display the RGB image.
imshow(rgb)