0% found this document useful (0 votes)
8 views17 pages

CV Utsav Kashyap 12019414

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 17

IMAGE ENHANCEMENT USING

HISTOGRAM EQUALIZATION

Lovely Professional University


School of computer science
Image Enhancement using Histogram Equalization
Lovely Professional University
School of computer science
Reg.No.12019414
Roll.No.31
Name. utsav kashyap

Abstract
Now a days the conditions at which the image taken may lead to near zero visibility for the
human eye. They may usually due to lack of clarity, just like effects enclosed on earth’s
atmosphere which have effects upon the images due to haze, fog and other day light effects.
The effects on such images may exists, so useful information taken under those scenarios
should be enhanced and made clear to recognize the objects and other useful information. To
deal with such issues caused by low light or through the imaging devices experience haze
effect many image processing algorithms were implemented. These algorithms also provide
nonlinear contrast enhancement to some extent. We took pre-existed algorithms like SMQT
(Successive mean Quantization Transform), V Transform, histogram equalization algorithms
to improve the visual quality of digital picture with large range scenes and with irregular
lighting conditions. These algorithms were performed in two different method and tested using
different image facing low light and color change and succeeded in obtaining the enhanced
image. These algorithms helps in various enhancements like color, contrast and very accurate
results of images with low light. Histogram equalization technique is implemented by
interpreting histogram of image as probability density function. To an image cumulative
distribution function is applied so that accumulated histogram values are obtained. Then the
values of the pixels are changed based on their probability and spread over the histogram.
From these algorithms we choose histogram equalization, MATLAB code is taken as reference
and made changes to implement in API (Application Program Interface) using JAVA and
confirms that the application works properly with reduction of execution time.

Keywords: Application program interface, Histogram equalization,


Probability density function, Successive mean quantization transform
1.3 Division of work
I INTRODUCTION At the beginning of our work consists of two different
1 INTRODUCTION methods to implement in MATLAB. Where method 1
1.1 Introduction implementation is took care by Prathik and method 2
The real world scenarios usually suffer from lack of clarity 6
and effects with low light. High dynamic range image is and related implementation is took care by Srinivas. Later
more effective in extraction of contextual information from the android application implementation is new, so the
the image. Where night time images taken may exists low authors decided to work together.
intensities values and have suffer from noise due to very 1.4 Research Questions and hypothesis
low signal power. Q1: Are these enhancement algorithms applicable for low
The aim of the project is to increase the contrast and color contrast images? H1: From the evaluation of the algorithms
in order to improve the visual appearance of valuable it is clear that histogram equalization is applicable and better
information. These techniques can be used for analyze the for contrast enhancement with high computational speed
detection and pixel segmentation purposes. Normally than the SMQT algorithm.
several application require this low light image Q2: How much restoration of image can be obtained?
enhancement including surveillance, astronomical and H2: For image facing fog effect shown in figure, restoration
medical imaging. proves good view of deer by changing the iteration levels in
Early approaches in the problem relied on Sparse V-transform algorithm.
Representation technique. It is simplistic strategy which Q3: How efficient will be the android application?
introduces necessary information from the image and there H3: The efficiency of the android application is measured in
is a need to increase the reconstruction quality and real time environment. Performance of the application is
alternative feature operators. HE (histogram equalization) faster than MATLAB.
it is relatively simple to introduce this technique and 1.5 Related Work
usually introduces multiple artifacts and leads to significant We compare existing enhancement algorithms by using
loss of details in the image. To enhance the low light image, median absolute deviation method and also makes
that inverts the dark input frames and then provide a de- implementation in both Matlab and Android environment.
haze algorithm to improve the illuminant component. 1.6 Main contribution
Problems arrived due to the component and parameter leads After the related survey, Histogram equalization is
to introduce the artifacts in reconstruction of the image. applicable for different type of RGB images (.tif, .jpg, .png
In this report we present the methods rely on a single image etc). By converting RGB image to HSV format there is no
for estimation of the enhanced image, using these loss in its intensities. Here we judge performance of the
algorithms SMQT (Successive mean Quantization existed enhancement algorithms which gives a better output
Transform), V Transform, histogram equalization method image with some parameters. All the three techniques are
techniques. Particularly Successive mean Quantization applicable for low contrast images. Histogram equalization
Transform and V Transform enhances better luminance is the better method when compared with the other. We get
values in the image. Histogram equalization is better to moderate output while compiling in the android application.
increase the contrast level and enhance the grey scale Suitable plots and histograms are present in results of the
images all the algorithms accomplished with high test.
computational power and obtained in great visual quality.
1.2 Objectives 2 DIGITAL IMAGE PROCESSING:
The main aim of this research is to compare three different
techniques that are used in image enhancement. To perform 2.1 Image and Picture:
java based android application as “Test enhancer”. As mentioned earlier human beings are usually visual
• Successive means quantization transform creatures mostly relying on our vision to sense the world
(SMQT). around us. They not only visualize the things but they can
• Histogram Equalization (own function and Matlab scan and obtain the overall rough feeling around us with a
function). quick glance. Humans can easily identify the face and can
• V transform, a function about enhancement differentiate colors and process the large amount of visual
through rgb2hsv conversion. information very quickly. For our purposes, image is a

