SlideShare a Scribd company logo
Presentation over image smoothing
                    and sharpening

              -Vinay Kumar Gupta
                      0700410088
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.
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
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/restoration
   Artistic effects
   Medical visualisation
   Industrial inspection
   Law enforcement
   Human computer interfaces
Examples: The Hubble Telescope
Launched in 1990 the Hubble telescope can take
images of very distant objects
However, an incorrect mirror made many of Hubble’s
images useless.
Image processing techniques were used to fix this
Examples: HCI
Try to make human computer
interfaces more natural
   Face recognition
   Gesture recognition
Does anyone remember the
user interface from “Minority
Report”?
Key Stages in Digital Image Processing:
                   Image        Morphological
                 Restoration     Processing

    Image
 Enhancement                                    Segmentation



    Image                                          Object
  Acquisition                                    Recognition



Problem Domain                                  Representation
                                                & Description
                 Colour Image     Image
                  Processing    Compression
Image Representation
Before we discuss image acquisition
recall that a digital image is
                                                col
composed 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)
                                       f (row, col)
                                 row
Image Representation
Image Representation
Image Representation
What Is Image Enhancement?
Image enhancement is the process of making images
more useful
The reasons for doing this include:
   Highlighting interesting detail in images
   Removing noise from images
   Making images more visually appealing
Spatial & Frequency Domains
There 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
        image
For the moment we will concentrate on techniques that
operate in the spatial domain
Image Histograms
The histogram of an image shows us the distribution of grey
levels in the image
 Frequencies




                       Grey Levels
Spatial filtering techniques:
  Neighbourhood operations
  What is spatial filtering?
  Smoothing operations
  What happens at the edges?
Neighbourhood Operations
Neighbourhood operations simply operate on a larger
neighbourhood of pixels than point operations
                          Origin                                  x
Neighbourhoods are
mostly a rectangle
around a central pixel
Any size rectangle
and any shape filter                                              (x, y)
                                 Neighbourhood
are possible



                            y                    Image f (x, y)
Simple Neighbourhood Operations
Some simple neighbourhood operations include:
   Min:
     Set the pixel value to the minimum in the neighbourhood
   Max:
      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
The Spatial Filtering Process
Origin                                      x
                                                  a    b   c          r     s      t
                                                  d
                                                  g
                                                       e
                                                       h
                                                            f
                                                            i
                                                                  *   u
                                                                      x
                                                                            v
                                                                            y
                                                                                   w
                                                                                   z
                                                 Original Image           Filter
              Simple 3*3                             Pixels
                             e    3*3 Filter
          Neighbourhood
                                                eprocessed = v*e +
                                                             r*a + s*b + t*c +
                                                             u*d + w*f +
  y                        Image f (x, y)                    x*g + y*h + z*i

  The above is repeated for every pixel in the
  original image to generate the filtered image
Smoothing Spatial Filters
 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             1/       1/       1/
                                       9        9        9
    in removing noise
    from images
   Also useful for
                                  1/
                                       9
                                           1/
                                                9
                                                    1/
                                                         9   Simple
    highlighting gross                                       averaging
    detail                        1/       1/       1/       filter
                                       9        9        9
Smoothing Spatial Filtering
Origin                                               x
                                                             104 100 108         1/        1/       1/
                                                                                      9         9        9
                                                                                 1/        1/       1/
                                                              99 106 98

                                                              95   90   85
                                                                             *   1/
                                                                                      9
                                                                                           1/
                                                                                                9
                                                                                                    1/
                                                                                                         9

                                                                                      9         9        9

                          1/  1/  1/
                          104 100 108
                                                          Original Image                  Filter
                            9   9   9
             Simple 3*3   1/
                           99 106 198
                              1/   /9
                                            3*3 Smoothing     Pixels
                            9   9
         Neighbourhood    195
                           /9   1/
                                90    185
                                       /9
                                            Filter
                                  9

                                                         e = 1/9*106 +
                                                             1/ *104 + 1/ *100 + 1/ *108 +
                                                               9          9        9
                                                             1/ *99 + 1/ *98 +
                                                               9        9
  y                        Image f (x, y)                    1/ *95 + 1/ *90 + 1/ *85
                                                               9        9        9
                                                           = 98.3333
  The above is repeated for every pixel in the
  original image to generate the smoothed image
Sharpening Spatial Filters
Previously we have looked at smoothing filters which
remove fine detail
Sharpening spatial filters seek to highlight fine detail
   Remove blurring from images
   Highlight edges
