Open source Python implementation of the HDR+ photography pipeline

Overview

hdrplus-python

Open source Python implementation of the HDR+ photography pipeline, originally developped by Google and presented in a 2016 article. The finishing pipeline is simplified and of lesser quality than the one described in the original publication.

For an interactive demo and the associated article, An Analysis and Implementation of the HDR+ Burst Denoising Method, check out Image Processing On Line

Note: A C++ / Halide implementation by different authors is available here.

Installation Instructions

All the libraries necessary to run the code are listed in the hdrplus.yml Conda environment file. Simply run

conda env create -f hdrplus.yml

from a command window to install a functional environment.

File Contents and Provided Files

All source code containing algorithm functions is located within the package/algorithm folder, except some optional visualization functions located in package/visualization/vis.py

Scripts to run the algorithm are located at the root of the repo.

Running the Code

Two scripts are provided to either run the algorithm on a single burst (runHdrplus.py) or on a series of bursts all within the same parent folder (runHdrplus_multiple.py).

Examples of use:

python runHdrplus.py -i ./test_data/33TJ_20150606_224837_294 -o ./results_test1 -m full -v 2
python runHdrplus_multiple.py -i ./test_data -o ./results_test2 -m full

You can run the algorithm in three modes (-m command argument):

  • full:
    • required inputs (per burst folder): all raw .dng burst files and a single reference_frame.txt file
    • outputs (per burst folder): 3 .jpg images: final image X_final.jpg + minimally processed versions of the reference and merged image X_reference_gamma.jpg X_merged_gamma.jpg
  • align:
    • required inputs: all raw .dng burst files and a single reference_frame.txt files
    • outputs: a .dng file (copy of the reference image) + 2 numpy files: X_aligned_tiles.npy and X_padding.npy
  • merge:
    • required inputs: (obtained from align mode) a single .dng file (for metadata of the reference image) + 2 numpy files X_aligned_tiles.npy and X_padding.npy
    • outputs: a .dng file (copy of the reference image) + 1 numpy file: X_merged_bayer.npy
  • finish:
    • required inputs: (obtained from merge mode) a single .dng file (for metadata of the reference image) + 1 numpy file (for actual pixel values) X_merged_bayer.npy
    • outputs: final image X_final.jpg You can also change the values of the 'write___' dictionary items in params.py to change the kind of files dumped in each mode (at your own risk).

A helper script for the minimal processing of raw .dng files into .png/.jpg files (e.g. for the visualization of input images) is also included in the code: all_dngs_to_png.py

Test Data

