SlideShare a Scribd company logo
1 of 36
Spatial Filters
Mr. A. B. Shinde
A. B. Shinde
Contents…
 Smoothing spatial filters:
 Smoothing linear,
 Order statistic filters,
 Sharpening spatial filters:
 Use of second derivatives for
enhancement,
 Use of first derivatives for
enhancement
2
A. B. Shinde
3
Introduction
A. B. Shinde
Introduction
• Smoothing filters are used for blurring and for noise reduction.
• Blurring is used in preprocessing tasks, such as removal of small details
from an image prior to (large) object extraction, and bridging of small
gaps in lines or curves.
• Noise reduction can be accomplished by blurring with a linear filter and
also by nonlinear filtering.
4
A. B. Shinde
5
Smoothing Linear Filters
A. B. Shinde
Smoothing Linear Filters
• Smoothing, linear spatial filter computes the average of the pixels
contained in the neighborhood of the filter mask.
• These filters sometimes are called averaging filters and sometimes they
are also referred as lowpass filters.
• During such filtration, the value of every pixel in an image is replaced by
the average of the intensity levels in the neighborhood defined by the
filter mask.
6
A. B. Shinde
Smoothing Linear Filters
• This results in an output image with reduced “sharp” transitions in
intensities.
• Random noise typically consists of sharp transitions in intensity levels,
hence smoothing linear filter is used for noise reduction.
• Averaging filters have the undesirable side effect that they blur edges.
7
A. B. Shinde
Smoothing Linear Filters
• Figure shows 3 x 3 smoothing filter.
• Use of this filter yields the standard average of the
pixels under the mask.
• Equation:
8
which is the average of the intensity levels of the
pixels in the 3 x 3 neighborhood defined by the
mask.
A. B. Shinde
Smoothing Linear Filters
9
• The coefficients of the filter are all 1s to make it
computationally more efficient.
• At the end of the filtering process the entire image
is divided by 9.
• An m x n mask would have a normalizing constant
equal to 1/mn.
• A spatial averaging filter in which all coefficients
are equal is called a box filter.
A. B. Shinde
Smoothing Linear Filters
• This mask uses weighted average, (pixels are
multiplied by different coefficients i.e. giving more
importance (weight) to some pixels at the expense
of others).
• In the mask shown, the pixel at the center is
multiplied by a higher value than any other, thus
giving this pixel more importance in the calculation.
• The other pixels are inversely weighted as a function
of their distance from the center of the mask.
• The diagonal terms are further away from the center
than the orthogonal neighbors and, thus, they are
weighed less than the immediate neighbors of the
center pixel.
10
A. B. Shinde
Smoothing Linear Filters
• Highest weighing given to the center and the
value of the coefficients are decreased as a
function of increasing distance is an attempt to
reduce blurring in the smoothing process.
• The sum of all the coefficients in the mask of
figure is equal to 16, an attractive feature for
computer implementation because it is an
integer power of 2.
11
A. B. Shinde
Smoothing Linear Filters
• With reference to earlier equation, the general implementation for
filtering an M x N image with a weighted averaging filter of size m x n
(m and n odd) is given by the expression
12
Where, x = 0, 1, 2, … , M - 1 and y = 0, 1, 2, …., N – 1
The denominator in equation is simply the sum of the mask coefficients
and, therefore, it is a constant that needs to be computed only once.
A. B. Shinde
Smoothing Linear Filters
13
Original image, of size
500 x 500 pixels
Result of averaging
filter masks of size
m = 3
Result of averaging
filter masks of size
m = 5
Result of averaging
filter masks of size
m = 15
Result of averaging
filter masks of size
m = 35
Result of averaging
filter masks of size
m = 9
A. B. Shinde
Smoothing Linear Filters
14
Image of size
528 x 485 pixels from
the Hubble Space
Telescope
Image filtered with a
15 x 15 averaging mask
Original image courtesy of NASA
A. B. Shinde
15
Smoothing Nonlinear Filters
A. B. Shinde
Smoothing Nonlinear Filters
• Order-statistic filter is nonlinear spatial filter.
• The response is based on ordering (ranking) the pixels contained in the
image encompassed by the filter and then replacing the value of the
center pixel with the value determined by the ranking result.
• The best-known filter in this category is the median filter, which replaces
the value of a pixel by the median of the intensity values in the
neighborhood of that pixel.
• Median filters are popular because, for certain types of random noise,
they provide excellent noise-reduction capabilities, with considerably
less blurring.
16
A. B. Shinde
Smoothing Nonlinear Filters
• Median filters are particularly effective in the presence of impulse noise,
(salt-and-pepper noise) because of its appearance as white and black
dots superimposed on an image.
• The median ξ, of a set of values is such that half the values in the set
are less than or equal to ξ and half are greater than or equal to ξ .
• In order to perform median filtering at a point in an image, we first sort
the values of the pixel in the neighborhood, determine their median, and
assign that value to the corresponding pixel in the filtered image.
17
A. B. Shinde
Smoothing Nonlinear Filters
• For example:
• In a 3 x 3 neighborhood the median is the 5th largest value, in a 5 x 5
neighborhood, 13th largest value, and so on.
• When several values in a neighborhood are the same, all equal values
are grouped.
• For example, suppose that a 3 x 3 neighborhood has values (10, 20, 20,
20, 15, 20, 20, 25, 100). These values are sorted as (10, 15, 20, 20, 20,
20, 20, 25, 100), which results in a median of 20.
• The principal function of median filters is to force points with distinct
intensity levels to be more like their neighbors.
18
A. B. Shinde
Smoothing Nonlinear Filters
• The median filter is the most useful order-statistic filter in image
processing.
• The median represents the 50th percentile of a ranked set of numbers.
• For example, using the 100th percentile results in the so-called max filter,
which is useful for finding the brightest points in an image.
• The response of a 3 x 3 max filter is given by
R = max{zk| k = 1, 2, ....., 9}.
• The 0th percentile filter is the min filter.
19
A. B. Shinde
Smoothing Nonlinear Filters
20
X-ray image of circuit
board corrupted by
salt-and-pepper noise
Noise reduction with
3 x 3 averaging mask
Noise reduction with a
3 x 3 median filter
image courtesy of Mr. Joseph E. Pascente, Lixi, Inc.
The averaging filter blurred the image and its noise reduction performance
was poor.
The superiority of median over average filtering is quite good.
In general, median filtering is much better than averaging for the removal
of salt-and-pepper noise.
A. B. Shinde
21
Sharpening Filters
A. B. Shinde
Sharpening Filters
• Sharpening filters are used is to highlight transitions in intensity.
• Sharpening applications ranging from electronic printing and medical
imaging to industrial inspection and autonomous guidance in military
systems.
• Image blurring could be accomplished in the spatial domain by pixel
averaging in a neighborhood.
• As averaging is analogous to integration, it is logical to conclude that
sharpening can be accomplished by spatial differentiation.
• Thus, image differentiation enhances edges and other discontinuities
(such as noise) and deemphasizes areas with slowly varying intensities.
22
A. B. Shinde
Sharpening Filters
• Derivatives:
• The derivatives of a digital function are defined in terms of differences.
• There are various ways to define these differences.
• First derivative
– (1) must be zero in areas of constant intensity;
– (2) must be nonzero at the onset of an intensity step or ramp; and
– (3) must be nonzero along ramps.
• Second derivative
• (1) must be zero in constant areas;
• (2) must be nonzero at the onset and end of an intensity step or ramp; and
• (3) must be zero along ramps of constant slope.
23
A. B. Shinde
Sharpening Filters
• A basic definition of the first-order derivative of a one-dimensional
function f(x) is the difference
24
• Second-order derivative of f(x) as the difference
A. B. Shinde
Sharpening Filters
• Second Derivative for Image Sharpening:
• This approach consists of defining a discrete formulation of the second-
order derivative and then constructing a filter mask based on that
formulation.
• We are interested in isotropic filters, whose response is independent of
the direction of the discontinuities in the image to which the filter is
applied.
• Isotropic filters are rotation invariant, in the sense that rotating the image
and then applying the filter gives the same result as applying the filter to
the image first and then rotating the result.
• The simplest isotropic derivative operator is the Laplacian, which, for a
function (image) f(x,y) of two variables, is defined as
25
A. B. Shinde
Sharpening Filters
• Second Derivative for Image Sharpening:
• Because derivatives of any order are linear operations, the Laplacian is
a linear operator.
• To express this equation in discrete form, in the x-direction, we have
26
and, similarly, in the y-direction we have
Therefore, discrete Laplacian of two variables is
A. B. Shinde
Sharpening Filters
• Second Derivative for Image Sharpening:
27
Filter mask used
to implement
discrete Laplacian
of two variables
Isotropic result for
rotations in
increments of 900
Mask used to
implement an
extension of this
equation that
includes the
diagonal terms
Isotropic results in
increments of 45°
Implementations
of the Laplacian
Implementations
of the Laplacian
A. B. Shinde
Sharpening Filters
• Second Derivative for Image Sharpening:
• As Laplacian is a derivative operator, its use highlights intensity
discontinuities in an image and deemphasizes regions with slowly
varying intensity levels.
• This will produce images that have grayish edge lines and other
discontinuities.
• If the definition used has a negative center coefficient, then we subtract,
rather than add, the Laplacian image to obtain a sharpened result.
• Thus, the basic way in which we use the Laplacian for image sharpening
is
28
The constant is c = -1, if the Laplacian filters are mask 1 or 2 used, and
c = 1 if either of the other two filters is used.
A. B. Shinde
Sharpening Filters
• Second Derivative for Image Sharpening:
29
Blurred image
of the moon
Laplacian
without scaling
Laplacian with
scaling
Image
sharpened using
the mask 1
Result
of using the
mask 2
Mask 1 Mask 2
A. B. Shinde
Sharpening Filters
• Unsharp Masking and Highboost Filtering:
• Printing and publishing sharpen images consists of subtracting an
unsharp (smoothed) version of an image from the original image.
• This process, called unsharp masking,
• Consists of the following steps:
1. Blur the original image.
2. Subtract the blurred image from the original
(the resulting difference is called the mask.)
3. Add the mask to the original.
30
A. B. Shinde
Sharpening Filters
• Unsharp Masking and Highboost Filtering:
• Letting denote the blurred image, unsharp masking is expressed
in equation form as follows. First we obtain the mask:
31
Then we add a weighted portion of the mask back to the original image
where we included a weight, k (k ≥ 0), for generality. When k = 1, we
have unsharp masking, as defined above. When k ≥ 1, the process is
referred to as highboost filtering. Choosing k < 1,de-emphasizes the
contribution of the unsharp mask.
A. B. Shinde
Sharpening Filters
• Unsharp Masking and Highboost Filtering:
32
Example
A. B. Shinde
Sharpening Filters
• First-Order Derivatives (Nonlinear) Image Sharpening:
• First derivatives in image processing are implemented using the
magnitude of the gradient. For a function f(x, y), the gradient of f at
coordinates (x, y) is defined as the two-dimensional column vector
33
This vector has the important geometrical property that it points in the
direction of the greatest rate of change of f at location (x, y).
A. B. Shinde
Sharpening Filters
• First-Order Derivatives (Nonlinear) Image Sharpening:
• The magnitude (length) of vector denoted as M(x, y), where
34
is the value at (x, y) of the rate of change in the direction of the gradient
vector. Note that M(x, y) is an image of the same size as the original,
created when x and y are allowed to vary over all pixel locations in f. It is
common practice to refer to this image as the gradient image (or simply
as the gradient when the meaning is clear).
A. B. Shinde
Sharpening Filters
• First-Order Derivatives (Nonlinear) Image Sharpening:
35
Optical image of contact lens
(with defects)
Sobel gradient.
This presentation is published only for educational purpose
abshinde.eln@gmail.com