Sharpening filters are based on spatial differentiation
Spatial Differentiation
Differentiation measures the rate of change of a function
Let’s consider a simple 1 dimensional example
Spatial Differentiation

          A               B
1st   Derivative
The formula for the 1st derivative of a function is as
follows:
               f
                     f ( x 1)       f ( x)
               x
     It’s just the difference between subsequent values
and measures the rate of change of the function.
2nd   Derivative
The formula for the 2nd derivative of a function is as
follows:    2
               f
             2
                     f ( x 1)       f ( x 1) 2 f ( x)
               x
Simply takes into account the values both before and
after the current value
Using Second Derivatives For Image
Enhancement
The 2nd derivative is more useful for image enhancement
than the 1st derivative
   Stronger response to fine detail
   Simpler implementation
   We will come back to the 1st order derivative later on
The first sharpening filter we will look at is the Laplacian
   Isotropic
   One of the simplest sharpening filters
   We will look at a digital implementation
The Laplacian
 The Laplacian is defined as follows:
                                 2         2
                       2           f         f
                           f     2         2
                                   x         y
 where the partial 1st order derivative in the x direction is
 defined as follows:
           2
             f
           2
                  f ( x 1, y )       f ( x 1, y ) 2 f ( x, y )
             x
 and in the y direction as follows:
       2
         f
       2
                 f ( x, y 1)     f ( x, y 1) 2 f ( x, y )
         y
The Laplacian (cont…)
 So, the Laplacian can be given as follows:
     2
         f   [ f ( x 1, y ) f ( x 1, y )
                  f ( x, y 1) f ( x, y 1)]
                 4 f ( x, y)
 We can easily build a filter based on this

                       0    1    0

                       1    -4    1

                       0    1    0
The Laplacian (cont…)
Applying the Laplacian to an image we get a new image
that highlights edges and other discontinuities




         Original        Laplacian         Laplacian
          Image       Filtered Image    Filtered Image
                                       Scaled for Display
But That Is Not Very Enhanced!
 The result of a Laplacian filtering is not an
 enhanced image
 We have to do more work in order to get
 our final image
 Subtract the Laplacian result from the
 original image to generate our final
 sharpened enhanced image
                                                     Laplacian
                                                  Filtered Image
                                  2              Scaled for Display
    g ( x, y )    f ( x, y )          f
Laplacian Image Enhancement

                 -                      =

     Original             Laplacian           Sharpened
      Image            Filtered Image           Image

 In the final sharpened image edges and fine detail are
 much more obvious
Laplacian Image Enhancement
Simplified Image Enhancement
The entire enhancement can be combined into a single
filtering operation
                             2
  g ( x, y )    f ( x, y )      f
               f ( x, y) [ f ( x 1, y)     f ( x 1, y)
                            f ( x, y 1)    f ( x, y 1)
                           4 f ( x, y)]
               5 f ( x, y)   f ( x 1, y) f ( x 1, y)
                             f ( x, y 1) f ( x, y 1)
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
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
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:
                 M 1N 1
                                           j 2 ( ux / M vy / N )
 F (u , v)                  f ( x, y )e
                 x 0 y 0
for u = 0, 1, 2…M-1 and v = 0, 1, 2…N-1.
DFT & Images
The DFT of a two dimensional image can be visualised
by showing the spectrum of the images component
frequencies



                      DFT
The DFT and Image Processing
To filter an image in the frequency domain:
   1.   Compute F(u,v) the DFT of the image
   2.   Multiply F(u,v) by a filter function H(u,v)
   3.   Compute the inverse DFT of the result
Some Basic Frequency Domain Filters
                         Low Pass Filter




                         High Pass Filter
Smoothing Frequency Domain Filters
Smoothing is achieved in the frequency domain by
dropping out the high frequency components
The 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 function
Low pass filters – only pass the low frequencies,
drop the high ones.
Ideal Low Pass Filter
Simply 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
Ideal Low Pass Filter (cont…)
The transfer function for the ideal low pass filter can be
given as:
                  1 if D(u, v) D0
     H (u, v)
                  0 if D(u, v) D0

where D(u,v) is given as:
                               2                2 1/ 2
     D(u, v) [(u M / 2)            (v N / 2) ]
Butterworth Low pass Filters
The transfer function of a Butterworth lowpass filter of
order n with cutoff frequency at distance D0 from the
origin is defined as:
                             1
          H (u , v)
                    1 [ D(u , v) / D0 ]2 n