View publication stats


single picture which can represents person, animals, Which are called as pixels or the image elements.
outdoor scene, microphotograph of electronic component, Different colors are generated by making different
result of medical imaging. Even if the picture is not proportions of the 3 primary colors: i.e. RGB (red, green,
recognizable immediately it will not be a random blur. blue). Representation of a color image is done as N×M×3 is
2.2 What is image processing? the three-dimensional matrix, where each layer representing
Image processing involve in change the nature of the image the gray-level distribution of the primary color in the image.
in order to improve its pictorial information for human To the each point in the image denote (x, y) coordinates is
interpretation and render it more opportune for autonomous referred to as a pixel. Where pixel is the smallest cell of
machine perception. Digital image processing involves and information in the image. It contains the values of the
concerns in the change the nature of a digital image. intensity level corresponding to the detected irradiance. The
Humans like their image to be sharp but machines prefer difference in the gray levels of two adjacent pixels gives the
image to be simple and uncluttered. To make the image contrast needed to differentiate between objects and regions.
sharper, edges of an image is to enhance. An example is There should be certain magnitude of the difference in order
shown in the figure 1. Therefore second image is sharper to identify it as a boundary by the human eye.
than the first. Sharpening edge is an essential component of 2.4 Application:
printing in order to appear good for the printed page so Image processing has huge range of applications mostly in
sharpening is preferred. science and technology can make use of image processing
Figure 1: Image Sharpening [2] methods. Here to discuss a short list of some indication of
2.3 Digital images: the range of image processing applications.
For present instant consider an image which is color less or • Medicine Inspection and explanation of images
black and white. Then these images are considered as being obtained from various medicine applications like X-
a two-dimension function, this function values implies the rays, MRI (Magnetic resonance imaging) scans, and
brightness of the image at any instant of time. Let us analysis of cells like chromosome karyotypes.
• Aerial/Satellite views of land, agriculture for
example how much of land is used for different
purposes, or to find the suitability for cultivate
different crops in different region, to inspect the
quality of fruits and vegetables weather they are
fresh product or expired.
• Automatic inspection of items on a product line in
industry.
• Fingerprint analysis in law enforcement, de-
blurring or enhancing the speed
camera images for face recognition.
8
2.5 Types of digital Images
assume in that images the brightness values can be
2.5.1 Binary:
represented as a real number from the scale of 0 to 1 where
There are two possible values for each pixel and needs one
0 implies that it is black and 1 represent it is white. The
bit per pixel. Each pixel is just black or white. Such images
scale of x and y will clearly depend on the image, but they
can therefore be efficient in terms of storage. [3] Images for
can take all real scaling from low to high values. A digital
which a binary representation may be suitable include text,
image is essentially a two- dimensional array of light –
fingerprints etc. In the below figure it has two colors i.e.
intensity levels varies from a real time photo in which the
white for edges and black for background.
spatial coordinates (x, y) gives the intensity of the image at
9
the point and the function as f(x, y) are represented as
discrete. These values are usually integers, so the image
will consist of 0 and 1 consist from 1 to 256 each, and
brightness level values ranging from 0 to 255 that is black
to white. A digital image can be as a large array of discrete
dots, each of which has a brightness level associated to it.

View publication stats


