UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
INTRODUCTION :
The image enhancement is one of the most interesting and visually appearing
areas of image processing.
Enhancement is a fundamental task in digital image processing and analysis,
aiming to improve the appearance of image in terms of human brightness
perception
To Process an image so that the result will be more suitable than the original
image for a specific application.
The suitableness is up to each application.
A method which is quite useful for enhancing an image may not necessarily
be the best approach for enhancing another images.
Image Enhancement falls under 2 categories :
Spatial Domain : (image plane)
Techniques are based on direct manipulation of pixels in an image
Frequency Domain :
Techniques are based on modifying the Fourier transform of an image
There are some enhancement techniques based on various combinations of
methods from these two categories.
For human visual
The visual evaluation of image quality is a highly subjective process.
It is hard to standardize the definition of a good image.
For machine perception
The evaluation task is easier.
A good image is one which gives the best machine recognition results.
A certain amount of trial and error usually is required before a particular
image enhancement approach is selected.
SPATIAL DOMAIN :
Procedures that operate directly on pixels.
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
g(x,y) = T[f(x,y)]
where
f(x,y) is the input image
g(x,y) is the processed image
T is an operator on f defined over some neighborhood of (x,y)
POINT PROCESSING:
Neighborhood = 1x1 pixel
g depends on only the value of f at (x,y)
T = gray level (or intensity or mapping) transformation function
s = T(r)
Where
r = gray level of f(x,y)
s = gray level of g(x,y)
3 BASIC GRAY-LEVEL TRANSFORMATION FUNCTIONS :
Linear function
Logarithm function
Negative and identity transformations
Log and inverse-log transformation
Power-law function
nth power and nth root transformations
LINEAR FUNCTION
Image Negatives:
An image with gray level in the range [0, L-1]
where L = 2n ; n = 1, 2
Negative transformation :
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
s = L 1 r
Reversing the intensity levels of an image.
Suitable for enhancing white or gray detail embedded in dark regions
of an image, especially when the black area dominant in size.
Identity :
Output intensities are identical to input intensities.
Is included in the graph only for completeness.
LOGARITHM FUNCTION
Log Transformations:
s = c log (1+r)
c is a constant
and r 0
Log curve maps a narrow range of low
gray-level values in the input image into a wider range of output levels.
Used to expand the values of dark pixels in an image while
compressing the higher-level values.
Inverse Logarithm Transformations:
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
Do opposite to the Log Transformations
Used to expand the values of high pixels in an
image while compressing the darker-level values.
POWER-LAW FUNCTION(Transformations)
s = cr
c and are positive constants
Power-law curves with fractional values of map a
narrow range of dark input values into a wider
range of output values, with the opposite being true
for higher values of input levels.
c = = 1 a Identity function
When the is reduced too much, the image begins
to reduce contrast to the point where the image
started to have very slight wash-out look,
especially in the background
Piecewise-Linear Transformation Functions
Advantage:
The form of piecewise functions can be arbitrarily complex
Disadvantage:
Their specification requires considerably more user input
Contrast Stretching:
Produce higher contrast than the original by
darkening the levels below m in the original image
Brightening the levels above m in the original image
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
Thresholding:
Produce a two-level (binary) image
Gray-level slicing :
Highlighting a specific range of gray levels in an image
Display a high value of all gray levels in the range of interest and
a low value for all other gray levels
(a) transformation highlights range [A,B] of gray level and reduces all
others to a constant level
(b) transformation highlights range [A,B] but preserves all other levels
Bit-plane slicing:
Highlighting the contribution made to total image
appearance by specific bits
Suppose each pixel is represented by 8 bits
Higher-order bits contain the majority of the
visually significant data
Useful for analyzing the relative importance played
by each bit of the image
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
Example :
The (binary) image for bit-plane 7 can be obtained by processing the
input image with a thresholding gray-level transformation.
Map all levels between 0 and 127 to 0
Map all levels between 129 and 255 to 255
Histogram Processing:
Histogram is a graphical tool
developed by Statisticians to visualize
frequency distributions, it has a very specific meaning when used in the context of
digital images. We go with black and white images, in which each pixel has a
specific brightness level which is stored in the computer as a number between 0
and 255.Zero corresponds to black and 255 to white.
Basic for numerous spatial domain processing techniques
Used effectively for image enhancement
Information inherent in histograms also is useful in image compression
and segmentation
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
Histogram of a digital image with gray levels in the range [0,L-1] is a
discrete function
h(rk) = nk
Where
rk : the kth gray level
nk : the number of pixels in the image having gray level rk
h(rk) : histogram of a digital image with gray levels rk
Example:
Normalized Histogram :
p(rk)
dividing each of histogram at gray level rk by the total number of pixels
in the image, n
= nk / n
For k = 0,1,,L-1
p(rk) gives an estimate of the probability of occurrence of gray level rk
The sum of all components of a normalized histogram is equal to 1
EXAMPLE:
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
Histogram Equalization:
Histogram equalization employs a monotonic, non-linear mapping which reassigns the intensity values of pixels in the input image such that the output
image contains a uniform distribution of intensities (i.e. a flat histogram).
It is a common technique for enhancing the appearance of images. A perfect
image is one which has equal no. of pixels in all its gray levels.
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
Hence to get a perfect image our objective is not only to spread the dynamic
range but also to have equal pixels in all the gray levels. This technique is
known as Histogram Equalization
As the low-contrast images histogram is narrow and centered toward
the middle of the gray scale, if we distribute the histogram to a wider
range the quality of the image will be improved.
We can do it by adjusting the probability density function of the original
histogram of the image so that the probability spread equally
Example
Prepared by
FAHIMUDDIN.SHAIK
UNIT IIIIMAGE
ENHANCEMENT IN THE SPATIAL DOMAIN
Histogram Matching (Specification):
Histogram equalization has a disadvantage which is that it can
generate only one type of output image.
With Histogram Specification, we can specify the shape of the
histogram that we wish the output image to have.
It doesnt have to be a uniform histogram
Prepared by
FAHIMUDDIN.SHAIK