Skip to content

Implementation of a simple algorithm for High Dynamic Ranging (HDR)

Notifications You must be signed in to change notification settings

balakrishna-k/HighDynamicRanging

Repository files navigation

HDR - High Dynamic Ranging

Prerequisites

  • Python 3
  • Python packages: OpenCV, numpy, matplotlib.pyplot, matplotlib.pylab, os
  • MAC OS or Windows 10 (Ubuntu Windows' Bash)

Installation

  • Clone the repo:
git clone https://github.com/balakrishna-k/HighDynamicRanging.git
  • Run the program:
python3 HDR.py 
  • View Outputs:
Look in the images directory. For eg: If you want to look at the graphs generated by the gamma module, navigate to images/gamma/out

Furthermore, if you want to display the graphs at run time, make sure to set the MANUALLY set the DISPLAY flag in HDR.py to ct.DISPLAY_PLOT instead of ct.DONT_DISPLAY_PLOT

Project Modules

  • HDR.py: This is the main python script that combines our separate modules to peform High Dynamic Ranging. This python file also performs the tone mapping using rienhard tone map.
  • hdr/gamma.py: Obtain the gamma value to raise the brightness to the power of gamma
  • hdr/exposure.py: This module contains all the functions that are used to generate the histograms for the HDR stack and the HDR image. Do not manipulate the functions that are marked as private functions.
  • hdr/composition.py: This module contains the implementations for the two algorithms, called best pixel hdr and average pixel hdr. This also contains the various preprocessing functions that we have created for the composition of the algorithms
  • utility/imageutil.py: This module is basically a helper function module for commonly performed operations by the other modules. If you want to use them, just import the module.
  • utility/utility.py: This contains the general purpose utility functions. There are not too many of them
  • utility/constants.py: This is perhaps one of the most important modules of our functions. It contains values that should NOT ever be changed by any modules, and acts as a foundation for all our other modules. Make changes at your own peril
  • images/: Each individual sub directory contains the images generated/read by the corresponding modules. Outputs by the programs are saved in a sub-directory out.

Output

Part 1
The images are stored in the following location:

images/gamma/out (depending on windows or linux use "\" or "/")
  • Plot of Channel Brightness vs Exposure Time
  • Plot of Linear Regression
  • Plot of Real/Corrected/Linearised Channel Brightness vs Exposure Times

Part 2
The images are stored in the following location:

images/exposure/out (depending on windows or linux use "\" or "/")
  • Histograms for the HDR Stack
  • Histograms for (B'(T))^g/a

Part 3
The images are stored in the following location:

images/hdr/out (depending on windows or linux use "\" or "/")
  • Histograms for the two HDR images

Part 4 The images are stored in the following location:

images/hdr/out (depending on windows or linux use "\" or "/")

Tone-mapped images using average pixel hdr and brightest pixel hdr

About

Implementation of a simple algorithm for High Dynamic Ranging (HDR)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages