#hdr #image #camera-image

image-hdr

An implementation of HDR Radiance Estimation using Poisson Photon Noise Estimator for creating HDR image from a set of images

8 releases (4 breaking)

0.5.1 Sep 15, 2024
0.5.0 Jul 31, 2024
0.4.0 Mar 24, 2024
0.3.0 Aug 20, 2023
0.1.2 Nov 30, 2022

#37 in Multimedia

Download history 121/week @ 2024-07-30 1/week @ 2024-08-06 142/week @ 2024-09-10 39/week @ 2024-09-17 16/week @ 2024-09-24 8/week @ 2024-10-01 1/week @ 2024-10-08

104 downloads per month

Apache-2.0 and maybe LGPL-3.0-only

26KB
397 lines

image-hdr

This is a rust library which implements the HDR merging algorithm for camera images taken with different exposure times (or with bracketing). It uses the algorithms described in https://www.cl.cam.ac.uk/research/rainbow/projects/noise-aware-merging/2020-ppne-mle.pdf, and uses "Poisson Photon Noise Estimator" equations to estimate final radiances at each pixel position.

Current State

The library is still in early stages of development, but aims to provide a crate that can handle all HDR merging needs. Towards that end, the following todos are the top priority:

  • Tone mapping algorithm implementations.
  • Improve performance.

Dependencies

  • image-rs: Uses DynamicImage as the output format and storage format between calculations.
  • rawloader: For supporting RAW image formats.
  • rayon: For doing point calculations in parallel.
  • kamadak-exif: For getting image's metadata, specifically exposure time and gain (ISO).

Usage

let paths = vec!["src/image1.tif", "src/image2.tif", "src/image3.tif"];
let hdr_merge = image_hdr::hdr_merge_images(paths);
let stretched = apply_histogram_stretch(&fusion);

stretched
    .to_rgba16()
    .save(format!("src/hdr_merged.tiff"))
    .unwrap();

Samples

Given the following 3 exposures:

alt "1/640s" alt "1/4000s" alt "1/80s"

Resulting unprocessed image:

alt "Merged image"

After basic processing (Levels and Contrast):

alt "Processed image"

Contributing

Bug reports and pull requests welcome at https://github.com/anshap1719/image-hdr

Citations

Dependencies

~4–6MB
~121K SLoC