Assignment 1

Submitted By

Ashish Gupta(98130)
Ashish Gupta(98131)


The purpose of this assignment is to implement some of the image enhancing filters and operators both in spatial and frequency domain. Following image enhancement tools for grey level images were programmed:

Contrast Stretching:  The module designed for this image processing method uses a linear transformation method obtained from interactively specified values r1, r2, s1 and s2. A sample result of the designed module is shown below:


Image 1 : Original Image                                                       Histogram of Image 1


Image 2 :Transformed Image                                                      Histogram of Image 2

The values used were r1 = 0.2, r2 = 0.6, s1 = 0.1, s2 = 0.8

Histogram Equalization:  The module designed for histogram equalization does so for both global and local enhancement of the image. In the case of Global Histogram Equalization no user input is required, while in the case of Local Enhancement the user needs to specify the size of mask which specifies the neighbourhood of pixel in which histogram equalization is to be done.


Image 3 : Original Image                                                           Histogram of Image 3


Image 4 :  after Global Histogram Equalization                                              Histogram of Image 4


Image 5 :  after Local Histogram Equalization                                              Histogram of Image 5

The above result was obtained with a mask of size 9.

Histogram Specification: The module takes in an image and a density function, and converts the frquency density function into the specified density function. The module takes an image as input to get the desired density function.


Image 6 :  Original Image                                                         Histogram of Image 6

Desired density function


Image 7 :  Transformed Image                                                    Histogram of Image 7

Smoothening Filters: These were implemented using general mask,both for neighbourhood averaging and median filtering. The effect of increasing the mask size shows  reduction in image clarity.



Image 8 :  Original Image                                              Image 9 :  Mask = 5


Image 10:  Mask = 9                                               Image11:  Mask = 13

Median Filtering


Image 12 :  Original Image                                                  Image 13 :  Mask = 5


Image 14:  Mask = 9                                               Image15:  Mask = 13

High Pass and High Boost Filters: Modules were designed for sharpening of images. Applying only high pass filter causes image to become considerably dull. Adding original image (high boost) to it gives a much better result.


Image 16 :  Original Image                           Image 17 :  Mask = 3; A = 1.0


Image 17 :  Mask = 3; A = 1.4                    Image 17 :  Mask = 9; A = 1.4

All the filters gave the expected results. The performance was comparable to the Imakick Library Functions. The code for the program :