More Related Content

What's hot

Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filterarulraj121
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesCristina Pérez Benito
 
Predictive coding
Predictive codingPredictive coding
Predictive codingp_ayal
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)asodariyabhavesh
 
Enhancement in frequency domain
Enhancement in frequency domainEnhancement in frequency domain
Enhancement in frequency domainAshish Kumar
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram ProcessingAmnaakhaan
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
Image Restoration
Image RestorationImage Restoration
Image RestorationPoonam Seth
 
Image enhancement sharpening
Image enhancement  sharpeningImage enhancement  sharpening
Image enhancement sharpeningarulraj121
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGmuthu181188
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 
Chapter 6 color image processing
Chapter 6 color image processingChapter 6 color image processing
Chapter 6 color image processingasodariyabhavesh
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image ProcessingPallavi Agarwal
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processingAnuj Arora
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancyNaveen Kumar
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image FundamentalsA B Shinde
 

What's hot (20)

Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
SPATIAL FILTER
SPATIAL FILTERSPATIAL FILTER
SPATIAL FILTER
 
Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color Images
 
Predictive coding
Predictive codingPredictive coding
Predictive coding
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
 
Enhancement in frequency domain
Enhancement in frequency domainEnhancement in frequency domain
Enhancement in frequency domain
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram Processing
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Image Restoration
Image RestorationImage Restoration
Image Restoration
 