2.5.2 Greyscale:
Figure 2: Binary Image [2]
Each pixel in image is grey shaded ranges from 0(black) to
255(white). In this way each pixel can be represented by
eight bits or exactly one byte. This is a natural range for Figure 4 Color Image [4]
image file handling. In general power of greyscale is 2. 2.5.4 HSV Model Image:
Such images arise in X-rays, printed works and indeed 256 The HSV color model image is based on RGB image HSV
different grey levels are enough for the recognition of most refers to Hue, Saturation, and Brightness.
natural objects. • Hue: The “attribute of a visual sensation according
Figure 3: Greyscale Image [2] to which an area appears to be similar to one of the
2.5.3 True color or RGB: perceived colors like red, yellow, green and blue, or
Here each pixel has a particular color that is being to combination of them”.
described by the amount of red, green and blue planes in it. • Saturation: Colorfulness of an area judged in
If the components has a range from 0 to 255, this gives a proportion to its brightness.
total of 16,777,216 different possible colors. Total bits • Brightness: The “attribute of a visual sensation
required for each pixel is 24 such images are named as 24- according to which an area appears to emit more or
bit color images. Such image consisting of three matrices less light.
representing red, green and blue for each pixel. This means Mainly HSV model is cylindrical coordinate model. It is
that for every pixel there correspond three values. mainly based on three components.
• H (hue) represents the circumference so the degree
says the color of that pixel.
• S (saturation) is the distance from the cylinder axe.
• V (value also called as brightness) it is usually
represent from 0 and 1.
Where value 0 means pixel is black. From all these HSV
model can be interpreted as cone in figure.
11

10

View publication stats