1 burst can be found in the test_data folder (each burst being in its own subfolder) Feel free to add your own data. The structure of a burst folder must be the following:

  • the burst name is specified by the name of the folder itself
  • burst images must be stored as .dng files (most proprietary raw images formats can be turned to DNG using Adobe DNG Converter
  • image files must be named the following way: commonpart<X>.dng, where <X> gives an indication of the frame number (eg payload_N000.dng, payload_N001.dng / G0140178.dng, G0140179.dng)
  • you can specify the reference frame by putting a zero-indexed number inside a reference_frame.txt file (i.e. 0 for the 1st frame)

Additional data can be downloaded via the following links:

COPYRIGHT AND LICENSE INFORMATION

Copyright (c) 2021 Antoine Monod

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

This file implements an algorithm possibly linked to the patent US9077913B2. This file is made available for the exclusive aim of serving as scientific tool to verify the soundness and completeness of the algorithm description. Compilation, execution and redistribution of this file may violate patents rights in certain countries. The situation being different for every country and changing over time, it is your responsibility to determine which patent rights restrictions apply to you before you compile, use, modify, or redistribute this file. A patent lawyer is qualified to make this determination. If and only if they don't conflict with any patent terms, you can benefit from the following license terms attached to this file.

You might also like...
A Sklearn-like Framework for Hyperparameter Tuning and AutoML in Deep Learning projects. Finally have the right abstractions and design patterns to properly do AutoML. Let your pipeline steps have hyperparameter spaces. Enable checkpoints to cut duplicate calculations. Go from research to production environment easily. Automates Machine Learning Pipeline with Feature Engineering and Hyper-Parameters Tuning :rocket:
Automates Machine Learning Pipeline with Feature Engineering and Hyper-Parameters Tuning :rocket:

MLJAR Automated Machine Learning Documentation: https://supervised.mljar.com/ Source Code: https://github.com/mljar/mljar-supervised Table of Contents

git《Pseudo-ISP: Learning Pseudo In-camera Signal Processing Pipeline from A Color Image Denoiser》(2021) GitHub: [fig5]
git《Pseudo-ISP: Learning Pseudo In-camera Signal Processing Pipeline from A Color Image Denoiser》(2021) GitHub: [fig5]

Pseudo-ISP: Learning Pseudo In-camera Signal Processing Pipeline from A Color Image Denoiser Abstract The success of deep denoisers on real-world colo

[CVPR-2021]  UnrealPerson: An  adaptive pipeline  for  costless person re-identification
[CVPR-2021] UnrealPerson: An adaptive pipeline for costless person re-identification

UnrealPerson: An Adaptive Pipeline for Costless Person Re-identification In our paper (arxiv), we propose a novel pipeline, UnrealPerson, that decreas

Clairvoyance: a Unified, End-to-End AutoML Pipeline for Medical Time Series
Clairvoyance: a Unified, End-to-End AutoML Pipeline for Medical Time Series

Clairvoyance: A Pipeline Toolkit for Medical Time Series Authors: van der Schaar Lab This repository contains implementations of Clairvoyance: A Pipel

Evaluation Pipeline for our ECCV2020: Journey Towards Tiny Perceptual Super-Resolution.

Journey Towards Tiny Perceptual Super-Resolution Test code for our ECCV2020 paper: https://arxiv.org/abs/2007.04356 Our x4 upscaling pre-trained model

This repository contains the code for our fast polygonal building extraction from overhead images pipeline.
This repository contains the code for our fast polygonal building extraction from overhead images pipeline.

Polygonal Building Segmentation by Frame Field Learning We add a frame field output to an image segmentation neural network to improve segmentation qu

TorchX is a library containing standard DSLs for authoring and running PyTorch related components for an E2E production ML pipeline.

TorchX is a library containing standard DSLs for authoring and running PyTorch related components for an E2E production ML pipeline

Comments
  • Request

    Request

    Hello! Please if you can make an ios camera app that shoots a burst of dng raw images and then performs hdr plus processing and. saves the final processed photo. Thank you for understanding me!

    opened by KirChi123 2
  • Fixed alignment upsample index offset

    Fixed alignment upsample index offset

    The indexes computed are applied to paddedPreviousAlignments which is only offseted by 1 (and not 2) pixels with regard to PreviousAlignments. This is not such a big deal, but this offset changes 2 of the 3 candidates alignments by taking them much further than what is indicated in the IPOL article. It can easily be seen on toy-cases that the returned indexes are not coherent.

    opened by Jamy-L 0
Owner
PhD Student in applied mathematics (image processing, deep learning)
null
Pytorch implementation of various High Dynamic Range (HDR) Imaging algorithms

Deep High Dynamic Range Imaging Benchmark This repository is the pytorch impleme

Tianhong Dai 5 Nov 16, 2022
HDR Video Reconstruction: A Coarse-to-fine Network and A Real-world Benchmark Dataset (ICCV 2021)

Code for HDR Video Reconstruction HDR Video Reconstruction: A Coarse-to-fine Network and A Real-world Benchmark Dataset (ICCV 2021) Guanying Chen, Cha

Guanying Chen 64 Nov 19, 2022
PaddleRobotics is an open-source algorithm library for robots based on Paddle, including open-source parts such as human-robot interaction, complex motion control, environment perception, SLAM positioning, and navigation.

简体中文 | English PaddleRobotics paddleRobotics是基于paddle的机器人开源算法库集,包括人机交互、复杂运动控制、环境感知、slam定位导航等开源算法部分。 人机交互 主动多模交互技术TFVT-HRI 主动多模交互技术是通过视觉、语音、触摸传感器等输入机器人

null 185 Dec 26, 2022
This repository is an open-source implementation of the ICRA 2021 paper: Locus: LiDAR-based Place Recognition using Spatiotemporal Higher-Order Pooling.

Locus This repository is an open-source implementation of the ICRA 2021 paper: Locus: LiDAR-based Place Recognition using Spatiotemporal Higher-Order

Robotics and Autonomous Systems Group 96 Dec 15, 2022
An open source implementation of CLIP.

OpenCLIP Welcome to an open source implementation of OpenAI's CLIP (Contrastive Language-Image Pre-training). The goal of this repository is to enable

null 2.7k Dec 31, 2022
Open source implementation of AceNAS: Learning to Rank Ace Neural Architectures with Weak Supervision of Weight Sharing

AceNAS This repo is the experiment code of AceNAS, and is not considered as an official release. We are working on integrating AceNAS as a built-in st

Yuge Zhang 6 Sep 7, 2022
Open source implementation of "A Self-Supervised Descriptor for Image Copy Detection" (SSCD).

A Self-Supervised Descriptor for Image Copy Detection (SSCD) This is the open-source codebase for "A Self-Supervised Descriptor for Image Copy Detecti

Meta Research 68 Jan 4, 2023
torchlm is aims to build a high level pipeline for face landmarks detection, it supports training, evaluating, exporting, inference(Python/C++) and 100+ data augmentations

??A high level pipeline for face landmarks detection, supports training, evaluating, exporting, inference and 100+ data augmentations, compatible with torchvision and albumentations, can easily install with pip.

DefTruth 142 Dec 25, 2022
This is an open source python repository for various python tests

Welcome to Py-tests This is an open source python repository for various python tests. This is in response to the hacktoberfest2021 challenge. It is a

Yada Martins Tisan 3 Oct 31, 2021