Image enhancement sharpening
Image enhancement  sharpeningImage enhancement  sharpening
Image enhancement sharpening
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
Chapter 6 color image processing
Chapter 6 color image processingChapter 6 color image processing
Chapter 6 color image processing
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image Processing
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancy
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
 

Similar to Spatial Filters Guide for Noise Reduction and Edge Enhancement

Spatial Domain Filtering.pdf
Spatial Domain Filtering.pdfSpatial Domain Filtering.pdf
Spatial Domain Filtering.pdfswagatkarve
 
Digital image processing techniques
Digital image processing techniquesDigital image processing techniques
Digital image processing techniquesShab Bi
 
12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.pptAJAYMALIK97
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingrkumarankit06875
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filteringDeepikaT13
 
Image enhancement
Image enhancementImage enhancement
Image enhancementAyaelshiwi
 
Spatial enhancement techniques
Spatial enhancement techniquesSpatial enhancement techniques
Spatial enhancement techniquesAakanchaAnand
 
Noise filtering
Noise filteringNoise filtering
Noise filteringAlaa Ahmed
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatialElsayed Hemayed
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processingAbinaya B
 
Image enhancement
Image enhancementImage enhancement
Image enhancementjuhi mishra
 
Image pre processing - local processing
Image pre processing - local processingImage pre processing - local processing
Image pre processing - local processingAshish Kumar
 

