Hello again, friend.

In this activity, the histogram of an image will be manipulated in order to show the details in poorly lit areas. The normalized histogram of a grayscale image gives the probability distribution function of that image. Again, we start with the equations that are important for this activity.

If you’ve been following this blog, you should probably already know that gray scale images have 8-bit pixel intensity values. Now, let p(r) be the PDF of an image and for every PDF there exists a cumulative distribution function (CDF) denoted as T(r) which are related by..

equation

This will be useful later on because this is what we are going to manipulate. Of course this is the continuous form of the CDF. Giving an ideal CDF G(z), we can backproject the values in order to fit G(z) given as,

equation 2.JPG

p2(t) is the probability distribution after backprojection. The method is actually given in what Dr. Soriano sent us represented in these two plots:

figs.JPG

From the sample graylevel value 100 above, first take T(r) and equate it to G(z) then take the gray level that corresponds to that G(z). Now, the gray level values in G(z) because that is your “ideal” CDF.

Now, the fun part.

In this activity, two CDF’s are considered. a linear CDF and a sigmoidal CDF as shown:

The image to be used is a photo I took when I was going home from the National Institute of Physics:

pic4
PAG-ASA Observatory pathway thing

The two figure below show the histogram(left) and the CDF(right) of the image of the observatory. Note that I haven’t normalized the histogram. YOU SHOULD NORMALIZE in order to have the PDF.

Now as applying the backprojection method, the resulting CDF for both linear and sigmoidal CDF’s are:

If you look closely that there appears to be small steps as the gray level increases. This is because all images are discrete sets of pixels.

These are the resulting photos:

This slideshow requires JavaScript.

For both of the CDF’s used, the details in the dark regions can now be discerned easily but the difference between the two are the contrast. The linear CDF shows higher contrast between pixels while the sigmoidal CDF does not. Again, you can make G(z) any kind of CDF. Different CDF’s create different results.