Anda di halaman 1dari 7

Volume 2, Issue 3, March 2012 ISSN: 2277 128X

International Journal of Advanced Research in

Computer Science and Software Engineering
Research Paper
Available online at:
Comparative Study and Implementation of Image Processing
Techniques Using MATLAB
Sukhjinder Singh* R. K. Bansal Savina Bansal
M Tech research scholar Faculty, Department of ECE Director, BHSBIET
PTU GZS Campus, Bathinda-151001 (India) PTU GZS Campus, Bathinda-151001 (India) Lehragaga-148031(India)

Abstract: - Image enhancement aims at improving the quality of image for better visualization. This paper presents three methods of
image enhancement: - GHE, LHE an d DS IHE that improve the visual quality of images. In this paper, we implement and examine the
effect of above mentioned techniques based on objective and subjective image quality parameters (like PSNR, NAE, S C, AE and
MOS ) to measure the quality of gray scale enhanced images. A comparati ve analysis is also being carried out. For handling gray-level
images, Histogram Equalization (HE) methods (like GHE and LHE) tend to change the mean brightness of an image to middle level of
the gray-level range limiting their appropriateness for contrast enhancement in consumer electronics. The DS IHE methods seem to
overcome this disadvantage as they tend to preserve both, the brightness and contrast enhancement, though at the cost of naturalness
of the input image.

Keywords: - Contrast enhancement, histogram equalization, PS NR, NAE, MOS , SC, AE, image enhancement, visual quality.

I. INTRODUCTION implementation of various Histogram Processing