Similar to Spatial Filters Guide for Noise Reduction and Edge Enhancement (20)

Lecture 4
Lecture 4Lecture 4
Lecture 4
 
unit-3.ppt
unit-3.pptunit-3.ppt
unit-3.ppt
 
Spatial Domain Filtering.pdf
Spatial Domain Filtering.pdfSpatial Domain Filtering.pdf
Spatial Domain Filtering.pdf
 
Digital image processing techniques
Digital image processing techniquesDigital image processing techniques
Digital image processing techniques
 
Module 31
Module 31Module 31
Module 31
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Spatial operation.ppt
Spatial operation.pptSpatial operation.ppt
Spatial operation.ppt
 
Spatial enhancement techniques
Spatial enhancement techniquesSpatial enhancement techniques
Spatial enhancement techniques
 
DIP -Unit 3 ppt.pptx
DIP -Unit 3 ppt.pptxDIP -Unit 3 ppt.pptx
DIP -Unit 3 ppt.pptx
 
Noise filtering
Noise filteringNoise filtering
Noise filtering
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Image pre processing - local processing
Image pre processing - local processingImage pre processing - local processing
Image pre processing - local processing
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 

More from A B Shinde

Communication System Basics
Communication System BasicsCommunication System Basics
Communication System BasicsA B Shinde
 