Figure 5:. respectively. H(u, v) represents the transfer function of the
process.
3 IMAGE ENHANCEMENT: 3.2 Histogram processing:
The histogram of a digital image which has gray levels
3.1 Introduction ranges from [0, L-1] is a discrete function,
The main objective of image enhancement is to enhance the Here is the intensity level in the original raw image, is
given input image so that the output of the enhancement is
the number of pixels in the image having gray level , n is
suitable to the specific application. Enhancement of the
the total number of pixels, k is the gray level specified with
image takes place in contrast, edges, boundaries etc. based
k=0, 1...L-1.
on the required output. Enhancement will not increase the
original information content of the data, instead it will
The estimated amount of probability of gray scale
increase the dynamic range of specific features as chosen.
The major drawback in image enhancement is quantifying occurrence is given ). The histogram of the image is used
the criterion for enhancement and as a result enhancement to find the information about the
techniques require interactive procedures to get necessary
results. by P (
To process an image there are two main methods defined possibility of contrast enhancement.
by the domain in which image in processed, they are If the histogram of narrow shape specifies little dynamic
namely spatial domain and frequency domain. The spatial range then corresponds of the image have low contrast.
domain processing mainly refers to image plane in which it Figure 6: Histogram for (a) dark, (b) Bright, (c) Low
directly manipulated the pixels in the image. Frequency contrast, (d) High contrast images [5].
domain processing is based modifying the spatial
frequency spectrum of the image as obtained by Fourier
transform.
3.1.1 Spatial domain enhancement methods:
Spatial domain technique refers to the aggregate of pixels
composed in the image and operate directly on these pixels.
The image processing function in spatial domain is given
as:
g(x,y)=T[f(x,y)].
Here, f(x, y) is the input image data, g(x, y) is the proceed
image data, here T is the operation used on set of input
images, for example performing pixel by pixel sum and to
make average a number of images for noise removal. Here
the resultant is stored separately instead of changing the
pixel values to avoid the snow- balling effect of the altered
gray levels.
3.1.2 Frequency domain enhancement methods:
Frequency domain technique is operated on convolution
theorem. Processed image is obtained by convolution of an 14
image f(x, y) with position invariant operation h(x, y). 3.2.1 Histogram equalization:
g(x, y) = f(x, y)∗h(x, y). • The main aim of histogram equalization is to relate
By the convolution theorem, the following frequency an input image with output image in histogram such
domain relation is obtained: Here the frequency domain that it is uniform after relating.
with DFT is performed in 2D convolution. • Here gray levels of the image to be enhanced will
G(u, v) = F(u, v) H(u, v). be represented by r and enhanced output be s with
13 transformation from s= T(r).
Where G, H, and F are the Fourier transforms of g, h, and f • Using a transformation function which equal to the

View publication stats


cumulative distribution of the probability density image [5]
of the image pixels r to produce an image of gray
levels with uniform density, it involves an increase
of dynamic range of pixels.

17
4.3 Proposed Algorithms:
4.3.1 SMQT Algorithm
Let x be a pixel and set D consists of d data points as input
to transform. V(x) denotes value of the data point. This
project set D is the HDR image of size D = M × N if grey
4 ENHANCEMENT IN IMAGE PROCESSING scale luminance and D = M × N × 3 if color. SMQT has only
one parameter level L, the transformed image output set of
4.1 Introduction level L is denoted as D to Ɱ is
The visual quality of the image is increased or improved by The basic function can be described by a Mean
image enhancement. Image enhancement is the simplest Quantization Units (MQUs). It consists of three steps, first
and appealing areas of digital image processing. The is mean calculation this then mean value of all the pixels in
techniques related to enhancement brings out detail that is the image, then to the second step uses mean to quantize the
highlight certain features of interest in an image. Like values of data points into {0,1}. Depending upon the pixel
increase in contrast and brightness to look better image. value is lower or higher than the mean after doing this input
Image enhancement for the digital image result to more is spited into two.
suitable for display or further image analysis like noise
removal, sharpness or brighten an image. The process of
image enhancement is mainly divided into two domains i.e.
frequency domain and spatial domain. In frequency
domain, technique operate on frequency transform of the
image where as in spatial domain, technique can operate
directly on the pixels of the image.
4.2 Contrast enhancement
Contrast enhancement is performed by the tonal
enhancement of the image. It improves the brightness
differences uniformly across the dynamic range of the
image, whereas tonal enhancement improve the brightness
differences uniformly across the dynamic range of the
image, whereas tonal enhancement amend the brightness Figure 10: The operation of one Mean Quantization Unit
differences in the shadow (dark), mid tone (grays),or (MQU) [6].
highlight (bright) regions at the require for the brightness Figure 4.2.
differences in the other regions. Here MQU is not a similar value coefficient in this
Figure 9: Shows the original and contrast enhancement transform. The MQU constitutes the main computing unit

View publication stats


for SMQT. MQU is independent to gain and bias reshaping the enhanced v plane with the HSV image. Hence
adjustment of the input due U(x) can be interpreted as the the enhancement may work as color correction for some
structure of D(x) will be follows accordingly. Let output set images.
MQU denotes in tree as where l=1, 2... L is current level
and n is the number of output n = 1, 2... , then final
can be show as,
19
18 4.3.1.1 The SMQT Algorithm:
Successive Mean Quantization Transform algorithm
(SMQT) is a non- linear transformation that reveals the
structure of the data and removes properties like gain and
bias. The algorithm when applied to images that can be seen
as a progressive focus on the details in an image.
Let us consider the following vector,
Here in case of color image consider three separate vectors,
which represents a particular color channel in RGB image.
Each element in vector represents the intensity of the pixel.
The steps involved in applying the SMQT algorithm are:
1. 1) First, mean of the vector should be calculated.
Here mean of the vector is 27.33.
Figure 11: The Successive Mean Quantization Transform
2. 2) Now divide the vectors into two parts, numbers
(SMQT) as a binary tree of Mean Quantization Units
which are less than or equal to 27.33 and numbers
(MQUs) [6].
which are greater than 27.33 as shown below,
In RGB images, SMQT is applied in two different way
3. 3) As shown above the second row in code, then
ys. The first one is to apply in each of the three channels.
generate 0 to the values less than or equal to 27.33,
Let be all the data values of red,
and for 1 to the values greater than 27.33 gets 1.
4. 4) Now split the resulting vectors individually,
following the same rules in a recursive way. Here
the mean of our first vector is
(25+5+2+6+0+20+10) / 7 = 9.71, and the mean of
the second vector is (62+32+70+42+54) / 5 = 52.
These two vectors are further split into two more
vectors, and a second bit of the code is added to each
based on comparison with the mean.
The following result as below.
5. 5) Now allocate 0 for values less than or equal to
the mean and 1 for values greater than mean.
6. 6) Repeat this algorithm recursively as shown
below:
25 62 32 5 2 6 70 42 54 0 20 10
green and blue channel respectively, then 25 5 2 6 0 20 10 62 32 70 42 54
Finally the enhanced pixels set is found by concatenation 0 00000 0 1 1 1 1 1
all the data obtained from red, green and blue plane sets. 5 2 6 0 25 20 10 32 42 62 70 54
The result will be the nonlinear contrast enhancement and 00 00 00 00 01 01 01 10 10 11 11 11
neglects the order of the RGB values. 2 0 5 6 10 25 20 32 42 54 62 70
To the Second method consists in apply the SMQT to Value
000 000 001 001 010 011 011 100 101 110 110 111
plane in HSV image.
20
Finally the enhanced pixels set is found by

View publication stats


