主要内容

显示高动态范围图像

R2026b

此示例说明如何显示高动态范围 (HDR) 图像。要查看 HDR 图像,您必须先将数据转换为可在计算机上正确显示的动态范围。

使用 hdrread 读取高动态范围 (HDR) 图像。如果尝试显示 HDR 图像,请注意它无法正确显示。

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

Figure contains an axes object. The hidden axes object contains an object of type image.

使用 tonemap 函数将 HDR 图像转换为可在计算机上查看的动态范围。此函数将 HDR 图像转换为 uint8 数据类型的 RGB 图像。

rgb = tonemap(hdr_image);
whos
  Name             Size                  Bytes  Class     Attributes

  hdr_image      665x1000x3            7980000  single              
  rgb            665x1000x3            1995000  uint8               

显示 RGB 图像。

imshow(rgb)

Figure contains an axes object. The hidden axes object contains an object of type image.

另请参阅

| |

主题