MOSFETs: Single Stage IC Amplifier
MOSFETs: Single Stage IC AmplifierMOSFETs: Single Stage IC Amplifier
MOSFETs: Single Stage IC AmplifierA B Shinde
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: BasicsA B Shinde
 
Resume Writing
Resume WritingResume Writing
Resume WritingA B Shinde
 
Image Processing Basics
Image Processing BasicsImage Processing Basics
Image Processing BasicsA B Shinde
 
Blooms Taxonomy in Engineering Education
Blooms Taxonomy in Engineering EducationBlooms Taxonomy in Engineering Education
Blooms Taxonomy in Engineering EducationA B Shinde
 
ISE 7.1i Software
ISE 7.1i SoftwareISE 7.1i Software
ISE 7.1i SoftwareA B Shinde
 
VHDL Coding Syntax
VHDL Coding SyntaxVHDL Coding Syntax
VHDL Coding SyntaxA B Shinde
 
VLSI Testing Techniques
VLSI Testing TechniquesVLSI Testing Techniques
VLSI Testing TechniquesA B Shinde
 
Selecting Engineering Project
Selecting Engineering ProjectSelecting Engineering Project
Selecting Engineering ProjectA B Shinde
 
Interview Techniques
Interview TechniquesInterview Techniques
Interview TechniquesA B Shinde
 
Semiconductors
SemiconductorsSemiconductors
SemiconductorsA B Shinde
 
Diode Applications & Transistor Basics
Diode Applications & Transistor BasicsDiode Applications & Transistor Basics
Diode Applications & Transistor BasicsA B Shinde
 
Electronics Basic Concepts
Electronics Basic ConceptsElectronics Basic Concepts
Electronics Basic ConceptsA B Shinde
 
Multithreading
MultithreadingMultithreading
MultithreadingA B Shinde
 
Multiprocessor
MultiprocessorMultiprocessor
MultiprocessorA B Shinde
 
Multicore Computers
Multicore ComputersMulticore Computers
Multicore ComputersA B Shinde
 

More from A B Shinde (20)

Communication System Basics
Communication System BasicsCommunication System Basics
Communication System Basics
 
MOSFETs: Single Stage IC Amplifier
MOSFETs: Single Stage IC AmplifierMOSFETs: Single Stage IC Amplifier
MOSFETs: Single Stage IC Amplifier
 
MOSFETs
MOSFETsMOSFETs
MOSFETs
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: Basics
 
Resume Format
Resume FormatResume Format
Resume Format
 
Resume Writing
Resume WritingResume Writing
Resume Writing
 
Image Processing Basics
Image Processing BasicsImage Processing Basics
Image Processing Basics
 
Blooms Taxonomy in Engineering Education
Blooms Taxonomy in Engineering EducationBlooms Taxonomy in Engineering Education
Blooms Taxonomy in Engineering Education
 
ISE 7.1i Software
ISE 7.1i SoftwareISE 7.1i Software
ISE 7.1i Software
 
VHDL Coding Syntax
VHDL Coding SyntaxVHDL Coding Syntax
VHDL Coding Syntax
 
VHDL Programs
VHDL ProgramsVHDL Programs
VHDL Programs
 
VLSI Testing Techniques
VLSI Testing TechniquesVLSI Testing Techniques
VLSI Testing Techniques
 
Selecting Engineering Project
Selecting Engineering ProjectSelecting Engineering Project
Selecting Engineering Project
 
Interview Techniques
Interview TechniquesInterview Techniques
Interview Techniques
 
Semiconductors
SemiconductorsSemiconductors
Semiconductors
 
Diode Applications & Transistor Basics
Diode Applications & Transistor BasicsDiode Applications & Transistor Basics
Diode Applications & Transistor Basics
 