0 2 5 6 10 20 25 32 42 54 62 70 uniform illumination in their backgrounds. As this process
000 000 001 001 010 011 011 100 101 110 110 111 only integrates extra pixels to the light regions of the image
0 1 0 1 0 0 1 0 0 0 1 0 and abstracts extra pixels from dark regions of the image
At this step process get only one element for every vector resulting in a high dynamic range in the output image.
and for every successive step a 0 will be allocated, since the Histogram equalization is performed in two methods.
number will always be equal to itself and quantization level 1. Histogram Equalization on RGB color image:
of L=4. When we were going to use L=8, Then allocate 0s In the color image consist of independent R, G, and B planes
to each code. The result of L=8 would be as shown below. they are equalized independently using histogram
Now sort the vector in increasing order as shown below. equalization algorithm. Each channels of the RGB space
Substitute the original values of the input vector by its code processed and equalized independently. After that RGB
to obtain output vector. components are concatenate all and get the better image than
the input image.
0 2 5 6 10 20 25 32 42 54 62 70
Below block diagram shows the implementation,[8]
000 000 001 001 010 011 011 100 101 110 110 111
Figure 12: Block diagram shows the implementation, [8]
0 1 0 1 0 0 1 0 0 0 1 0
000 000 000 000 000 000 000 000 000 000 000 000
0 0 0 0 0 0 0 0 0 0 0 0
0 2 5 6 10 20 25 32 42 54 62 70
0 16 32 48 24 96 122 128 160 192 208 224
25 62 32 5 2 6 70 42 54 0 20 10
122 208 128 32 16 48 224 160 192 0 96 24
Resulting vector
The original image had a low gain, with its range going
from 0 to 62. Now its gain starts from 0 to 208, which is the
entire 8 bit range. The gain is removed because it doesn’t
22
matter if it is multiply or divide the elements of original
In histogram equalization technique, probability density
vector by the number 2 the output vector would be same.
function (pdf) that is being operated, to make it simple it
The range would be the entire range of destination vector
changes the pdf of a given image into uniform pdf that
that is 8 bits for L=8.
spreads out the lower pixel (0) to highest pixel value (m-1)
By multiply the input vector with 2 the output vector is
in this way the image is evenly throughout the dynamic
same because in each step the same numbers were above
range in between 0 and 1. This can be achieved when the
and below so mean will continue to be above and below it
pdf is in continuous function. But for the digital image pdf
and it will add 0 or 1 to the output. Using the entire range
will be discrete function. Let use consider image be x, and
from dark colors (0) to lighter colors (208) it ranges from
the dynamic range of the image be varies from 0 (black) to
dark to brighter image.
m-1 (white).
21
From this probability density function (pdf) can be
4.3.2 Histogram Equalization
approximated using probability
Histogram equalization [7] is one of the methods in image
based on the histogram p (
processing of contrast enhancement using image’s
From this cumulative density function (CDF) is obtained
histogram. The main function of histogram equalization is
as follows [1]:
to increase the global contrast of the image and adjustment
Mathematically:
of the intensities be better distributed on the histogram.
The output of the pixel from the histogram equalization
This allows for areas of lower local contrast to gain a higher
operation is then equal to the CDF of the image. Once the
contrast. This method is useful for both background and
original histogram is known the pixel values are changed
foreground that are both bright and dark for the image.
based on the original probability and spread over the
Histogram equalization is utilized to enhance the contrast
histogram.
of the image, it spreads the intensity values total range. This
2. Histogram Equalization using V Component from
technique can’t be utilized for images suffering from non-
HSV Color Space:

View publication stats


In this method, image must be converted to hue, saturation
and luminance (HSV) color space. Hue appears to be
impression related to the ascendant wavelength of the color
stimulus Saturation shows the relative color purity (amount
of white light in the color). Both hue and Saturation taken
together are also called the chromaticity coordinates (polar
system). In this method Histogram Equalization is Figure 13: Input Color image of deers

) as follows:

Figure 14: Color image of original V Transform algorithms


23
with n =1.
applied on V component on HSV color space. After the
Equalize the v plane combine the newly obtained values
with H and S. Then we get the equalized image compare to
input image [8].
HSV → H, S, V V → V (equalize)
HSV (equalize) → H, S, V (equalize)
4.3.3 V Transform
Figure 15: Color image of original V Transform algorithms
The V component contains information about the
with n =4.
brightness of image, so it can modified in color images
25
without change in color. It can change the color image by
operating in one component, so that the computational cost
is lower than operating in the three channels. As it works
on only one component it get an advantage from the HSV
model.
V transform requires less computational power than SMQT
for its simplicity. Below steps tells us about the procedure
of V transforms: Figure 16: Color image of original V Transform algorithms
• First step is to covert RGB image into HSV image. with n =8.
• Second step consist of extracting the V component Figure 17: Color image of original V Transform algorithms
and making a sorted with n =16.
vector with the V values For the above figures, n = 1 the algorithm performance is
• Third step divides the sorted vector into N good, but it does not give big changes than the original. For
segments of the same length. For increase in higher values of n, the transformed image has
each interval a start and a stop value is defined. more contrast and major effects, the algorithms can be good
• Finally, in each and every segment a linear for some applications but in this case there is no change in
transformation is performed in color only brightness itself gets changed.
order to spread the brightness from the start to stop values.
V transform can be applied to grey scale image, if the image
is consider as the V component itself.
24

