digital image processing img smoothning
TRANSCRIPT
![Page 1: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/1.jpg)
Digital Image ProcessingPresentation over image smoothing
and sharpening
-Vinay Kumar Gupta0700410088
![Page 2: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/2.jpg)
What is a Digital Image?A digital image is a representation of a two-
dimensional image as a finite set of digital values, called picture elements or pixels.
![Page 3: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/3.jpg)
Why Digital Image Processing?Digital image processing focuses on two major tasks:
Improvement of pictorial information for human interpretation.
Processing of image data for storage, transmission and representation for autonomous machine perception
![Page 4: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/4.jpg)
Applications:The use of digital image processing techniques has exploded and they are now used for all kinds of tasks in all kinds of areas:
Image enhancement/restorationArtistic effectsMedical visualisationIndustrial inspectionLaw enforcementHuman computer interfaces
![Page 5: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/5.jpg)
Examples: The Hubble TelescopeLaunched in 1990 the Hubble telescope can take images of very distant objectsHowever, an incorrect mirror made many of Hubble’s images useless.Image processing techniques were used to fix this
![Page 6: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/6.jpg)
Examples: HCITry to make human computer interfaces more natural
Face recognitionGesture recognition
Does anyone remember the user interface from “Minority Report”?
![Page 7: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/7.jpg)
Key Stages in Digital Image Processing:
Image Acquisition
Image Restoration
Morphological
Processing
Segmentation
Representation &
Description
Image Enhancemen
t
Object Recognition
Problem Domain
Colour Image
ProcessingImage
Compression
![Page 8: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/8.jpg)
Image RepresentationBefore we discuss image acquisition recall that a digital image iscomposed of M rows and N columns of pixels each storing a value
Pixel values are most often grey levels in the range 0-255(black-white)
col
row
f (row, col)
![Page 9: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/9.jpg)
Image Representation
![Page 10: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/10.jpg)
Image Representation
![Page 11: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/11.jpg)
Image Representation
![Page 12: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/12.jpg)
What Is Image Enhancement?Image enhancement is the process of making images more usefulThe reasons for doing this include:
Highlighting interesting detail in imagesRemoving noise from imagesMaking images more visually appealing
![Page 13: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/13.jpg)
Spatial & Frequency DomainsThere are two broad categories of image enhancement techniques
Spatial domain techniques Direct manipulation of image pixels
Frequency domain techniques Manipulation of Fourier transform or wavelet
transform of an imageFor the moment we will concentrate on techniques that operate in the spatial domain
![Page 14: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/14.jpg)
Image HistogramsThe histogram of an image shows us the distribution of grey levels in the image
Grey Levels
Freq
uenc
ies
![Page 15: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/15.jpg)
Spatial filtering techniques:Neighbourhood operationsWhat is spatial filtering?Smoothing operationsWhat happens at the edges?
![Page 16: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/16.jpg)
Neighbourhood OperationsNeighbourhood operations simply operate on a larger neighbourhood of pixels than point operationsNeighbourhoods are mostly a rectangle around a central pixelAny size rectangle and any shape filter are possible
Origin x
y Image f (x, y)
(x, y)Neighbourhood
![Page 17: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/17.jpg)
Simple Neighbourhood OperationsSome simple neighbourhood operations include:
Min: Set the pixel value to the minimum in the
neighbourhoodMax:
Set the pixel value to the maximum in the neighbourhood
Median: The median value of a set of numbers is the midpoint value in that set (e.g. from the set [1, 7, 15, 18, 24] 15 is the median). Sometimes the median works better than the average
![Page 18: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/18.jpg)
The Spatial Filtering Processr s t
u v w
x y z
Origin x
y Image f (x, y)
eprocessed = v*e + r*a + s*b + t*c + u*d + w*f + x*g + y*h + z*i
FilterSimple 3*3
Neighbourhood e 3*3 Filter
a b c
d e f
g h iOriginal
Image Pixels
*
The above is repeated for every pixel in the original image to generate the filtered image
![Page 19: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/19.jpg)
Smoothing Spatial Filters
1/9 1/9 1/9
1/9 1/9 1/9
1/9 1/9 1/9
One of the simplest spatial filtering operations we can perform is a smoothing operation
Simply average all of the pixels in a neighbourhood around a central value
Especially useful in removing noise from images
Also useful for highlighting gross detail
Simple averaging filter
![Page 20: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/20.jpg)
Smoothing Spatial Filtering1/9
1/91/9
1/91/9
1/9
1/91/9
1/9
Origin x
y Image f (x, y)
e = 1/9*106 + 1/9*104 + 1/9*100 + 1/9*108 + 1/9*99 + 1/9*98 + 1/9*95 + 1/9*90 + 1/9*85
= 98.3333
FilterSimple 3*3
Neighbourhood106
104
99
95
100108
98
90 85
1/91/9
1/9
1/91/9
1/9
1/91/9
1/9
3*3 SmoothingFilter
104 100 108
99 106 98
95 90 85
Original Image Pixels
*
The above is repeated for every pixel in the original image to generate the smoothed image
![Page 21: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/21.jpg)
Sharpening Spatial FiltersPreviously we have looked at smoothing filters which remove fine detailSharpening spatial filters seek to highlight fine detail
Remove blurring from imagesHighlight edges
Sharpening filters are based on spatial differentiation
![Page 22: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/22.jpg)
Spatial DifferentiationDifferentiation measures the rate of change of a functionLet’s consider a simple 1 dimensional example
![Page 23: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/23.jpg)
Spatial Differentiation
A B
![Page 24: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/24.jpg)
1st DerivativeThe formula for the 1st derivative of a function is as follows:
It’s just the difference between subsequent values and measures the rate of change of the function.
)()1( xfxfxf
![Page 25: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/25.jpg)
2nd DerivativeThe formula for the 2nd derivative of a function is as follows:
Simply takes into account the values both before and after the current value
)(2)1()1(2
2
xfxfxfxf
![Page 26: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/26.jpg)
Using Second Derivatives For Image EnhancementThe 2nd derivative is more useful for image enhancement than the 1st derivative
Stronger response to fine detailSimpler implementationWe will come back to the 1st order derivative
later onThe first sharpening filter we will look at is the Laplacian
IsotropicOne of the simplest sharpening filtersWe will look at a digital implementation
![Page 27: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/27.jpg)
The LaplacianThe Laplacian is defined as follows:
where the partial 1st order derivative in the x direction is defined as follows:
and in the y direction as follows:
yf
xff 2
2
2
22
),(2),1(),1(2
2
yxfyxfyxfxf
),(2)1,()1,(2
2
yxfyxfyxfyf
![Page 28: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/28.jpg)
The Laplacian (cont…)So, the Laplacian can be given as follows:
We can easily build a filter based on this
),1(),1([2 yxfyxff )]1,()1,( yxfyxf
),(4 yxf
0 1 0
1 -4 1
0 1 0
![Page 29: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/29.jpg)
The Laplacian (cont…)Applying the Laplacian to an image we get a new image that highlights edges and other discontinuities
OriginalImage
LaplacianFiltered Image
LaplacianFiltered Image
Scaled for Display
![Page 30: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/30.jpg)
But That Is Not Very Enhanced!The result of a Laplacian filtering is not an enhanced imageWe have to do more work in order to get our final imageSubtract the Laplacian result from the original image to generate our final sharpened enhanced image
LaplacianFiltered Image
Scaled for Displayfyxfyxg 2),(),(
![Page 31: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/31.jpg)
Laplacian Image Enhancement
In the final sharpened image edges and fine detail are much more obvious
- =
OriginalImage
LaplacianFiltered Image
SharpenedImage
![Page 32: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/32.jpg)
Laplacian Image Enhancement
![Page 33: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/33.jpg)
Simplified Image EnhancementThe entire enhancement can be combined into a single filtering operation
),1(),1([),( yxfyxfyxf )1,()1,( yxfyxf
)],(4 yxf
fyxfyxg 2),(),(
),1(),1(),(5 yxfyxfyxf )1,()1,( yxfyxf
![Page 34: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/34.jpg)
Simplified Image Enhancement (cont…)This gives us a new filter which does the whole job for us in one step
0 -1 0
-1 5 -1
0 -1 0
![Page 35: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/35.jpg)
The Big Idea
=
Any function that periodically repeats itself can be expressed as a sum of sines and cosines of different frequencies each multiplied by a different coefficient – a Fourier series
![Page 36: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/36.jpg)
The Discrete Fourier Transform (DFT)The Discrete Fourier Transform of f(x, y), for x = 0, 1, 2…M-1 and y = 0,1,2…N-1, denoted by F(u, v), is given by the equation:
for u = 0, 1, 2…M-1 and v = 0, 1, 2…N-1.
1
0
1
0
)//(2),(),(M
x
N
y
NvyMuxjeyxfvuF
![Page 37: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/37.jpg)
DFT & ImagesThe DFT of a two dimensional image can be visualised by showing the spectrum of the images component frequencies
DFT
![Page 38: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/38.jpg)
The DFT and Image ProcessingTo filter an image in the frequency domain:
1. Compute F(u,v) the DFT of the image2. Multiply F(u,v) by a filter function H(u,v)3. Compute the inverse DFT of the result
![Page 39: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/39.jpg)
Some Basic Frequency Domain FiltersLow Pass Filter
High Pass Filter
![Page 40: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/40.jpg)
Smoothing Frequency Domain FiltersSmoothing is achieved in the frequency domain by dropping out the high frequency componentsThe basic model for filtering is:
G(u,v) = H(u,v)F(u,v)where F(u,v) is the Fourier transform of the image being filtered and H(u,v) is the filter transform functionLow pass filters – only pass the low frequencies, drop the high ones.
![Page 41: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/41.jpg)
Ideal Low Pass FilterSimply cut off all high frequency components that are a specified distance D0 from the origin of the transform
changing the distance changes the behaviour of the filter
![Page 42: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/42.jpg)
Ideal Low Pass Filter (cont…)The transfer function for the ideal low pass filter can be given as:
where D(u,v) is given as:
0
0
),( if 0),( if 1
),(DvuDDvuD
vuH
2/122 ])2/()2/[(),( NvMuvuD
![Page 43: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/43.jpg)
Butterworth Low pass FiltersThe transfer function of a Butterworth lowpass filter of order n with cutoff frequency at distance D0 from the origin is defined as:
nDvuDvuH 2
0 ]/),([11),(
![Page 44: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/44.jpg)
Gaussian Low pass FiltersThe transfer function of a Gaussian lowpass filter is defined as: 2
02 2/),(),( DvuDevuH
![Page 45: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/45.jpg)
Lowpass Filtering ExamplesA low pass Gaussian filter is used to connect broken text
![Page 46: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/46.jpg)
Sharpening in the Frequency DomainEdges and fine detail in images are associated with high frequency componentsHigh pass filters – only pass the high frequencies, drop the low ones.High pass frequencies are precisely the reverse of low pass filters, so:
Hhp(u, v) = 1 – Hlp(u, v)
![Page 47: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/47.jpg)
Ideal High Pass FiltersThe ideal high pass filter is given as:
where D0 is the cut off distance as before
0
0
),( if 1),( if 0
),(DvuDDvuD
vuH
![Page 48: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/48.jpg)
Butterworth High Pass FiltersThe Butterworth high pass filter is given as:
where n is the order and D0 is the cut off distance as before
nvuDDvuH 2
0 )],(/[11),(
![Page 49: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/49.jpg)
Gaussian High Pass FiltersThe Gaussian high pass filter is given as:
where D0 is the cut off distance as before
20
2 2/),(1),( DvuDevuH
![Page 50: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/50.jpg)
Frequency Domain Filtering & Spatial Domain FilteringSimilar jobs can be done in the spatial and frequency domainsFiltering in the spatial domain can be easier to understandFiltering in the frequency domain can be much faster – especially for large images
![Page 51: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/51.jpg)
Questions?
?
![Page 52: Digital image processing img smoothning](https://reader035.vdocuments.net/reader035/viewer/2022062823/5871f8ba1a28ab5c348b70cf/html5/thumbnails/52.jpg)
THANK YOU…!!!