Electronics Basic Concepts
Electronics Basic ConceptsElectronics Basic Concepts
Electronics Basic Concepts
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 
Multicore Computers
Multicore ComputersMulticore Computers
Multicore Computers
 

Recently uploaded

computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxsomshekarkn64
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 

Recently uploaded (20)

computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 

Spatial Filters Guide for Noise Reduction and Edge Enhancement

  • 2. A. B. Shinde Contents…  Smoothing spatial filters:  Smoothing linear,  Order statistic filters,  Sharpening spatial filters:  Use of second derivatives for enhancement,  Use of first derivatives for enhancement 2
  • 4. A. B. Shinde Introduction • Smoothing filters are used for blurring and for noise reduction. • Blurring is used in preprocessing tasks, such as removal of small details from an image prior to (large) object extraction, and bridging of small gaps in lines or curves. • Noise reduction can be accomplished by blurring with a linear filter and also by nonlinear filtering. 4
  • 5. A. B. Shinde 5 Smoothing Linear Filters
  • 6. A. B. Shinde Smoothing Linear Filters • Smoothing, linear spatial filter computes the average of the pixels contained in the neighborhood of the filter mask. • These filters sometimes are called averaging filters and sometimes they are also referred as lowpass filters. • During such filtration, the value of every pixel in an image is replaced by the average of the intensity levels in the neighborhood defined by the filter mask. 6
  • 7. A. B. Shinde Smoothing Linear Filters • This results in an output image with reduced “sharp” transitions in intensities. • Random noise typically consists of sharp transitions in intensity levels, hence smoothing linear filter is used for noise reduction. • Averaging filters have the undesirable side effect that they blur edges. 7
  • 8. A. B. Shinde Smoothing Linear Filters • Figure shows 3 x 3 smoothing filter. • Use of this filter yields the standard average of the pixels under the mask. • Equation: 8 which is the average of the intensity levels of the pixels in the 3 x 3 neighborhood defined by the mask.
  • 9. A. B. Shinde Smoothing Linear Filters 9 • The coefficients of the filter are all 1s to make it computationally more efficient. • At the end of the filtering process the entire image is divided by 9. • An m x n mask would have a normalizing constant equal to 1/mn. • A spatial averaging filter in which all coefficients are equal is called a box filter.
  • 10. A. B. Shinde Smoothing Linear Filters • This mask uses weighted average, (pixels are multiplied by different coefficients i.e. giving more importance (weight) to some pixels at the expense of others). • In the mask shown, the pixel at the center is multiplied by a higher value than any other, thus giving this pixel more importance in the calculation. • The other pixels are inversely weighted as a function of their distance from the center of the mask. • The diagonal terms are further away from the center than the orthogonal neighbors and, thus, they are weighed less than the immediate neighbors of the center pixel. 10
  • 11. A. B. Shinde Smoothing Linear Filters • Highest weighing given to the center and the value of the coefficients are decreased as a function of increasing distance is an attempt to reduce blurring in the smoothing process. • The sum of all the coefficients in the mask of figure is equal to 16, an attractive feature for computer implementation because it is an integer power of 2. 11
  • 12. A. B. Shinde Smoothing Linear Filters • With reference to earlier equation, the general implementation for filtering an M x N image with a weighted averaging filter of size m x n (m and n odd) is given by the expression 12 Where, x = 0, 1, 2, … , M - 1 and y = 0, 1, 2, …., N – 1 The denominator in equation is simply the sum of the mask coefficients and, therefore, it is a constant that needs to be computed only once.
  • 13. A. B. Shinde Smoothing Linear Filters 13 Original image, of size 500 x 500 pixels Result of averaging filter masks of size m = 3 Result of averaging filter masks of size m = 5 Result of averaging filter masks of size m = 15 Result of averaging filter masks of size m = 35 Result of averaging filter masks of size m = 9
  • 14. A. B. Shinde Smoothing Linear Filters 14 Image of size 528 x 485 pixels from the Hubble Space Telescope Image filtered with a 15 x 15 averaging mask Original image courtesy of NASA
  • 15. A. B. Shinde 15 Smoothing Nonlinear Filters
  • 16. A. B. Shinde Smoothing Nonlinear Filters • Order-statistic filter is nonlinear spatial filter. • The response is based on ordering (ranking) the pixels contained in the image encompassed by the filter and then replacing the value of the center pixel with the value determined by the ranking result. • The best-known filter in this category is the median filter, which replaces the value of a pixel by the median of the intensity values in the neighborhood of that pixel. • Median filters are popular because, for certain types of random noise, they provide excellent noise-reduction capabilities, with considerably less blurring. 16
  • 17. A. B. Shinde Smoothing Nonlinear Filters • Median filters are particularly effective in the presence of impulse noise, (salt-and-pepper noise) because of its appearance as white and black dots superimposed on an image. • The median ξ, of a set of values is such that half the values in the set are less than or equal to ξ and half are greater than or equal to ξ . • In order to perform median filtering at a point in an image, we first sort the values of the pixel in the neighborhood, determine their median, and assign that value to the corresponding pixel in the filtered image. 17
  • 18. A. B. Shinde Smoothing Nonlinear Filters • For example: • In a 3 x 3 neighborhood the median is the 5th largest value, in a 5 x 5 neighborhood, 13th largest value, and so on. • When several values in a neighborhood are the same, all equal values are grouped. • For example, suppose that a 3 x 3 neighborhood has values (10, 20, 20, 20, 15, 20, 20, 25, 100). These values are sorted as (10, 15, 20, 20, 20, 20, 20, 25, 100), which results in a median of 20. • The principal function of median filters is to force points with distinct intensity levels to be more like their neighbors. 18
  • 19. A. B. Shinde Smoothing Nonlinear Filters • The median filter is the most useful order-statistic filter in image processing. • The median represents the 50th percentile of a ranked set of numbers. • For example, using the 100th percentile results in the so-called max filter, which is useful for finding the brightest points in an image. • The response of a 3 x 3 max filter is given by R = max{zk| k = 1, 2, ....., 9}. • The 0th percentile filter is the min filter. 19
  • 20. A. B. Shinde Smoothing Nonlinear Filters 20 X-ray image of circuit board corrupted by salt-and-pepper noise Noise reduction with 3 x 3 averaging mask Noise reduction with a 3 x 3 median filter image courtesy of Mr. Joseph E. Pascente, Lixi, Inc. The averaging filter blurred the image and its noise reduction performance was poor. The superiority of median over average filtering is quite good. In general, median filtering is much better than averaging for the removal of salt-and-pepper noise.
  • 22. A. B. Shinde Sharpening Filters • Sharpening filters are used is to highlight transitions in intensity. • Sharpening applications ranging from electronic printing and medical imaging to industrial inspection and autonomous guidance in military systems. • Image blurring could be accomplished in the spatial domain by pixel averaging in a neighborhood. • As averaging is analogous to integration, it is logical to conclude that sharpening can be accomplished by spatial differentiation. • Thus, image differentiation enhances edges and other discontinuities (such as noise) and deemphasizes areas with slowly varying intensities. 22
  • 23. A. B. Shinde Sharpening Filters • Derivatives: • The derivatives of a digital function are defined in terms of differences. • There are various ways to define these differences. • First derivative – (1) must be zero in areas of constant intensity; – (2) must be nonzero at the onset of an intensity step or ramp; and – (3) must be nonzero along ramps. • Second derivative • (1) must be zero in constant areas; • (2) must be nonzero at the onset and end of an intensity step or ramp; and • (3) must be zero along ramps of constant slope. 23
  • 24. A. B. Shinde Sharpening Filters • A basic definition of the first-order derivative of a one-dimensional function f(x) is the difference 24 • Second-order derivative of f(x) as the difference
  • 25. A. B. Shinde Sharpening Filters • Second Derivative for Image Sharpening: • This approach consists of defining a discrete formulation of the second- order derivative and then constructing a filter mask based on that formulation. • We are interested in isotropic filters, whose response is independent of the direction of the discontinuities in the image to which the filter is applied. • Isotropic filters are rotation invariant, in the sense that rotating the image and then applying the filter gives the same result as applying the filter to the image first and then rotating the result. • The simplest isotropic derivative operator is the Laplacian, which, for a function (image) f(x,y) of two variables, is defined as 25
  • 26. A. B. Shinde Sharpening Filters • Second Derivative for Image Sharpening: • Because derivatives of any order are linear operations, the Laplacian is a linear operator. • To express this equation in discrete form, in the x-direction, we have 26 and, similarly, in the y-direction we have Therefore, discrete Laplacian of two variables is
  • 27. A. B. Shinde Sharpening Filters • Second Derivative for Image Sharpening: 27 Filter mask used to implement discrete Laplacian of two variables Isotropic result for rotations in increments of 900 Mask used to implement an extension of this equation that includes the diagonal terms Isotropic results in increments of 45° Implementations of the Laplacian Implementations of the Laplacian
  • 28. A. B. Shinde Sharpening Filters • Second Derivative for Image Sharpening: • As Laplacian is a derivative operator, its use highlights intensity discontinuities in an image and deemphasizes regions with slowly varying intensity levels. • This will produce images that have grayish edge lines and other discontinuities. • If the definition used has a negative center coefficient, then we subtract, rather than add, the Laplacian image to obtain a sharpened result. • Thus, the basic way in which we use the Laplacian for image sharpening is 28 The constant is c = -1, if the Laplacian filters are mask 1 or 2 used, and c = 1 if either of the other two filters is used.
  • 29. A. B. Shinde Sharpening Filters • Second Derivative for Image Sharpening: 29 Blurred image of the moon Laplacian without scaling Laplacian with scaling Image sharpened using the mask 1 Result of using the mask 2 Mask 1 Mask 2
  • 30. A. B. Shinde Sharpening Filters • Unsharp Masking and Highboost Filtering: • Printing and publishing sharpen images consists of subtracting an unsharp (smoothed) version of an image from the original image. • This process, called unsharp masking, • Consists of the following steps: 1. Blur the original image. 2. Subtract the blurred image from the original (the resulting difference is called the mask.) 3. Add the mask to the original. 30
  • 31. A. B. Shinde Sharpening Filters • Unsharp Masking and Highboost Filtering: • Letting denote the blurred image, unsharp masking is expressed in equation form as follows. First we obtain the mask: 31 Then we add a weighted portion of the mask back to the original image where we included a weight, k (k ≥ 0), for generality. When k = 1, we have unsharp masking, as defined above. When k ≥ 1, the process is referred to as highboost filtering. Choosing k < 1,de-emphasizes the contribution of the unsharp mask.
  • 32. A. B. Shinde Sharpening Filters • Unsharp Masking and Highboost Filtering: 32 Example
  • 33. A. B. Shinde Sharpening Filters • First-Order Derivatives (Nonlinear) Image Sharpening: • First derivatives in image processing are implemented using the magnitude of the gradient. For a function f(x, y), the gradient of f at coordinates (x, y) is defined as the two-dimensional column vector 33 This vector has the important geometrical property that it points in the direction of the greatest rate of change of f at location (x, y).
  • 34. A. B. Shinde Sharpening Filters • First-Order Derivatives (Nonlinear) Image Sharpening: • The magnitude (length) of vector denoted as M(x, y), where 34 is the value at (x, y) of the rate of change in the direction of the gradient vector. Note that M(x, y) is an image of the same size as the original, created when x and y are allowed to vary over all pixel locations in f. It is common practice to refer to this image as the gradient image (or simply as the gradient when the meaning is clear).
  • 35. A. B. Shinde Sharpening Filters • First-Order Derivatives (Nonlinear) Image Sharpening: 35 Optical image of contact lens (with defects) Sobel gradient.
  • 36. This presentation is published only for educational purpose abshinde.eln@gmail.com