5 MODELLING 5.1 MATLAB

View publication stats


Step 1: Read and convert the input image into separate R,
5.1 MATLAB G and B planes. The image is read by using ‘imread’
MATLAB is a high performance language for computing. command.
It is easy to use environment for problem solving which are Step 2: Image contrast enhancement of SMQT, histogram
expressed in familiar mathematical notation. MATLAB equalization is applied by using the calling function “SMQT
stands for matrix laboratory and was written to provide and hist_fun”. And apply to each plane.
easy access to LINPACK (linear system package) and Step 3: Rearranging the enhanced RGB planes by
EISPACK (Eigen system package) projects. concatenation process. Storing into result.
MATLAB features a family of applications to specific Step 4: Showing output image and its histogram by using
solutions called toolboxes. Toolbox is mainly allow ‘imshow’ and ‘imhist’ commands.
learning and applying specialized technology. The areas I 5.1.2 Implementing Method-2 of (SMQT, HE, V-transform)
which toolbox available are signal processing, control in MATLAB:
system, neural networks, fuzzy logic, wavelets and many In this method RGB image is convert into HSV image and
other. perform the algorithm on V plane where mainly consists of
MATLAB includes mainly Math and computation, brightness value. It is explained with a simple flow that as
Algorithm development, Data acquisition, data analysis, given below,
visualization, simulating, prototyping and engineering Figure 19: Flow chart for Method-2.
graphics, application development including GUI Detail explanation of the flow chart:
(graphical user interface building). Step 1: Read and convert the input image into separate R,
5.1.1 Implementing Method-1of (SMQT, HE) in G and B planes. The image is read by using ‘imread’
MATLAB: command.
In this project the proposed algorithm has been designed by Step 2: convert RGB image to HSV image by using
dividing RGB into three different planes i.e. red, green and command ‘rgb2hsv’ and extracting v- plane from the input.
blue planes and performing the algorithm to each plane. It Step 3: Image contrast enhancement of SMQT, histogram
is explained with a simple flow that as given below, equalization and V- transform is applied by using the calling
Figure 18: Flow chart for Method-1. function “SMQT and hist_fun”. And apply to V- plane.
Step 3: Rearranging the enhanced HSV planes and insert
new v values by concatenation process.

28
Step 4: Convert HSV to RGB image by using command
‘hsv2rgb’ store into result.
Step 5: Showing output image and its histogram by using
‘imshow’ and ‘imhist’ commands.
5.1.3 MAD (Median Absolute Deviation):
27
The median absolute deviation of a set of data is calculate
Detail explanation of the flow chart:

View publication stats


in MATLAB by the syntax ‘Y = median(abs(V(:)- equalized or convert to grey scale image.
median(V(:)))),’ for a matrix input , Y is the row of vector Step 3: Histogram equalization consists of three step where
containing the median absolute deviation of each column first calculate histogram values of the entire pixels in the
of V and for N- dimensional arrays, mad operates along the input image. Find out the probability density function by
non-singleton dimension of V. dividing 255 by total pixel values. And then cumulative
To obtain median absolute deviation of set of data are as distribution is obtained histogram values and accumulated
follows. Step 1: Find the median. value are distributed and new histogram values are obtained
Step 2: Find the distance between the each data value and and stored in the modified image.
the median i.e. find the absolute value of the difference Step 4: Modified image is shown in the process is done.
between each data value and the median. 5.2.2 Our Graphical User Interface:
Step 3: Find the median of those differences. Figure 21: Main menu of image enhancer application.
29
5.2 Android studio 6 RESULTS AND DISCUSSION
Android software development kit (SDK) includes
development tools such as debugger, libraries, In this chapter we presented three methodologies for image
documentation, sample code and tutorials. Currently contrast enhancement through histogram equalization,
development kit supports computer running with Linux, Successive mean Quantization technique and Value
Mac OS X 10.5.8 or updated and windows 7 or updated. transform from HSV of a color and grey scale image
After finding a suitable algorithm, we start to implement it described in section 4.3 is carried out. Firstly we show the
optimally in android by using Android studio and Android improvement in contrast of the image obtained for the
SDK (including am Android Emulator). We decided to call processed images. Finally, a run time analysis of the
our application “Image enhancer”. enhancement methods for color contrast enhancement
5.2.1 Implementation idea images is performed.
A general flow chart of our Image enhancer application is The results for techniques obtained to the images which are
given below: divided into greyscale and color images. The histograms can
be found for the images. Below results compiled in
MATLAB and explained down below the figure.
32
6.1 Method-1
6.1.1 Using gray scale image
Histogram equalization

