| Image Processing Toolbox™ | ![]() |
HDR = makehdr(files)
HDR = makehdr(files, param1, val1,...)
HDR = makehdr(files) creates the single-precision high dynamic range image HDR from the set of spatially registered low dynamic range images listed in the files cell array. These files must contain EXIF exposure metadata. The middle exposure between the brightest and darkest images is used as the base exposure for the high dynamic range calculations. (This value does not need to appear in any particular file.)
HDR = makehdr(files, param1, val1,...) creates a high dynamic range image from the low dynamic range images in files, specifying parameters and corresponding values that control various aspects of the image creation. Parameter names can be abbreviated and case does not matter.
Note Only one of the BaseFile, ExposureValues, and RelativeExposure parameters may be used at a time. |
| Parameter | Description |
|---|---|
| 'BaseFile' | Character array containing the name of the file to use as the base exposure. |
| 'ExposureValues' | Vector of exposure values, with one element for each low dynamic range image in the cell array files. An increase in one exposure value (EV) corresponds to a doubling of exposure, while a decrease in one EV corresponds to a halving of exposure. Any positive value is allowed. This parameter overrides EXIF exposure metadata. |
| 'RelativeExposure' | Vector of relative exposure values, with one element for each low dynamic range image in the cell array files. An image with a relative exposure (RE) of 0.5 has half as much exposure as an image with an RE of 1. An RE value of 3 has three times the exposure of an image with an RE of 1. This parameter overrides EXIF exposure metadata. |
| 'MinimumLimit' | Numeric scalar value in the range [0 255] that specifies the minimum correctly exposed value. For each low dynamic range image, pixels with smaller values are considered underexposed and will not contribute to the final high dynamic range image. |
| 'MaximumLimit' | Numeric scalar value in the range [0 255] that specifies the maximum correctly exposed value. For each low dynamic range image, pixels with larger values are considered overexposed and will not contribute to the final high dynamic range image. |
Make a high dynamic range image from a series of six low dynamic range images that share the same f/stop number and have different exposure times. Use tonemap to visualize the HDR image.
files = {'office_1.jpg', 'office_2.jpg', 'office_3.jpg', ...
'office_4.jpg', 'office_5.jpg', 'office_6.jpg'};
expTimes = [0.0333, 0.1000, 0.3333, 0.6250, 1.3000, 4.0000];
hdr = makehdr(files, 'RelativeExposure', expTimes ./ expTimes(1));
rgb = tonemap(hdr);
figure; imshow(rgb)[1] Reinhard, et al. "High Dynamic Range Imaging." 2006. Ch. 4.
![]() | makeConstrainToRectFcn | makelut | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |