Chap 2 Image Enhancements and Filtering DD
Chap 2 Image Enhancements and Filtering DD
• For spatial resolution to say a image has a 512x 512 pixels resolution is
not a meaningful statement without stating the spatial dimensions
encompassed by the image.
❖ Spatial/Coordinate Resolution:
A 512 x 512, 8 bit image subsampled down to size 256 x 256, 128 x 128, 64 x 64 , 32 x 32 and 16 x 16 pixels. The
number of intensity levels kept at 256.
❖ Aliasing (Down Sampling) :
• Shannon sampling theorem tells us that, if the function is sampled at a rate equal
to or greater than twice its highest frequency (fs≥2fm )it is possible to recover
completely the original function from the samples.
Fig: 512 x 512, 256 level(8 bit) image. Further displayed in 128 level (7 bit), 64 level (6 bit), 32 level (5 bit), 16 level (4
bit), 8 level (3 bit), 4 level (2 bit) and 2 level (1 bit), while keeping spatial resolution constant.
Thank You
8
The basics of Intensity
transformations and spatial
filtering and implementation in
MATLAB © Dr. Dafda
• Image enhancement is the process of enhancing image so that the
resultant image is more suitable than original for specific applications.
Image Enhancement
• The smallest possible neighborhood is of size 1 x 1. Here, g depends only on the value of f at a single point (x, y)
and T becomes s = T(r), where, for simplicity in notation, s and r are variables denoting, respectively, the
intensity of g and f at any point (x, y).
• Negative image means inverting the grey levels i.e. black in the original image will
become white and vice-versa.
• The transformation for image negative can be given by,
s=L–1–r
where, s is the output intensity value, L is the highest intensity levels and r is
the input intensity value
• It is particularly suited for enhancing white or gray detail embedded in dark
regions of an image, especially when the black areas are dominant in size
❖ Log transformations:
• s = c log(1 + r)
where, c is constant, s is the output intensity value and r is the input intensity
value
• It maps a narrow range of low intensity values in the input into a wide range of
output levels.
• The opposite is true of higher values of input levels.
• It expands the values of dark pixels in an image while compressing the higher level
values.
• It compresses the dynamic range of images with large variations in pixel values.
• Log reduces contrast of brighter regions.
❖ Power-Law (Gamma) transformations:
• s = c rγ
where c and γ are both positive constants, r =input and s = output
• With fractional values(0<γ<1) of gamma map a narrow range of dark input values
into a wider range of output values, with the opposite being true for higher values
(γ >1)of input levels.
• C=gamma=1 means it is an identity transformations.
• Variety of devices used for image capture , printing, and display respond according
to a power law.
• Process used to correct these power law response phenomena is called gamma
correction.
• Power-law enhances contrast of brighter regions.
Thank You
10
1) To display only one value (say, white) in the range of interest and rests
are black which produces binary image.
2) Brightens (or darkens) the desired range of intensities but leaves all
other intensity levels in the image unchanged.
Thank You
12
• Spatial filtering change the grey level of a pixel (x,y) depending on the
pixel values in a square neighborhood centered at (x,y) using a
matrix(filter, mask, kernel/window).
• There are many things that can be achieved by neighborhood
processing which are not possible with point processing.
Spatial filters
Filter mask
• The two noises are replaced with the average of their surrounding points.
The process of reducing the influence of noise is called smoothing or blurring.
Thank You
16
• Spatial filtering change the grey level of a pixel (x,y) depending on the
pixel values in a square neighborhood centered at (x,y) using a
matrix(filter, mask, kernel/window).
• There are many things that can be achieved by neighborhood
processing which are not possible with point processing.
Spatial filters
R = median{Zk | k =1,2,3,…..9}
Filter mask
• The effects of median filter are: (1) Noise reduction,
(2) Less blurring than averaging filter
Minimum filter:
R = min{Zk | k =1,2,3,…..9}
It is used for finding the darkest point.
It is used for removing the salt noise.
Maximum filter:
R = max{Zk | k =1,2,3,…..9}
It is used for finding the brightest
point.
It is used for removing the pepper
noise.
Thank You
17
• Spatial filtering change the grey level of a pixel (x,y) depending on the
pixel values in a square neighborhood centered at (x,y) using a
matrix(filter, mask, kernel/window).
• There are many things that can be achieved by neighborhood
processing which are not possible with point processing.
Spatial filters
20 20 20 20 20 0 -15 0 0 0
20 5 20 20 20 0 60 0 0 0
20 20 20 20 20 0 -15 0 -15 0
20 20 20 5 20 0 0 0 60 0
20 20 20 20 20 0 0 0 -15 0
Thank You
18
Introduction to Image Enhancement in
the frequency domain and different
steps for filtering in the frequency
domain
© Dr. Dafda
Image Enhancement
• Frequency domain gives you control over the whole images, where we can
enhance(eg. Edges) and suppress(eg. Smooth shadow) different characteristics of
the image very easily.
• Frequency domain has a established suit of processes and tools that can be
borrowed directly from signal processing in other domain.
Thus, high-boost filtering gives us the flexibility to increase the contribution made by the image to
the overall enhanced result. This equation may be written as:
We have Fhp (u,v) = F (u,v) – Flp (u,v). But Flp (u,v) = Hlp (u,v)F(u,v), where Hlp is the transfer
function of a lowpass filter. Therefore, unsharp masking can be implemented directly in the
frequency domain by using the composite filter
with A > 1. The process consists of multiplying this filter by the (centered) transform of the input
image and then taking the inverse transform of the product. Multiplication of the real part of this
result by (-l) x+y gives us the high-boost filtered image fhb (x, y) in the spatial domain.
Thank You
22
Finally, as z (x, y) was formed by taking the logarithm of the original image f (x, y), the inverse
(exponential) operation yields the desired enhanced image, denoted by g(x, y); that is,
Homomorphic filtering approach for image enhancement