Figure 20: General flow chart of Image enhance


application.
Detail explanation of the flow chart:
Step 1: Main menu consists of two buttons one is to load
image and other is for modify image. Input image is
selected by load button.
30
Step 2: Select the required modify image either histogram Figure 22: Above dark image as input and histogram

View publication stats


equalized image and their histogram of pixels.
For the grey scale image effect with low light effect,
histogram equalization is applied for the method 1, here
from the output histogram all the intensity value are
distributed and enhancement is done and brighten image in
obtained at the output.
33
Successive mean quantization transform (SMQT)

Figure 24: Aerial view of city image as input and histogram


equalized image and their histogram of pixels.
For the color image is effected with color noise, Histogram
equalization is applied for the method 1, here from the
output histogram all the intensity value are distributed and
enhancement is done and brighten image in obtained at the
output.
35
Successive mean quantization transform (SMQT).
Figure 23: Above dark image as input and SMQT enhanced
image and their histogram of pixels.
For the grey scale image effect with low light effect,
Successive mean quantization transform (SMQT) is
applied for the method 1, here from the output histogram
all the intensity value are distributed according to mean
quantize units at level L=8 and enhancement is done and
brighten image in obtained at the output.
34
6.1.2 Using color image
Histogram equalization

Figure 25: Aerial view of city image as input and SMQT


enhanced image and their histogram of pixels.
For the color image is effected with color noise, Successive
mean quantization transform (SMQT) is applied for the
method 1 here from the output histogram all the intensity
value are distributed according to mean quantize units at
level L=8 and enhancement is done and brighten image in
obtained at the output.
36

View publication stats


6.2 Method 2 brighten image in obtained at the output. Here we can say
6.2.1 Using gray scale image that the quality of the image is improved by increase in
Histogram Equalization MAD value of the input and output from 0.082 to 0.13.
38
V- Transform

Figure 26: Einstein input image and histogram equalized


image and their histogram of pixels.
For the grey scale image effect with low light effect,
histogram equalization is applied of method 2 for the Figure 28: Einstein input image and V-transformed image
image, here from the output histogram all the intensity and their histogram of pixels.
value are distributed and enhancement is done and brighten For the grey scale image effect with low light effect, V-
image in obtained at the output. Here we can say that the transform is applied for the method 2, here from the output
quality of the image is improved by increase in MAD value histogram all the new value are distributed according to
of the input and output from 0.082 to 0.25. 37 iteration value n =2 and enhancement is done and brighten
Successive mean quantization transform (SMQT). image in obtained at the output. Here we can say that the
quality of the image is improved by increase in MAD value
of the input and output from 0.082 to 0.9. 39
6.2.2 Using color scale image
Histogram Equalization

Figure 27: Einstein input image and SMQT enhanced


image and their histogram of pixels.
For the grey scale image effect with low light effect,
Successive mean quantization transform (SMQT) is
applied for the method 2, here from the output histogram Figure 29: Dark image of Mario as input image and
all the intensity value are distributed according to mean histogram equalized image and their histogram of pixels.
quantize units at level L=8 and enhancement is done and For the color image which effects with low light , histogram

View publication stats


equalization is applied of method 2 for the image, here from
the output histogram all the intensity value are distributed
and enhancement is done and brighten image in obtained at
the output. Here we can say that the quality of the image is
improved by increase in MAD value of the input and output
from 0.031 to 0.25.
40
Successive mean quantization transform (SMQT).

Figure 31: foggy image as input image and V-transformed