Gaussian Low pass Filters
The transfer function of a Gaussian lowpass filter is
defined as:
                       D2 (u ,v ) / 2 D0 2
    H (u, v) e
Lowpass Filtering Examples
 A low pass Gaussian filter is used to connect broken text
Sharpening in the Frequency Domain
Edges and fine detail in images are associated with high
frequency components
High 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)
Ideal High Pass Filters
The ideal high pass filter is given as:
                      0 if D(u, v) D0
        H (u, v)
                      1 if D(u, v) D0
where D0 is the cut off distance as before
Butterworth High Pass Filters
The Butterworth high pass filter is given as:
                             1
       H (u , v)                        2n
                   1 [ D0 / D(u , v)]

where n is the order and D0 is the cut off distance as
before
Gaussian High Pass Filters
The Gaussian high pass filter is given as: 2
                            D2 (u ,v ) / 2 D0
    H (u, v) 1 e
where D0 is the cut off distance as before
Frequency Domain Filtering & Spatial
Domain Filtering
Similar jobs can be done in the spatial and frequency
domains
Filtering in the spatial domain can be easier to
understand
Filtering in the frequency domain can be much faster –
especially for large images
Questions?
THANK YOU…!!! 

More Related Content

What's hot

Chapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier TransformationChapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier Transformation
Varun Ojha
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
lalithambiga kamaraj
 
Point processing
Point processingPoint processing
Point processing
panupriyaa7
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & moments
rajisri2
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
asodariyabhavesh
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
babak danyal
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
Tawose Olamide Timothy
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
Bulbul Agrawal
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
A B Shinde
 
Module 31
Module 31Module 31
Module 31
UllasSS1
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - II
Hemantha Kulathilake
 
Image segmentation
Image segmentation Image segmentation
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domainAshish Kumar
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)
Kalyan Acharjya
 
Image Restoration And Reconstruction
Image Restoration And ReconstructionImage Restoration And Reconstruction
Image Restoration And Reconstruction
Amnaakhaan
 
digital image processing, image processing
digital image processing, image processingdigital image processing, image processing
digital image processing, image processing
Kalyan Acharjya
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
Mostafa G. M. Mostafa
 

What's hot (20)

Chapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier TransformationChapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier Transformation
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Point processing
Point processingPoint processing
Point processing
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & moments
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Module 31
Module 31Module 31
Module 31
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - II
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 
SPATIAL FILTER
SPATIAL FILTERSPATIAL FILTER
SPATIAL FILTER
 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domain
 
point operations in image processing
point operations in image processingpoint operations in image processing
point operations in image processing
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)
 
Image Restoration And Reconstruction
Image Restoration And ReconstructionImage Restoration And Reconstruction
Image Restoration And Reconstruction
 
digital image processing, image processing
digital image processing, image processingdigital image processing, image processing
digital image processing, image processing
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 

Viewers also liked

Introduction to digital image processing
Introduction to digital image processingIntroduction to digital image processing
Introduction to digital image processing
Hossain Md Shakhawat
 
High pass filter
High pass filterHigh pass filter
High pass filter
Anirban Bhowal
 
Low pass filter
Low pass filterLow pass filter
Low pass filter
Mohamad Firdaus Daud
 
Low pass filters
Low pass filtersLow pass filters
Low pass filters
kunwartouseef
 
Digital image processing question bank
Digital image processing question bankDigital image processing question bank
Digital image processing question bankYaseen Albakry
 
Lecture 3b: Decision Trees (1 part)
Lecture 3b: Decision Trees (1 part)Lecture 3b: Decision Trees (1 part)
Lecture 3b: Decision Trees (1 part)
Marina Santini
 
Color image processing Presentation
Color image processing PresentationColor image processing Presentation
Color image processing Presentation
Revanth Chimmani
 
Color models
Color modelsColor models
Color models
Haitham Ahmed
 
10 color image processing
10 color image processing10 color image processing
10 color image processing
babak danyal
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
kiruthiammu
 
Colour models
Colour modelsColour models
Colour models
BCET
 
Color models
Color modelsColor models
Color models
Moahmed Sweelam
 
Filters
FiltersFilters
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
University of Potsdam
 
Color Models Computer Graphics
Color Models Computer GraphicsColor Models Computer Graphics
Color Models Computer Graphics
dhruv141293
 
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain RatioLecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Marina Santini
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
Madhu Bala
 