Sight is one of the most powerful senses used by Techniques (HPTs). Sect ion VIII describes subjective and
human to perceive their environment. Large parts of the objective image quality measures used in the work.
routine cerebral activit ies of hu man beings include Experimental results and discussion are presented in
receiving as well as analyzing images. In fact, more than Section IX.
99% of the activity of human brain is involved in
processing images fro m the visual cortex [9]. A visual
image is rich in info rmation and can save thousand words. Image enhancement is basically improving the
Many real world images are acquired with low contrast and interpretability or perception of information in images for
unsuitable for human eyes to read, such as medical and human viewers and providing better input for other
industrial X-ray images [13]. Image enhancement is a automated image processing techniques. The principal
classical problem in image processing and computer vision. objective of image enhancement is to modify attributes of
The image enhancement is widely used for image an image to make mo re suitable for given tas k and a
processing and as a preprocessing step in speech specific observer. During this process, one or more
recognition, texture synthesis and many other image/video attributes of an image are modified. The choice of
processing applications [5, 6]. Various image contrast attributes and the way they are modified are specific to a
enhancement algorithms are proposed in literature wh ich given task. Moreover, observer-specific factors such as the
includes gray scale manipulation, filtering and HE. The human visual system and the observer’s experience will
main purpose of image enhancement is to bring out details introduce a great deal of subjectivity into choice of image
that are hidden in an image or to increase contrast in a low enhancement methods. Image enhancement is used in the
contrast image [8]. following cases:- removal of noise fro m image,
The rest of the paper is organized as follows: - Section enhancement of dark image and highlight the edges of the
II describes image enhancement. In the next section, HE objects in an image. The result is more suitable than the
will be reviewed. Section IV, V and VI lists GHE, LHE original image for certain specific applications. Processing
and DSIHE respectively. Section VII provides techniques are very much problem-oriented. For examp le,
Volume 2, Issue 3, March 2012
the best technique for enhancement of X-ray image may region is then moved to adjacent pixel and the histogram
not be best for enhancement of microscopic images [8]. equalization is repeated. This method allows each pixel to
There exist many techniques that can be used to enhance an adapt to its neighboring region, so that high contrast can be
image without spoiling it. The enhancement methods can obtained for all locations in the image. This method is also
be broadly divided into the following two categories : - known as Adaptive Histogram Equalization (AHE).
spatial do main methods and frequency domain methods. However, since LHE (or A HE) must be performed for
Spatial do main methods are operated directly on pixels every pixel in the entire image, the computation comp lexity
whereas frequency domain methods operate on the Fourier is very high [10]. Hence, LHE can remove the local
transform of an image. brightness problem; however the overlapping slid ing mask
mechanis m makes the LHE co mputationally expensive.
Histogram of a d iscrete gray-level image represents the
frequency of occurrence of all the gray levels in the image. Some researchers [1-7] have focused on the
Histogram based techniques are the most popular digital improvement of HE by decomposing the image into two or
image processing techniques which can be used for image more sub-images and equalizing them separately. In
enhancement owing to their simp licity and effectiveness contrast, major d ifference among these methods is the
besides being economical. Histogram based techniques for criteria they use to decompose the input image into two or
image enhancement, are mos tly based on equalizing the more sub-images. Dualistic Sub-Image Histogram
histogram of the image which increase the dynamic range Equalization (DSIHE) method decomposes the original
corresponding to the image. It can be categorized into two image into two sub-images based on median [12] of
methods [7]:- Global Histogram Equalization (GHE) and original image’s brightness and then equalizes the
Local Histogram Equalization (LHE). histograms of sub-images separately. It claims that if the
separating level of histogram is the median of the original
image’s brightness, it will yield the maximu m entropy after
Global Histogram Equalization (GHE) [3, 7, 11] is one two independent sub-equalizat ions.
of the popular methods used to enhance the contrast of
image. In GHE, the histogram of whole input image is first
obtained, then the Cumu lative Distribution Function (CDF) The techniques mentioned above are compared based
is calculated and gray transfer function is derived fro m the on subjective as well as objective parameters in this work.
CDF. Though it is simple, it doesn’t take account of local The algorithmic steps involved in these techniques are
image informat ion and often cause some contrast losses in outlined below:-
small regions. GHE has been widely used in many areas
A. GHE Method
such as medical and radar imaging. Although this global
approach is suitable for overall enhancement, it fails to Algorithm Steps:-
adapt the local brightness features of the input image and
The Histogram of digital image X={X (i, j)}, with L
shifts the mean intensity to middle intensity level, discrete intensity levels denoted by {𝑋0 , 𝑋1, … … . . , 𝑋𝐿 −1 }, is
regardless of input mean intensity. GHE is rarely used in
defined as:-
consumer electronics such as digital cameras because it
may produce undesirable distortions such as: excessive 𝑕 𝑋𝑘 = 𝑛𝑘 , for 𝑘 = 0, 1, … , 𝐿 − 1........ (i)
brightness change, noise-artifacts, gray-level saturation and
Where Xk is the k th intensity value and n k is the number
unnatural enhancement. of pixels in the image with intensity rk. For an M × N
V. LOCAL HE image, a normalized histogram known as Probability
Density Function (PDF) is defined by:-
To overcome the shortcoming of GHE, a Local
Histogram Equalization (LHE) method has been 𝑝 𝑋𝑘 = , for 𝑘 = 0, 1, … , 𝐿 − 1……. (ii)
developed. In this method, a contextual region is first
defined [10, 13], a histogram of that region is obtained, and Where p(Xk) gives an estimate of the probability of
then its grey level transfer function is derived from its occurrence of gray level Xk in an image. Based on the PDF,
CDF. Thereafter, the center pixel of the region is histogram the Cu mulative Density Function (CDF) is defined as:-
equalization using this function. The center of rectangular

© 2012, IJARCSSE All Rights Reserved Page | 245