at n = 2 image and their histogram of pixels.
For the color image effect with low light effect, V-transform
is applied for the method 2, here from the output histogram
all the new value are distributed according to iteration value
n =2 and enhancement is done and brighten image in
obtained at the output. Here we can say that the quality of
the image is improved by increase in MAD value of the
Figure 30: Dark image of Mario as input image and SMQT input and output from 0.086 to 0.18.
image and their histogram of pixels. 42
For the color image effect with low light effect, Successive 6.3 Compare Method-1 & Method-2
mean quantization transform (SMQT) is applied for the Aerial view Foggy image
method 2, here from the output histogram all the intensity
value are distributed according to mean quantize units at
level L=8 and enhancement is done and brighten image in
obtained at the output. Here we can say that the quality of
the image is improved by increase in MAD value of the
input and output from 0.031 to 0.16.
41
V-transform

View publication stats


Figure 33: Select menu and processing the image.
Here above image select configuration is popup by taping
the modify image and then choose the algorithms like
Histogram equalized RGB or Covert to grayscale button
obtained on the screen. Then after selecting the Processing
the image is done as shown in the right side image.
45
Figure 32: Comparing Method 1 and Method 2 Outputs for histogram equalization and converting image to
enhancements with the Aerial and foggy image. Output grey image after selecting from the select configuration.
images and histogram of the image are shown.
43
From the above figure 31 the input image aerial view of
city is facing color noise and foggy image is facing lack of
clarity. So alternatively all the enhancement algorithms are
performed and enhanced image and their histogram are
shown in above. From the results there is need for both the
enhancement techniques for different reasons. For the
foggy image deer’s in the image are not visible image, it
has natural colors in the natural image for that method 2
performs better then method 1 otherwise gets to introduce
different colors in the image. For Aerial view we adjust the
3 different planes so color distribution is done equally so
the method 1 enhancement is preformed to image facing
color noise.
AB
44
Figure 34: ‘A’ is for Histogram equalized and ‘B’ is for
6.4 Android Implementation is performed with RGB
convert to grey image
image as follows:
Here from the above images represents after choosing the
Loading the input image aerial view and Select the method
select configuration, it can be either ‘Histogram Eq RGB’
1 Histogram equalization RGB and wait until the process is
or ‘Covert to greyscale’. We get output as shown in the
done.
figure A for histogram equalization and figure B is for
convert to gray scale.
46

View publication stats


7 CONCLUSION: Vol. 4.
In this thesis, the methods that we applied balances the 7. [7] H.Yeganeh,A.Ziaei,andA.Rezaie,“Anovelappr
requisites of the developed enhancement and being faithful oachforcontrastenhancementbased
to original image is applied to the enhancement of both on Histogram Equalization,” in International Conference on
RGB and grey scale images. The results shows the Computer and
effectiveness of the algorithm in improving both contrast Communication Engineering, 2008. ICCCE 2008, 2008, pp.
and color of the original image. Finally, method 1 is good 256–260.
for enhancing natural images facing nature effects in figure
31 and method 2 is preferred for equal distribution of
independent color planes in the image.
Histogram equalization is a very good technique for
method 1, the best results with a sufficient increase in
contrast and grey levels in grey scale image. It also gives
the same results while implementation in android “Test
enhancer” application with a low computational power and
fast execution.
SMQT (Successive Mean Quantization Transform)
appropriate technique to use in systems that require high
accuracy and have a goof performance speed. The main
advantages is low computation power and disadvantage is
results are not good for natural images.
V-transform give an interesting results in images with low
light and satisfying results for the nature image effects of
fog there is a clearer visibility of deer’s in figure 31 for
iteration value n= 2.

References
1. [1] J.CalderónGonzález,C.Salazar,andÒ.Daniel,I
mageEnhancementwithMatlab Algorithms. 2015.
2. [2] “IntroductiontoDigitalImageProcessingwithM
ATLAB-MATLAB&Simulink Based Books -
MathWorks Nordic.” [Online]. Available:
https://se.mathworks.com/support/books/book484
34.html?category=14&requestedDoma
in=www.mathworks.com. [Accessed: 18-Oct-
2016].
3. [3] A.McAndrew,AnIntroductiontoDigitalImage
ProcessingWithMatlab.Boston,MA, United States:
Course Technology Press, 2004.
4. [4] “Modelo de color HSV,” Wikipedia, la
enciclopedia libre. 29-Sep-2016.
5. [5] A.McAndrew,AComputationalIntroductionto
DigitalImageProcessing,Second
Edition. CRC Press, 2015.
6. [6] M.Nilsson,M.Dahl,andI.Claesson,“Thesucces
sivemeanquantizationtransform,”in
Proceedings. (ICASSP ’05). IEEE International
Conference on Acoustics, Speech, and
Signal Processing, 2005., 2005, vol. 4, p. iv/429-iv/432

View publication stats

You might also like