Color Models
Color ModelsColor Models
Color Models
Mustafa Salam
 
Ecommerce website proposal
Ecommerce website proposalEcommerce website proposal
Ecommerce website proposalSudhir Raj
 

Viewers also liked (19)

Introduction to digital image processing
Introduction to digital image processingIntroduction to digital image processing
Introduction to digital image processing
 
High pass filter
High pass filterHigh pass filter
High pass filter
 
Low pass filter
Low pass filterLow pass filter
Low pass filter
 
Low pass filters
Low pass filtersLow pass filters
Low pass filters
 
Digital image processing question bank
Digital image processing question bankDigital image processing question bank
Digital image processing question bank
 
Lecture 3b: Decision Trees (1 part)
Lecture 3b: Decision Trees (1 part)Lecture 3b: Decision Trees (1 part)
Lecture 3b: Decision Trees (1 part)
 
Color image processing Presentation
Color image processing PresentationColor image processing Presentation
Color image processing Presentation
 
Color models
Color modelsColor models
Color models
 
10 color image processing
10 color image processing10 color image processing
10 color image processing
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
 
Colour models
Colour modelsColour models
Colour models
 
Color models
Color modelsColor models
Color models
 
Filters
FiltersFilters
Filters
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
 
Color Models Computer Graphics
Color Models Computer GraphicsColor Models Computer Graphics
Color Models Computer Graphics
 
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain RatioLecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Color Models
Color ModelsColor Models
Color Models
 
Ecommerce website proposal
Ecommerce website proposalEcommerce website proposal
Ecommerce website proposal
 

Similar to Digital image processing img smoothning

5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1Gichelle Amon
 
05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt
pawankamal3
 
2.spatial filtering
2.spatial filtering2.spatial filtering
2.spatial filtering
mukesh bhardwaj
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
mercysuttle
 
Image processing spatialfiltering
Image processing spatialfilteringImage processing spatialfiltering
Image processing spatialfilteringJohn Williams
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
shabanam tamboli
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
Wael Sharba
 
2. filtering basics
2. filtering basics2. filtering basics
2. filtering basics
Atul Kumar Jha
 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
ssuserc755f1
 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
ssuserc755f1
 
Notes on image processing
Notes on image processingNotes on image processing
Notes on image processing
Mohammed Kamel
 
Spatial domain filtering.ppt
Spatial domain filtering.pptSpatial domain filtering.ppt
Spatial domain filtering.ppt
ssuser4bbfb1
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
Kuppusamy P
 
Gabor Filter
Gabor FilterGabor Filter
ACMP340.pptx
ACMP340.pptxACMP340.pptx
ACMP340.pptx
FelixGathage
 
Digital Image processing
Digital Image processingDigital Image processing
Digital Image processing
Amir Hossain
 
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligencechAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
shesnasuneer
 
computervision1.pptx its about computer vision
computervision1.pptx its about computer visioncomputervision1.pptx its about computer vision
computervision1.pptx its about computer vision
shesnasuneer
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
Prof. Dr. Subhasis Bose
 
Lecture_Spatial_Filters.pptx
Lecture_Spatial_Filters.pptxLecture_Spatial_Filters.pptx
Lecture_Spatial_Filters.pptx
mahirazainab
 

Similar to Digital image processing img smoothning (20)

5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1
 
05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt
 
2.spatial filtering
2.spatial filtering2.spatial filtering
2.spatial filtering
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
 
Image processing spatialfiltering
Image processing spatialfilteringImage processing spatialfiltering
Image processing spatialfiltering
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
2. filtering basics
2. filtering basics2. filtering basics
2. filtering basics
 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
 
Notes on image processing
Notes on image processingNotes on image processing
Notes on image processing
 
Spatial domain filtering.ppt
Spatial domain filtering.pptSpatial domain filtering.ppt
Spatial domain filtering.ppt
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Gabor Filter
Gabor FilterGabor Filter
Gabor Filter
 
ACMP340.pptx
ACMP340.pptxACMP340.pptx
ACMP340.pptx
 
Digital Image processing
Digital Image processingDigital Image processing
Digital Image processing
 
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligencechAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
 
computervision1.pptx its about computer vision
computervision1.pptx its about computer visioncomputervision1.pptx its about computer vision
computervision1.pptx its about computer vision
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
Lecture_Spatial_Filters.pptx
Lecture_Spatial_Filters.pptxLecture_Spatial_Filters.pptx
Lecture_Spatial_Filters.pptx
 