Volume 2, Issue 3, March 2012
𝑘 Let an image X (i, j) is segmented by a section with
𝑐 𝑋𝑘 = 𝑝 𝑋𝑗 , for k = 0, 1, … , 𝐿 − 1 … (𝑖𝑖𝑖) gray level of X=Xm and the two sub-images are XL and XU
𝑗 =0 [12], so we have:-
GHE enhances X={X (i, j)}, by using CDF as its 𝑋 = 𝑋𝐿 ∪ 𝑋𝑈 ……………… (vii)
transformation function. This transformation functio n, f Here 𝑋𝐿 = (𝑋(𝑖, 𝑗)|𝑋 𝑖, 𝑗 < 𝑋𝑚 ∀ 𝑋(𝑖, 𝑗) ∈ 𝑋)
(Xk), is defined as:- and 𝑋𝑈 = (𝑋(𝑖, 𝑗)|𝑋 𝑖, 𝑗 ≥ 𝑋𝑚 ∀ 𝑋(𝑖, 𝑗) ∈ 𝑋).
𝑓 𝑋𝑘 = 𝑋0 + (𝑋𝐿 −1 − 𝑋0 )𝑐(𝑋𝑘 )…….. (iv) It is obvious that sub-image XL is composed by gray
level of {𝑋0 , 𝑋1, … , 𝑋𝑚 −1 }, while sub-image XU is co mposed
Then the output image produced by GHE, Y={Y (i, j)}
of {𝑋𝑚 , 𝑋𝑚 +1 , … … . . , 𝑋𝐿 −1 }. The aggregation of original
can be expressed as:-
image’s gray level distribution probability is decomposed
𝑌 = 𝑓(𝑥)………………….. (v) into {𝑝0 , 𝑝1 , … … . . , 𝑝𝑚 −1 } and {𝑝𝑚 , 𝑝𝑚 +1, … … . . , 𝑝𝐿 −1 }
𝑌 = 𝑓{(𝑋(𝑖, 𝑗)|∀𝑋(𝑖, 𝑗) ∈ 𝑋}……….. (vi) correspondingly. The corresponding CDF will be :-
Although GHE successfully increases the contrast in 1 𝑘
𝐶𝐿 𝑋𝑘 = 𝑝
𝑖 =0 𝑖 ,
𝑘 = 0,1, … 𝑚 − 1 … (𝑣𝑖𝑖𝑖 )
the image, this method does not put any constrain in
preserving the mean brightness. 1 𝐿 −1
𝐶𝑈 𝑋𝑘 = 𝑖 =𝑚
𝑝𝑖 , 𝑘 = 𝑚, 𝑚 + 1, … 𝐿 − 1
𝑝 −1
B. LHE Method … (ix)
Algorithm Steps:- Based upon CDF, t ransform functions of two sub -
image’s histogram are equalized below:-
1) Calcu late number of rows and columns in an input 𝐹𝐿 𝑋𝑘 = 𝑋0 + 𝑋𝑚 −1 − 𝑋0 𝐶𝐿 𝑋𝑘 ,
image i.e. size of an image. Also obtain number of bins for 𝑘 = 0, 1, … , 𝑚 − 1… (x)
the histograms used in building image transform function 𝐹𝑈 𝑋𝑘 = 𝑋𝑚 + 𝑋𝐿 −1 − 𝑋𝑚 𝐶𝑈 𝑋𝑘 ,
i.e. dynamic range. 𝑘 = 𝑚, 𝑚 + 1, . . . , 𝐿 − 1 … (𝑥𝑖)
2) Pre-process the inputs obtained in step 1 to At last result of dualistic sub-image histogram is
determine real clip limit fro m the normalized value. If obtained after the two equalized sub-images are composed
necessary, pad the image before splitting it into regions. into one image. Suppose Y (i, j) denotes the processed
3) Process each contextual region (tile) thus producing image then:-
gray level mappings: Extract a single image region, make a 𝑌 = 𝑌 𝑖. 𝑗 = 𝐹𝐿 𝑋𝐿 ∪ 𝐹𝑈 𝑋𝑈 ……. (xii)
histogram for this region using the specified nu mber of
bins, clip the histogram using clip limit, and create a 𝑋0 + 𝑋𝑚 − 𝑋0 𝐶𝐿 𝑋𝑘
𝑜𝑟 𝑌 𝑖, 𝑗 = .. (xiii)
mapping (t ransformat ion function) for th is region. 𝑋𝑚 +1 + 𝑋𝐿 −1 − 𝑋𝑚 +1 𝐶𝑈 𝑋𝑘
4) Interpolate gray level mappings in order to assemble Flow chart of various algorith m steps for DSIHE [9,
final LHE image: Ext ract cluster of four neighboring 11] is shown in Figure 1.1.
mapping functions, process image reg ion partly
overlapping each of the mapping tiles, ext ract a single
pixel, apply four mappings to that pixel, and interpolate
between the results to obtain the output pixel; repeat over
the entire image.
C. DSIHE Method

Algorithm Steps:-

Dualistic Sub-Image Histogram Equalizat ion (DSIHE)

first decomposes an input image into two sub-images based
on the median of the input image [1]. One of the sub image
is set of samples less than or equal to the med ian whereas
the second one is the set of samples greater than the
med ian. Then the DSIHE equalizes the sub images
independently based on their respective histograms .
Fig. 1.1:- Flow chart for DSIHE

© 2012, IJARCSSE All Rights Reserved Page | 246

