Professional Documents
Culture Documents
Image enhancement
Image enhancement is the mechanism to process the input image to make it more
appropriate and clearly visible for the required application. Image enhancement
improves the information content of the image and alters the visual impact of the
image on the observer. The objective of image enhancement is to modify
attributes of an image to make it more suitable for to achieve desired
enhancement. The choice of attributes and the way they will be modified are
specific to a given task.
Image enhancement simply means, transforming an image f into image g using
T. (Where T is the transformation. The values of pixels in images f and g are
denoted by r and s, respectively. As said, the pixel values r and s are related by
the expression,
s = T(r)
Where T is a transformation that maps a pixel value r into a pixel value s.
Linear
Logarithmic
Power – law
Piecewise Linear Transformation function
The overall graph of these transitions has been shown below.
Linear transformation
First we will look at the linear transformation. Linear transformation includes
simple identity and negative transformation.
Identity transition is shown by a straight line. In this transition, each value of the
input image is directly mapped to each other value of output image. That results
in the same input image and output image. And hence is called identity
transformation. It has been shown below:
Negative transformation
The second linear transformation is negative transformation, which is invert of
identity transformation. In negative transformation, each value of the input
image is subtracted from the L-1 and mapped onto the output image.
Input Image
Output Image
Logarithmic transformations
Logarithmic transformation further contains two type of transformation. Log
transformation and inverse log transformation.
Log transformation
The log transformations can be defined by this formula
s = c log(r + 1).
Where s and r are the pixel values of the output and the input image and c is a
constant. The value 1 is added to each of the pixel value of the input image
because if there is a pixel intensity of 0 in the image, then log (0) is equal to
infinity. So 1 is added, to make the minimum value at least 1.
During log transformation, the dark pixels in an image are expanded as compare
to the higher pixel values. The higher pixel values are kind of compressed in log
transformation. This result in following image enhancement.
Input Image
Correcting gamma.
s=cr^γ
s=cr^(1/2.5)
The same image but with different gamma values has been shown here.
For example
Gamma = 10
Gamma = 8
Gamma = 6
In piecewise linear transform every pixel of the image will be manipulated. This
transformation technique aims to improve quality of the image by changing the
range of pixels intensity values in the original image. A common advantage of
this technique is that changing complex functions can be solved using the
piecewise linear method.
There are three types of transformation:
1.Contrast stretching method
2.Intensity level slicing method
3.Bit plane slicing method
The figure is the typical transformation used for contrast stretching. The
locations of points (r1, s1) and (r2, s2) control the shape of the
transformation function.
If r1 = s1 and r2 = s2, the transformation is a linear function that produces
no changes in gray levels.
If r1 = r2, s1 = 0 and s2 = L-1, the transformation becomes a thresholding
function that creates a binary image.
Intermediate values of (r1, s1) and (r2, s2) produce various degrees of
spread in the gray levels of the output image, thus affecting its contrast.
In general, r1 ≤ r2 and s1 ≤ s2 is assumed, so the function is always
increasing.
The histogram shows some degree of grayness in groups together. If the pixel
grouping is on the left, then the image tends to be dark and vice versa. The image
with low quality can be improved quality with contrast stretching operation.
where r is the gray scale value of the original image, s is the new gray scale value,
the lowest gray scale r min value of the pixel group, the highest gray scale r max of
the pixel group.
B. Bit Plane Slicing Method
The low contrast image is strengthened using the image enhancement method.
Often the image enhancement method brightens all pixels of input image. This
weakness is usually overcome by using bit plane slicing.
Bit-plane slicing:
• Pixels are digital numbers composed of bits.
• 256 gray level image composed of 8 bits
• It can highlight the contribution made to total image appearance by specific
bits.
• Each pixel in an image represented by 8 bits.
• Image is composed of eight 1-bit planes, ranging from bit-plane 0 for the
least significant bit to bit plane 7 for the most significant bit.
• Bits that are in bit plane 0 are categorized as least significant bits and the
bits in plane 7 bit are categorized as the most significant bits.
Consider the pixels that are bounded within the yellow line. The binary formats
for those values are (8-bit representation)
And plane 8 contains the highest order bit of all the pixels in the image
A=[167 133 111
144 140 135
159 154 148]
B=bitget(A,1); %Lowest order bit of all pixels
‘bitget’ is a MATLAB function used to fetch a bit from the specified position
from all the pixels.
B=[1 1 1
001
1 0 0]
B=bitget(A,8);%Highest order bit of all pixels
B=[1 1 0
111
1 1 1]
Intensity level slicing method often highlights a certain range of desired gray
level imagery. The application includes improving certain features such as water
masses in satellite imagery and flaws in X-ray imagery.
Highlights a specific range of grey levels
• Similar to thresholding
• Other levels can be suppressed or maintained
• Useful for highlighting features
in an image
Histogram
Histogram Processing
nk: Number of pixels with gray value rk
n: total Number of pixels in the image
The function p(rk) represents the fraction of the total number of pixels with gray
value rk.
The shape of the histogram of an image gives us useful information about the possibility for
contrast enhancement.
Histogram equalization:
The histogram equalization is an approach to enhance a given image. The
approach is to design a transformation T(.) such that the gray values in the
output is uniformly distributed in [0, 1].
Let us assume for the moment that the input image to be enhanced has
continuous gray values, with r = 0 representing black and r = 1
representing white.
We need to design a gray value transformation s = T(r), based on the
histogram of the input image, which will enhance the image.
Histogram Specification:Refer ppt & https://www.youtube.com/watch?v=nwIT4HJrKXs