1. Introduction - radhikahorti/Dynamic-Display-of-Histogram-and-Tone-curve GitHub Wiki

HDR stands for High Dynamic Range which basically defines the range of the lightest tones and darkest tones in the image. Another way to define the dynamic range would be the measure of the light intensities from the highlights to the shadows. The human eye has a wide dynamic range and is able to capture the details in both dark as well as bright conditions. So, the wider dynamic range of the camera used to capture the scene, the closer the photo compares to what our eye can see. But, this is not the case always as most of our imaging devices have low dynamic ranges.

Therefore we use tone mapping, that is a non-linear image processing technique, to map the HDR color value to the lower dynamic range to suit our imaging devices. The operator used to perform tone-mapping is called tone-mapping operator or tone-curve. These can be defined based on their processing as global or local. Global operators perform the same operation on all the pixels present, regardless of their position. They are computationally very efficient however the image will lose contrast hence losing detail. Some examples are Drago (luminance logarithmic compression, based on predetermined basis preserves the content of the scene), Ferwada (computational model of visual adaptation) and others. Local operators take into consideration the surrounding pixels and produce high contrast images. Some local operators are Durand (decomposes the image into two layers-base and detail. large scale variations of the base layer are encoded and the magnitude of the detail layer is preserved.), Fattal (manipulates the gradient levels of the luminance image) and others. Some operators can be used as both local and global based on how they are setup. One example is Reinhard, it first performs global mapping of the pixels and can arrange itself automatically to the general light level.

The image histogram is a graphical representation of the various tonal values in the image where the x-axis represents the tone and the y-axis represents the number of pixels for that tone. Therefore, they provide us with the global description of how the image appears to be. Here the number of tones present in the x-axis is defined by the number of bits used to represent a pixel. For example if the image is 8 bpp (bits per pixel) then the total number of tones present in the image will vary from 0 to 255, that is a total of 2^8 values.

The current project makes use of the publicly available ARGUS API’s to display the histogram and tone-curve for the given frame. Application Programming Interfaces are a critical part of programming as they help different systems communicate with each other and help them exchange data and share functions. Interfaces play an important role as they abstract the functionality from the user but at the same time help them control how the program works. A simple example can be the play button on any music streaming app, users know that pressing the button will start playing the music but very few understand the mechanism of how it is done and users are okay with this level of abstraction. In this project we use such APIs to apply six tone curve over the given frame, those are Linear, Non-Linear, Reinhard, exponential increase, S shaped and delayed S shaped.

1.1 Motivation

Histograms are present in the modern day digital cameras and help the photographer understand the various tones present in the image captured.Also these histograms can be manipulated to give rise to change in contrast or brightness in the image by performing simple calculations used in editing software.Whenever the histogram is stretched, clear changes in the contrast of the image can be seen and by sliding the histogram towards left or right, changes in the brightness of the image can be observed by the user. They are also used in image equalization and thresholding. Tone curves are used to remap the images tonality and emphasize the image colors and elements.

1.2 Objectives

The following objectives were established to ensure the project’s successful conclusion:

  • Develop Argus sample application for the display of histogram and tone curve.
  • For live capture, show the histogram and tone curve applied for the selected frame in the preview.
  • Applying the tone curve to the video stream and recording it for both indoor and outdoor HDR scenarios.
  • Publish the CPU utilization for the sample application that was developed by the team.

1.3 Literature survey

In order to comprehend the scope and application of the tone-curves and histogram representation of an image, the following papers were referred:

  • Generally ,the image enhancement methods typically applied for the flat panel display can be categorized into four classes : contrast enhancement ,edge enhancement, noise reduction and edge restoration. This paper proposes an image contrast enhancement algorithm for an LCD TV. It consists of two processes : segmentation process and tone-curve control process. The first process uses an automatic threshold technique to decompose an input into two regions and then utilizes a hierarchical structure for real time processing. The second process generates a gray level tone curve for contrast enhancement using a weighted sum of average tone curves for two segmented regions. Experimental results show that the proposed algorithm outperforms the conventional contrast enhancement method for an LCD TV.

  • Histogram equalization is a computer image processing technique that is used to improve the image contrast. It accomplishes this task by effectively spreading the frequently occurring intensity values,thereby stretching out the dynamic range of the image.This paper shows the comparative study between global histogram equalization, local histogram equalization and fast quadratic dynamic histogram equalization based on execution time, mean squared error and Peak Signal to Noise Ratio(PSNR).

  • Image Enhancement methods can be formulated as global transformations, local transformations, pixel-wise processing or a combination of these operations. Bridging the gap between local and global operations, this paper proposes a Local Tone Mapping Network (LTMNet) that proposes a grid of tone curves to locally enhance the image.

1.4 Problem statement

Dynamic display of histogram and tone curve by using publicly available ARGUS APIs for a given frame