Volume 2, Issue 3, March 2012
𝑀 𝑁 2
VIII. PERFORMA NCE ANA LYSIS 𝑖=1 𝑗 =1 |𝑋(𝑖 ,𝑗 )|
𝑆𝐶 = 𝑀 𝑁 ^ 2
………. (xviii)
𝑖 =1 𝑗 =1 |𝑋 𝑖.𝑗 |
Image Quality Measurement (IQM) is vital in the
4) Average Difference (AD)
development of image processing algorithms such as
This measure shows the average difference between
enhancement, deblurring, denoising etc. as it can be used to
the pixel values and is defined as follows:-
evaluate their performances in terms of quality of 𝑀 𝑁 ^
𝑖 =1 𝑗 =1 |𝑋 i.j −𝑋 (i,j)|
processed image. 𝐴𝐷 = …….. (xix)

A. Subjective Quality Measurement Ideally it should be zero.

In fact, in image enhancement system, the tru ly

definit ive measure of image quality is perceptual quality.
The enhanced image quality is specified by Mean Opinion Various image enhancement techniques such as
Score (M OS), which is result of perception based histogram equalizat ion (like GHE, LHE) and mu lti-
subjective evaluation [14]. The meanings of the 5-level histogram equalizat ion (like DSIHE) are imp lemented
grading scales of MOS are: - 5-pleasant or excellent, 4- using MATLAB platform and compared based on prior
good, 3-acceptable, 2-poor quality and 1-unaceptable. knowledge on the Histogram Equalization. The
MOS is defined as follow:- performance of all these image enhancement techniques is
𝑠 analyzed for a set of real t ime images and results are
𝑀𝑂𝑆 = i𝑃𝑖 ,………………………..… (𝑥𝑖𝑣 ) presented in Appendix 1A (Table 1.1-1.2) and 1B (Fig 1.2-
𝑖 =0 1.7) and. The comparat ive study of Histogram
Where i is an image score; Pi is image score Equalization based methods shows that the images
probability and S is number of observer. requiring higher brightness preservation are not handled
B. Objective Quality Measurements well by both GHE as well LHE. These are somewhat better
1) Peak Signal-to-Noise Ratio (PSNR) enhanced by DSIHE technique which provides maximal
brightness preservation. Though these methods provide
PSNR is the evaluation standard of the reconstructed good contrast enhancement, they also result in more
image quality, and is important feature. The small value of annoying side effects depending on the variation of gray
PSNR means that image is poor quality. PSNR is defined level distribution in the histogram. LHE technique achieves
as follow:- better quality through qualitative visual inspection (like
2552 MOS) and quantitative accuracies of PSNR, NA E, SC and
𝑃𝑆𝑁𝑅 = 10𝑙𝑜𝑔 …………… (xv)
𝑀𝑆𝐸 AD as compared to other methods.
Where 255 is maximu m possible value that can be In subsequent work, for the enhancement purpose
attained by the image signal. Ideally it is infinite. more images can be taken from d ifferent application fields
Practically it is in the range of 25 to 40 d B. Mean Square so that it becomes clearer that for wh ich application wh ich
Error (MSE) is defined as:- particular technique is better both for Gray Scale Images
and color Images. Particu larly, for color images there are
1 not many performances measurement parameter
𝑀𝑆𝐸 = | 𝑋 𝑖. 𝑗 − 𝑋 ^ 𝑖, 𝑗 |2 . . (𝑥𝑣𝑖)
𝑀𝑁 considered. So, new parameters can be considered for the
𝑗 =1
𝑖 =1 evaluation of enhancement techniques. New co lor models
Where M X N is size of original image; X (i, j) and X^ can also be chosen for better comparison purpose.
(i, j) are the orig inal image and enhanced image Optimization of various enhancement techniques can be
respectively. done to reduce computational complexity as much as
2) Normalized Absolute Error (NAE)
The large the value of NA E means that image is poo r REFERENCES
quality.NA E is defined as:- [1] Chao Wang and Zhongfu Ye, “Brightness Preserving
𝑀 𝑁 ^
𝑖 =1 𝑗 =1 |𝑋 𝑖 .𝑗 −𝑋 (𝑖,𝑗 )|
𝑁𝐴𝐸 = 𝑀 𝑁 … … (xvii) Histogram Equalizat ion with Maximu m Entropy: A
𝑖=1 𝑗 =1 |𝑋 𝑖.𝑗 |
Variational Perspective”, IEEE Transactions on
3) Structural Content (SC) Consumer Electronics, Vol. 51, No. 4, pp.1326-1334,
The large value of SC means that image is a poor
November 2005.
quality. SC is defined as follows:-

