Академический Документы
Профессиональный Документы
Культура Документы
MODULE 3
IMAGE ENHANCEMENT
References:
• S. Jayaraman, S. Esakkirajan, “DIGITAL IMAGE PROCESSING”
• Rafael C Gonzalez, R Woods, “DIGITAL IMAGE PROCESSING”
Syllabus
• Image enhancement:
– Spatial domain methods
• Point Processing
• Intensity Transformations
• Histogram Processing
• Image Subtraction
• Image Averaging
• Spatial Filtering
– Smoothing filters
– Sharpening filters
– Frequency Domain methods
• Low pass filtering
• High pass filtering
• Homomorphic filter
Image enhancement
• To improve the quality of the image as perceived by
human being
• To improve the interpretability of the information
present in images.
• can be done either by suppressing the noise or
increasing the image contrast.
• Image enhancement algorithm is employed to
emphasize, sharpen, or smoothen image features
for display and analysis and are application specific.
Image enhancement example
Spatial Domain
Image enhancement methods
Frequency Domain
;
• Global operation: All pixel values in the image are taken into consideration.
Usually, frequency domain operations are global operations
Enhancement through point operation
• Each pixel value is mapped to a new pixel value
• Point operations are basically memoryless operations
• Enhancement at any point depends only on the image value
at that point
𝑔 𝑚, 𝑛 = 𝑇 𝑓 𝑚, 𝑛 f 𝑚, 𝑛 i/p image pixel
𝑔 𝑚, 𝑛 o/p image pixel
𝑇 operates on one pixel
𝛾
• 𝑔 𝑚, 𝑛 = 𝑐 ∗ 𝑓(𝑚, 𝑛)
• When 𝛾>1,
image
appears to
be darker
• When 𝛾 <1,
image
appears to
be brighter
• A variety of devices used for image capture, printing, and display respond
according to a power law.
• The exponent in the power-law equation is referred to as gamma.
• The process used to correct this power-law response phenomena is called
gamma correction.
• For example, cathode ray tube (CRT) devices have an
intensity-to-voltage response that is a power function,
with exponents varying from approximately 1.8 to 2.5.
Brightness Modification
𝑔 𝑚, 𝑛 = 𝑓 𝑚, 𝑛 ± 𝑘
Contrast Adjustment
• It is done by scaling all the pixels of the image by
a constant value.
𝑔 𝑚, 𝑛 = 𝑓 𝑚, 𝑛 ∗ 𝑘
• Changing the contrast of an image, changes the
range of luminance values present in the image.
• If 𝑘 > 1: Contrast will be increased. (Making
bright samples more brighter and dark samples
more darker)
• If 𝑘 < 1: Contrast will be decreased.
Piecewise – Linear Transformation Functions : Contrast Stretching
x 0 x a
yb
y (x a) ya a x b
(x b) y ya
b x L
b
0 a b L x
Thresholding
Piecewise – Linear Transformation Functions :
Intensity level slicing or Gray-level slicing
• Highlight a specific range of gray levels
• Gray-level slicing
– Without preserving background- High values for
a range of interest and low values in other areas
• Gray-level slicing
– With preserving background- High values for a
range of interest and original gray levels in other
areas
Thresholding (Hard Thresholding, Soft Thresholding)
• Hard Thresholding
– Pixels having intensity lower than the Threshold T are set
to zero
– Pixels with intensity > T higher intensity (eg.255)
– Application- to obtain binary image from gray scale image
0 𝑓𝑜𝑟 𝑓 𝑚, 𝑛 < 𝑇
𝑔 𝑚, 𝑛 =
255 𝑜𝑡𝑒𝑟𝑤𝑖𝑠𝑒
Piecewise – Linear Transformation Functions :
Bit-Plane Slicing
• Instead of highlighting gray-level ranges, highlighting the
contribution made to total image appearance by specific bits
might be desired.
• For an 8 bit image, imagine that the 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.
• Plane 0 contains all the lowest order bits in the bytes comprising
the pixels in the image and plane 7 contains all the high-order bits.
Bit-plane slicing: example-original image
For image
compression
7 6
5 4 3
2 1 0
Bit plane slicing advantages
• The higher-order bits (especially the top four) contain the
majority of the visually significant data.
• The other bit planes contribute to more subtle details in the
image.
• Separating a digital image into its bit planes is useful for
analyzing the relative importance played by each bit of the
image, a process that aids in determining the adequacy of
the number of bits used to quantize each pixel.
• This type of decomposition is useful for image compression
• Goals of bit plane slicing are
• Converting a gray level image to a binary image
• Representing an image with fewer bits and compressing
the image to a smaller size
• Enhancing the image by focusing
Bit planes of Image Bit planes removed image (Compressed)
Histogram Manipulation
• Histogram of a digital image with intensity levels in the range
[0, 𝐿 − 1] is a discrete function 𝒉 𝒓𝒌 = 𝒏𝒌 .
𝑟𝑘 𝑘 𝑡ℎ intensity value
𝑛𝑘 no. of pixels with intensity 𝑟𝑘
Mask
Smoothing Filter or Mean filter or Averaging filter
or Low-pass filter or box filter
9
1
𝑅= 𝑧𝑖
9
𝑖=1
– Simply takes into account the values both before and after
the current value
Using second derivative for image sharpening – The Laplacian
2 2
x y
f [ f ( x 1, y ) f ( x 1, y )
2
f ( x , y 1 ) f ( x , y 1 )]
4 f ( x, y)
0 1 0
1 -4 1
0 1 0
Applying the Laplacian to an image we get a new image that highlights
edges and other discontinuities
0 1 0 1 1 1
Unsharp Masking (Image sharpening)
• A smoothened version of the image is subtracted
from the original image, hence, tipping the image
balance towards the sharper content of the image.
• Procedure-
– Blur the original image
– Subtract the result of step 1 from the original image
– Multiply the result of step 2 by some weighting function
– Add the result of step 3 to the original image
• 𝑓 ′ 𝑚, 𝑛 = 𝑓 𝑚, 𝑛 +∝ [𝑓 𝑚, 𝑛 − 𝑓 𝑚, 𝑛 ]
Where 𝑓 𝑚, 𝑛 is the original image, 𝑓 𝑚, 𝑛 is the
blurred version of the image, ∝ is the weighting factor
and 𝑓 ′ 𝑚, 𝑛 is the sharpened result.
High-Boost Filtering (Image sharpening)
• Also known as high frequency emphasis filter.
• Used to retain some of the low frequency
components to aid in the interpretation of an image.
𝐻𝑖𝑔 𝑏𝑜𝑜𝑠𝑡 𝑖𝑚𝑎𝑔𝑒 = 𝐴 × 𝑓 𝑚, 𝑛 − 𝑙𝑜𝑤 𝑝𝑎𝑠𝑠
Where 𝐴 is the amplification factor and low pass
component is the blurred version of the original image.
• 𝐻𝑖𝑔 𝑏𝑜𝑜𝑠𝑡 𝑖𝑚𝑎𝑔𝑒 = 𝐴 − 1 × 𝑓 𝑚, 𝑛 + 𝑓 𝑚, 𝑛 − 𝑙𝑜𝑤 𝑝𝑎𝑠𝑠
• 𝐻𝑖𝑔 𝑏𝑜𝑜𝑠𝑡 𝑖𝑚𝑎𝑔𝑒 = 𝐴 − 1 × 𝑓 𝑚, 𝑛 − 𝑖𝑔 𝑝𝑎𝑠𝑠
1st Derivative Filtering for image sharpening
•Implementing 1st derivative filters is difficult in practice
•For a function f(x, y) the gradient of f at coordinates (x,
y) is given as the column vector: f
G
x
•The magnitude of this vector is given by:
x
f f
G
y
f mag ( f ) y
1
G G
2 2 2
x y
1
f
2 2 2
f
x y
z 3 2 z 6 z 9 z1 2 z 4
z7
•which is based on these coordinates
z1 z2 z3
z4 z5 z6
z7 z8 z9
Sobel Operators
•Based on the previous equations we can derive the Sobel
Operators
-1 -2 -1 -1 0 1
0 0 0 -2 0 2
1 2 1 -1 0 1
• Lowpass
– Ideal Lowpass Filters
– Butterworth Lowpass Filters
– Gaussian Lowpass Filters
• Highpass
– Ideal Highpass Filters
– Butterworth Highpass Filters
– Gaussian Highpass Filters
FT
IFT
IFT
IFT
The central part of FT, i.e.
the low frequency
components are responsible
for the general gray-level
appearance of an image.
General
appearance
5% 10 % 20 % 50 %
Non separable Filter Transfer Separable Filter Transfer
Function Function
2-D ideal Lowpass Filter
1 𝐷 𝑢, 𝑣 ≤ 𝐷0
• 𝐻 𝑢, 𝑣 =
0 𝐷 𝑢, 𝑣 > 𝐷0
– 𝐻 𝑢, 𝑣 is the ideal lowpass filter Transfer Function
– 𝐷0 is the specified non negative value or cutoff frequency
– 𝐷 𝑢, 𝑣 is the distance from point to the origin of frequency rectangle
Ideal Lowpass Filtering
Spatial domain
1
H (u , v ) 2n
u
2
v
2
1
D0
No serious
ringing
artifacts
Gaussian Lowpass Filters
𝑢2 +𝑣2
1 −
• 𝐻 𝑢, 𝑣 = 2 𝑒 2𝜎2
2𝜋𝜎
• Where 𝜎 2 = 𝐷0 2 is the variance of the distribution
No ringing
artifacts
Use of Lowpass Filtering
High-pass Filters
• Hhp(u,v) = 1- Hlp(u,v)
• Ideal: D (u , v ) D 0
1
H (u , v )
0 D (u , v ) D 0
• Butterworth:
1
| H (u , v ) |
2
2n
D0
• Gaussian: 1
v
2 2
u
2 2 2
(u v ) / 2
H (u , v ) 1 e
Title of presentation
High-pass Filters in spatial domain
h(x,y)
Result of Highpass filtering with 𝑫𝟎 = 15, 30 and 80