Equalization implies mapping one distribution (the given histogram) to another distribution (a wider and more uniform distribution of intensity values) so the. Histogram equalization is a technique for adjusting image intensities to enhance contrast. normalized histogram of f with a bin for each possible intensity. So. Histogram is a graphical representation of the intensity distribution of an image. In simple terms, it represents the number of pixels for each.

Author: | Nakasa Goran |

Country: | United Arab Emirates |

Language: | English (Spanish) |

Genre: | Video |

Published (Last): | 17 December 2006 |

Pages: | 154 |

PDF File Size: | 7.50 Mb |

ePub File Size: | 2.40 Mb |

ISBN: | 938-9-25551-216-1 |

Downloads: | 52975 |

Price: | Free* [*Free Regsitration Required] |

Uploader: | Nezil |

The objective of this first project is to develop and implement some image processing functions based on the histogram of an Image. In a first part we will present briefly some theoretical aspects associated with histograms and the processing associated.

Then we will present the different functions and processing we developed for this project. We will try to explain and present all the results and the step we’ve been through in this project.

The code evolved a lot while I was writing this report, so some images produced may not be the exact same as the one I’ve used in this report.

The structure of this report is following the subject but sometimes I have considered several questions at the same time. I made all the other drawing or images so there is no Copyright infringement in this work. A digital image is a discrete space composed of small surface elements called pixel.

Each one of this hhistogram contains a value or a set of value coding the intensity level at hhistogram position. A digital image can be acquired with a great number of different devices such as a camera, an MRI machine or any kind of device with a sensor able to capture light intensity.

Because of its discrete nature, the theory used to process digital image will rely on discrete domain, even if the analogy with the continuous domain is possible. A gray scale image is a digital image in which each pixel only contains one scalar value which is its intensity. The number of possible levels intensity values depends on the numerical hisstogram encoding the image. A color image is a digital array of pixel containing a color information.

Each image can be decomposed into three different layers according to the three color channels encoded: Red, Green and Blue. For instance, a 8 eight bits color images encode the Red and Green channel with three bits and the blue with two. Which could encode different colors. The histogram of a digital image is a distribution of its discrete intensity levels in the range [0,L-1]. The distribution is a discrete function h associating to each intensity level: Normalize an histogram is a technique consisting into transforming the discrete distribution of intensities into a discrete distribution of probabilities.

To do so, we need to divide each value of the histogram by the number of pixel. Because a digital image is a discrete set of values that could be seen as a matrix and it’s equivalent to divide each n k by equapisation dimension of the array which is the product of the width by the length of the image.

## Histogram equalization

Equalisxtion equalization is a method to process images in order to adjust the contrast of an image by modifying the intensity distribution of the histogram. The objective of this technique is to give a linear trend to the cumulative probability function associated to the image.

The processing of histogram equalization relies on the use of the histlgram probability function cdf. The cdf is a cumulative sum of all the probabilities lying in its domain and defined by:. The idea of this processing is to give to the resulting image a linear cumulative distribution function.

Indeed, a linear cdf is associated to the uniform histogram that we want the resulting image to have. Segmentation is an operation consisting in partitioning an image into sets of elements.

One of the method to do that is thresholding which consist in converting a gray-scale image into a binary image. The most equalisatioon step here is to chose the best value for the threshold to get the best segmentation.

Several methods exists to determine it. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms and a lot of many other things. So all the code I’m going to present here is using matlab programing language syntax. But all algorithm will work with any other languages.

A more detailed presentation of the code is available in the Implementation section. An histogram being a distribution of the number of pixel hisstogram to their intensities, we have in this part to analyze the image to determine this distribution.

Then we will perform some other operations to allow the user to enter the number of desired bins for the histogram and the range of values that should cover the histogram. We developed a function that is taking as input a 2 dimension array a digital image containing for each pixel an associated intensity value.

The type used to store these values can either be integers or floats. The function is converting this 2 dimension array into a single dimension array containing the frequency of each intensity level.

Hiztogram the previous result, we are just displaying the absolute frequency which is the number of pixel. To be able to perform further transformations on the image, we have to normalize the histogram. The normalization will give to our distribution the properties of a probability density function. To get this result, we used the formula given in histogrqm theoretical part.