© 2012, IJARCSSE All Rights Reserved Page | 247

Volume 2, Issue 3, March 2012
[2] Chen D. and Ramli R., “Preserving Brightness in [8] Rafael C. Gon zalez, Richard E. Woods, “Digital Image
Histogram Equalizat ion Based Contrast Enhancement Processing”, 2nd edition, Prentice Hall, 2002.
Techniques”, Co mputer Journal of Digital Signal
[9] Rajesh Garg et al., “Histogram Equalization
Processing, Vol. 14, No. 5, pp. 413-428, 2004.
Techniques for Image Enhancement”, IJECT, Vol.
[3] David Menotti et al., “Multi-Histogram Equalization 2, Issue 1, pp. 107-111, March 2011.
Methods for Contrast Enhancement and Brightness
[10] Stephen M.Pizer et al.,“Adaptive Histogram
Preserving”, IEEE Transactions on Consumer
Equalization and Its Variations”, Computer Vision,
Electronics, Vol. 53, No. 3, pp. 1186-1194, August
Graphics, and Image Processing, Vo l. 39, pp.355-
368, 1987.
[4] Dr. Muna F. Al-Samaraie and Dr. Nedhal Abdul Majied
Al Saiyd “Medical Co lored Image Enhancement Using [11] Sunita Dhariwal, “Co mparative Analysis of Various
Wavelet”, Ubiquitous Computing and Co mmun ication Image Enhancement Techniques”, IJECT, Vo l.2, Issue
Journal, Vo l. 6, pp.1-8, November 2005. 3, pp. 91-95, September 2011.

[5] Hasanul Kabir et al., “Brightness Preserving Image [12] Vinay Ku mar and Himani Bansal, “Perfo rmance
Contrast Enhancement Using Weighted Mixture of Evaluation of Contrast Enhancement Techniques for
Global and Local Transformat ion Functions”, The Dig ital Images”, IJECT Vo l.2. Issue 1, pp. 23-27,
International Arab Journal of Information Technology, March 2011.
Vo l. 7, No. 4, pp. 403-410, October 2010.
[13] WANG Zhiming and TAO Jianhua, “A Fast
[6] Ho jat Yeganeh et al., “A Novel Approach for Contrast Implementation of Adaptive Histogram Equalizat ion”,
Enhancement Based on Histogram Equalization” International Conference on Signal Processing, ICSP,
International Conference on Co mputer and 2006.
Co mmunicat ion Engineering, ICCCE, pp. 256 – 260,
[14] Ratchakit Sakuldee and Somkait Udo mhunsakul,
13-15 May, 2008.
“Objective Performance of Co mpressed Image Quality
[7] Hyunsup Yoon et al., “Image Contrast Enhancement Assessments”, International Journal of Electrical and
based Sub-histogram Equalization Technique without Co mputer Engineering, vol. 2, no. 4, pp. 258-267,
Over-equalization Noise”, World Academy of Science, 2007.
Engineering and Technology, Vol. 50, pp.176-182,


Table 1.1:- For Image-1

GHE 25.4987 0.28146 1.42728 44.3106
LHE 25.6152 0.26598 1.40393 40.842
DSIHE 24.996 0.32442 1.62861 54.9133

© 2012, IJARCSSE All Rights Reserved Page | 248

Volume 2, Issue 3, March 2012
Table 1.2:- For Image-2

GHE 26.9501 0.356505 0.969931 5.5082
LHE 28.8908 0.117071 1.03166 17.4332
DSIHE 26.6975 0.359612 1.07279 23.8343


Fig. 1.6:- Original and DSIHE Images-1

Fig. 1.2:- Original and GHE Images-1

Fig. 1.3:- Original and GHE Images-2

Fig. 1.4:- Original and LHE Images-1

© 2012, IJARCSSE All Rights Reserved Page | 249

Volume 2, Issue 3, March 2012

Fig. 1.5:- Original and LHE Images-2

Fig. 1.7:- Original and DSIHE Images-2

© 2012, IJARCSSE All Rights Reserved Page | 250