Recently uploaded

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

Digital image processing img smoothning

  • 1. Presentation over image smoothing and sharpening -Vinay Kumar Gupta 0700410088
  • 2. 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.
  • 3. 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
  • 4. 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/restoration  Artistic effects  Medical visualisation  Industrial inspection  Law enforcement  Human computer interfaces
  • 5. Examples: The Hubble Telescope Launched in 1990 the Hubble telescope can take images of very distant objects However, an incorrect mirror made many of Hubble’s images useless. Image processing techniques were used to fix this
  • 6. Examples: HCI Try to make human computer interfaces more natural  Face recognition  Gesture recognition Does anyone remember the user interface from “Minority Report”?
  • 7. Key Stages in Digital Image Processing: Image Morphological Restoration Processing Image Enhancement Segmentation Image Object Acquisition Recognition Problem Domain Representation & Description Colour Image Image Processing Compression
  • 8. Image Representation Before we discuss image acquisition recall that a digital image is col composed 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) f (row, col) row
  • 12. What Is Image Enhancement? Image enhancement is the process of making images more useful The reasons for doing this include:  Highlighting interesting detail in images  Removing noise from images  Making images more visually appealing
  • 13. Spatial & Frequency Domains There 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 image For the moment we will concentrate on techniques that operate in the spatial domain
  • 14. Image Histograms The histogram of an image shows us the distribution of grey levels in the image Frequencies Grey Levels
  • 15. Spatial filtering techniques:  Neighbourhood operations  What is spatial filtering?  Smoothing operations  What happens at the edges?
  • 16. Neighbourhood Operations Neighbourhood operations simply operate on a larger neighbourhood of pixels than point operations Origin x Neighbourhoods are mostly a rectangle around a central pixel Any size rectangle and any shape filter (x, y) Neighbourhood are possible y Image f (x, y)
  • 17. Simple Neighbourhood Operations Some simple neighbourhood operations include:  Min: Set the pixel value to the minimum in the neighbourhood  Max: 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
  • 18. The Spatial Filtering Process Origin x a b c r s t d g e h f i * u x v y w z Original Image Filter Simple 3*3 Pixels e 3*3 Filter Neighbourhood eprocessed = v*e + r*a + s*b + t*c + u*d + w*f + y Image f (x, y) x*g + y*h + z*i The above is repeated for every pixel in the original image to generate the filtered image
  • 19. Smoothing Spatial Filters  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 1/ 1/ 1/ 9 9 9 in removing noise from images  Also useful for 1/ 9 1/ 9 1/ 9 Simple highlighting gross averaging detail 1/ 1/ 1/ filter 9 9 9
  • 20. Smoothing Spatial Filtering Origin x 104 100 108 1/ 1/ 1/ 9 9 9 1/ 1/ 1/ 99 106 98 95 90 85 * 1/ 9 1/ 9 1/ 9 9 9 9 1/ 1/ 1/ 104 100 108 Original Image Filter 9 9 9 Simple 3*3 1/ 99 106 198 1/ /9 3*3 Smoothing Pixels 9 9 Neighbourhood 195 /9 1/ 90 185 /9 Filter 9 e = 1/9*106 + 1/ *104 + 1/ *100 + 1/ *108 + 9 9 9 1/ *99 + 1/ *98 + 9 9 y Image f (x, y) 1/ *95 + 1/ *90 + 1/ *85 9 9 9 = 98.3333 The above is repeated for every pixel in the original image to generate the smoothed image
  • 21. Sharpening Spatial Filters Previously we have looked at smoothing filters which remove fine detail Sharpening spatial filters seek to highlight fine detail  Remove blurring from images  Highlight edges Sharpening filters are based on spatial differentiation
  • 22. Spatial Differentiation Differentiation measures the rate of change of a function Let’s consider a simple 1 dimensional example
  • 24. 1st Derivative The formula for the 1st derivative of a function is as follows: f f ( x 1) f ( x) x It’s just the difference between subsequent values and measures the rate of change of the function.
  • 25. 2nd Derivative The formula for the 2nd derivative of a function is as follows: 2 f 2 f ( x 1) f ( x 1) 2 f ( x) x Simply takes into account the values both before and after the current value
  • 26. Using Second Derivatives For Image Enhancement The 2nd derivative is more useful for image enhancement than the 1st derivative  Stronger response to fine detail  Simpler implementation  We will come back to the 1st order derivative later on The first sharpening filter we will look at is the Laplacian  Isotropic  One of the simplest sharpening filters  We will look at a digital implementation
  • 27. The Laplacian The Laplacian is defined as follows: 2 2 2 f f f 2 2 x y where the partial 1st order derivative in the x direction is defined as follows: 2 f 2 f ( x 1, y ) f ( x 1, y ) 2 f ( x, y ) x and in the y direction as follows: 2 f 2 f ( x, y 1) f ( x, y 1) 2 f ( x, y ) y
  • 28. The Laplacian (cont…) So, the Laplacian can be given as follows: 2 f [ f ( x 1, y ) f ( x 1, y ) f ( x, y 1) f ( x, y 1)] 4 f ( x, y) We can easily build a filter based on this 0 1 0 1 -4 1 0 1 0
  • 29. The Laplacian (cont…) Applying the Laplacian to an image we get a new image that highlights edges and other discontinuities Original Laplacian Laplacian Image Filtered Image Filtered Image Scaled for Display
  • 30. But That Is Not Very Enhanced! The result of a Laplacian filtering is not an enhanced image We have to do more work in order to get our final image Subtract the Laplacian result from the original image to generate our final sharpened enhanced image Laplacian Filtered Image 2 Scaled for Display g ( x, y ) f ( x, y ) f
  • 31. Laplacian Image Enhancement - = Original Laplacian Sharpened Image Filtered Image Image In the final sharpened image edges and fine detail are much more obvious
  • 33. Simplified Image Enhancement The entire enhancement can be combined into a single filtering operation 2 g ( x, y ) f ( x, y ) f f ( x, y) [ f ( x 1, y) f ( x 1, y) f ( x, y 1) f ( x, y 1) 4 f ( x, y)] 5 f ( x, y) f ( x 1, y) f ( x 1, y) f ( x, y 1) f ( x, y 1)
  • 34. 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
  • 35. 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
  • 36. 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: M 1N 1 j 2 ( ux / M vy / N ) F (u , v) f ( x, y )e x 0 y 0 for u = 0, 1, 2…M-1 and v = 0, 1, 2…N-1.
  • 37. DFT & Images The DFT of a two dimensional image can be visualised by showing the spectrum of the images component frequencies DFT
  • 38. The DFT and Image Processing To filter an image in the frequency domain: 1. Compute F(u,v) the DFT of the image 2. Multiply F(u,v) by a filter function H(u,v) 3. Compute the inverse DFT of the result
  • 39. Some Basic Frequency Domain Filters Low Pass Filter High Pass Filter
  • 40. Smoothing Frequency Domain Filters Smoothing is achieved in the frequency domain by dropping out the high frequency components The 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 function Low pass filters – only pass the low frequencies, drop the high ones.
  • 41. Ideal Low Pass Filter Simply 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
  • 42. Ideal Low Pass Filter (cont…) The transfer function for the ideal low pass filter can be given as: 1 if D(u, v) D0 H (u, v) 0 if D(u, v) D0 where D(u,v) is given as: 2 2 1/ 2 D(u, v) [(u M / 2) (v N / 2) ]
  • 43. Butterworth Low pass Filters The transfer function of a Butterworth lowpass filter of order n with cutoff frequency at distance D0 from the origin is defined as: 1 H (u , v) 1 [ D(u , v) / D0 ]2 n
  • 44. Gaussian Low pass Filters The transfer function of a Gaussian lowpass filter is defined as: D2 (u ,v ) / 2 D0 2 H (u, v) e
  • 45. Lowpass Filtering Examples A low pass Gaussian filter is used to connect broken text
  • 46. Sharpening in the Frequency Domain Edges and fine detail in images are associated with high frequency components High 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)
  • 47. Ideal High Pass Filters The ideal high pass filter is given as: 0 if D(u, v) D0 H (u, v) 1 if D(u, v) D0 where D0 is the cut off distance as before
  • 48. Butterworth High Pass Filters The Butterworth high pass filter is given as: 1 H (u , v) 2n 1 [ D0 / D(u , v)] where n is the order and D0 is the cut off distance as before
  • 49. Gaussian High Pass Filters The Gaussian high pass filter is given as: 2 D2 (u ,v ) / 2 D0 H (u, v) 1 e where D0 is the cut off distance as before
  • 50. Frequency Domain Filtering & Spatial Domain Filtering Similar jobs can be done in the spatial and frequency domains Filtering in the spatial domain can be easier to understand Filtering in the frequency domain can be much faster – especially for large images