DIP Lecture-7 10 RKJ Image Enhancement
DIP Lecture-7 10 RKJ Image Enhancement
Processing
Lecture
Dr. Rajib Kumar Jha
Associate Professor
Notes-2019 Depart of Electrical Engineering
Indian Institute of Technology Patna
[email protected]
1
Lecture-11-12-13-14
Image Enhancement
2
Contents
• Image Enhancement
• Point Processing
• Mask Processing
• Gray level Slicing
• Dynamic Range Compression
• What is histogram?
• Histogram Equalization
• Image Subtraction
• Image Averaging
Image Enhancement
• Processing an image to enhance certain
features of the image
• The result is more suitable than the original
image for certain specific applications
– Processing techniques are very much problem
oriented
– Best technique for enhancement of HDR-image
may not be the best for enhancement of dark
image or low contrast image.
– So, it is application dependent.
4
Different Enhancement Techniques
Enhancement techniques fall under two broad
categories
• Spatial Domain Technique
– Work on image plane itself
– Direct manipulation of pixels in an image
• Frequency Domain Technique
– Modify Fourier Transform coefficient of an image
– Take inverse Fourier Transform of the modified
coefficients to obtain the enhanced image,
8
DCT-based Enhanced image
Effect on Wavelet Transform Coefficients
10
Effect of DWT Coefficients
Approximation, n=5
Horizontal, n=5
Vertical, n=5
Diagonal, n=5
50-Iterations
11
Effect on DWT Coefficients
Approximation, n=10
Horizontal, n=10
Vertical, n=10
Diagonal, n=10
100-Iterations
12
Effect on DWT Coefficients
Approximation, n=15
Horizontal, n=15
Vertical, n=15
Diagonal, n=15
150-Iterations
13
Variation of mean and variance of LL (approximation) subband coefficients
with iterations
14
Spatial Domain Technique-Neighbourhood
g(x)=T[f(x)]
g(x,y)=T[f(x,y)
19
Point Processing-Image Negative
26
Why Contrast stretching Enhancement?
• When less intensity light falls on image scene.
• Next question ? Why an image is dark?
• It is due to the dynamic range of the sensor.
• Dynamic range is the capacity of the sensor to
record minimum intensity value and maximum
intensity value.
• So, difference between the minimum and the
maximum intensity value is the dynamic range of
the sensor.
• If scene is properly illuminated but sensor is not
capable of recording all those variations in the
scene intensity, that leads to very a dark image. 27
Contrast stretching Enhancement
Contrast Stretching
Contrast Stretching Result
Contrast Stretching Result
34
35
Dynamic Range Compression
• The applications where we need to reduce the dynamic range is, I have an original
image whose dynamic range is so high (0 to thousand) that it cannot be properly
reproduced by our display device (0 to 255).
• So the display device will mostly display the highest intensity values and the lower
intensity values will be in most of the cases suppressed by that.
Log Transformation
Dynamic Range Compression
Power Law Transformation: Gamma Correction
• When value of gamma is less than 1. The response of transformation
function is more towards the larger range of lower intensity input image
• for a higher intensity side, a higher range of input intensity is mapped to
a lower range of intensity values in processed image
• The reverse is true for values of gamma greater than 1.
Gray Level Slicing
Gray Level Slicing
Gray Level Slicing
48
Bit Plane Slicing
Bit Plane Slicing
Bit Plane Slicing
52
53
Image Subtraction & Change Detection
Lena, watermarked lena (WML) &
difference between lena and WML
55
Lena, watermarked lena (WML) & difference between lena and WML
56
Difference of Two Images
g(x,y) =f(x,y)-h(x,y)
Result: Histogram Equalization
Result: Histogram Equalization
Result: Histogram Equalization
67
Result: Histogram Equalization
68
Histogram Equalized Image
71
72
Smoothing Spatial filter
76
77
Result of Averaged Image
98
Sharpening Spatial Filter
• Averaging over an image creates blurring in the image or
the details in the image are removed.
• Averaging operation is equivalent to integration
operation.
Isolated point
Flat
First order and Second order derivative response
Isolated point
Flat
Laplacian Edge detection
Composite Laplacian Mask
123
Laplacian operator can detect changes
in all directions
124
125
126
127
128
Results
129
130
131
137
Comparative Results
Results of Sobel Operator
−2𝜋2 𝜎 2 𝑥 2
• h(x)=A[𝛿 𝑥 − 2𝜋𝐴𝑒 ]
168
High-pass Filter
This masks are Laplacian masks in the spatial domain, the kind of
operation that is done is basically a high pass filtering operation.
Basic Model of Low Pass filter in
frequency Domain
𝐺 𝑢, 𝑣 = 𝐻 𝑢, 𝑣 . 𝐹(𝑢, 𝑣)
Cut-off
frequency
Ringing effect
Disadvantage
• At same cut-off frequency 10, blurring of low pass
filtered image is large compared to the blurring
introduced by the butter-worth low pass filter.
• If increase the cut off frequency to 20; in the ideal
low pass filtered image the image is very sharp but
the disadvantage is the ringing effect present.
• That means there are a number of undesired lines
which are not present in the original image, that
are present.
• Spread of this main component is inversely proportional
to D0 which is cut off frequency of the ideal low pass filter.
• All the secondary components over an unit length is again
inversely proportional to this cut off frequency D0 and
these are the one responsible for ringing effect.
Butterworth Filter
• So, butter worth filter of order 1 does not
leads to any kind of ringing effect.
Whereas, if we go for butter worth filter
of higher order that may lead to the
ringing effect.
• if I use a Gaussian low pass filter for
filtering operation we will never have any
ringing effect in the processed image.
Ideal High Pass
Butterworth High Pass Filter
Ideal & Butterworth high pass Filter
Ideal & Butterworth high pass filter
you can find there are ringing effects around this boundaries in
ideal filter whereas no ringing effect in butter worth filter.
• Taking the Fourier transform directly on this
product is not possible.
• Define a function g(x,y,z) which is ln[f(x,y,z)]
and is nothing but ln[i(x,y,z) + ln[r(x,y,z)]
Homomorphic Filter
Homomorphic Filter
• The first term is the illumination component and
second term is the reflectance component.
• Illumination component leads to low frequency
components because illumination is slowly
varying
• The reflectance component leads to high
frequency components, particularly at the
boundaries of 2 reflecting objects.
• We try to design a filter which can enhance the
high frequency components and attenuate the
low frequency components.
205
Homomorphic Filter
Homomorphic Filter
Thanks
210