The objective in this part is also to be able to modify the different parameters of the histogram. Indeed, we want to be able to specify the number of equqlisation and also its range.

So we need to determine the size of each new bin and then perform a test on the value of the histogram to find in which bins it lies. To compute the size of the new bin, we use the following formula:. Note that in this case we consider a rounding for computing the size. The brace uses Kenneth E. Iverson notation of histogtam rounding function. So the final function we produced is taking an image as input and providing an histogram with a specified number of bins and range.

Examples are provided in the following section.

In this section, we are going to show different histograms associated to different images and try to explain and interpret them in regard to the image we gave as input. On the previous figure, we can see that the input picture is really dark. We can see this aspect while looking at the associated normalized histogram where we can see that the histogram is located on the left side which correspond to the darkest gray levels.

Indeed, on that image the skull of the head is clearly appearing white and there is also a huge number of pixel with an intermediate gray level. The background is black and is representing a big part of the image. So it makes sense to have three different hlstogram on the histogram: Let’s apply here equaliwation restriction on the range of the histogram we are displaying so it only focuses histlgram the regions corresponding to the middle range of the histogram i.

So we are considering only the range of values between 50 and We can also generate the histogram of the other images. With an intensity range going from 0 to for chang. We can also give as input a digital color image. Then the first thing to do is to separate the three different color channels: Here we can clearly see that the distribution of the intensity on each channel is clearly different. The color image is obtained while combining the three layers. We obtain the following result:.

In this part we are only going to consider Gray scale images. As we have seen before, some images are really dark and have their histogram concentrated on the lower values of the intensity.

## Histogram Equalization

So the objective of this part is to enhance the contrast of the image by equalizing the histogram. To perform this operation, we are going to implement the formula presented in the section IIIB of theoretical part at the beginning ewualisation this report. To do so, we will need to perform as a first step the computation of the histogram of our input image. To do so, we can call the function histogram we have already implemented in the previous equalisationn.

### Point Operations – Histogram Equalization

A detailed explanation of the code is available in the Implementation part. As we can see on the previous figure, if we compare the two images we can see that the contrast of the image has clearly been enhanced by performing equalization. The success of the procedure is proven by the histogram associated to each image, showing that it’s range has been stretched to occupy the whole spectrum of levels.

We also have an expected result for the cumulative distribution function because we have an almost linear cdf. In terms of qualitative judgment on the image, we can clearly see that the contrast is better because we are now able to see what was at the background and that the picture is really showing a crowd, which was not that obvious before.

The two previous pictures: On these images, the histogram equalization is really stretching the histogram and allow us to really see the details of the image that we were not able to see before. Let’s interpret the equalisatin cumulative distribution. As we can see it’s compose of different steps, which approximate a line. The reason why the steps are bigger is because originaly, the histogram was really compressed on the left and the equalization stretched it over the whole range of values.

So the higher the peaks equalosation, the higher the step is on the cdf.

### Histogram Equalization – Towards Data Science

This last image is a quite different from the others and I didn’t present it before. So as we can see on its histogram, we have a peak of dark gray values that probably represent yistogram background of the image and then a wide range of values on more brighter intensities.

So it’s pretty logical to have a cumulative density function with such a behavior: So, the cumulative distribution functions looks more like a line because the histogram hasn’t been stretch as much as the other images because its original histogram was already distributed on the whole range of intensities. So this is why the result hisogram seem to be changed a lot and the contrast stays quite the same.

We can see some more details but this could maybe be enhanced more. So we can conclude this part that histogram equalization really depends on the initial distribution of intensity levels. If they are concentrated on one side of the histogram, equalization will stretched it to cover the whole range and will enhance contrast.

But if the histogram is already distributed over almost the whole range of intensities, equalization will not be as effective because the stretch is not going to be as strong so it’s not going to change a lot equalisatioh intensity distribution.

I decided to run the histogram equalization technique on other images with different types of histogram to see how this is affecting them.

Here are the results:. On the previous result, we can see that the input image has an histogram occupying the whole range of gray levels and with a cumulative distribution which is going up really smoothly without big steps.