SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
LOCAL NEIGHBORHOOD PROCESSING.
CONCEPT OF SPATIAL DOMAIN
FILTERING
CS-467 Digital Image Processing
1
Spatial Domain
• The Spatial Domain is a domain (the plane)
where a digital image is defined by spatial
coordinates of its pixels
• (Another domain considered in image
processing is the frequency domain where a
digital image is defined by braking down into
the spatial frequencies participating in its
formation – we will consider it later)
2
Local Neighborhood in
Image Processing
• Many image processing operations in the
spatial domain (particularly, spatial domain
filtering) are reduced to local neighborhood
processing
3
Local Neighborhood in
Image Processing
• Let be the set of coordinates of a
neighborhood centered on an arbitrary pixel
(x, y) in an image f.
• Neighborhood processing generates a
corresponding pixel at the same coordinates
in an output image g, such that the intensity
value in that that pixel is determined by a
specific operation involving the pixels in the
input image with coordinates in
4
xyS
xyS
Local Neighborhood in
Image Processing
5
Local Neighborhood in
Spatial Domain Image Processing
• The spatial domain processing can be
represented by the following expression
where f(x,y) is the input image, g(x,y) is the
output image and T is an operator defined
over a local neighborhood of pixel with the
coordinates (x,y)
6
( ) ( )( ), ,Tg x y f x y=
Local Contrast Enhancement
• Local contrast enhancement is utilized
through local histogram processing
• The local histogram in an n x m window of
a digital image with intensity levels {0,1,…,L-1}
is a discrete function
7
xyS
; 0,1,..., 1xy
xy
S k k
S
h r n k L
 
= = − 
 
Local Contrast Enhancement
• Local contrast enhancement leads to better
visibility of local details and, as a result, to the
extraction of those details (not necessarily
small details) that are hidden in the areas with
a poor local contrast
• Local contrast enhancement can be utilized,
for example, through the same methods that
are used for the global contrast enhancement
8
Local Contrast Enhancement
9
© 1992-2008 R.C. Gonzalez & R.E. Woods
Filtering
• Filtering in signal processing is the process of
accepting (passing) or rejecting certain
frequency components
• Lowpass filters preserve low frequencies,
rejecting the high ones
• Highpass filters preserve high frequencies,
rejecting the low ones
10
Filtering
• Lowpass filters are used in image processing
for removal or reduction of noise
• Highpass filters are used in image processing
for edge detection and distinguishing of small
details
11
Models of Noise
• Models of noise
• Additive noise
• Multiplicative (speckle) noise
• Impulse noise
where is the probability of distortion ( in
percents is called the corruption rate)
12
( ) ( ), , ( , )g x y f x y x yη= +
( ) ( ), , ( , )g x y f x y x yη= ×
( )
( )
, ( , )
,
1 , ,
n
n
p x y
g x y
p f x y
η
= 
−
np np
100%np ⋅
The Goal of Noise Filtering
• The goal of noise filtering is to obtain the best
approximation of the “ideal” image
in terms of the mean square error (root mean
square error) or, which is the same, in terms
of PSNR
• Filtering is utilized through a filtering operator
applied to a noisy image:
13
( ),f x y( )ˆ ,f x y
( ) ( )( )ˆ , ,f x y F g x y=
“Ideal” Filtering
• If there are k realizations of the same image
scene corrupted by the same kind of additive
noise, and , then the original image
can be restored by taking component-wise
mean of its realizations:
• The larger is k, the closer is to
14
k → ∞
( ) ( )
( ) ( )
1
, , ( , ); 1,2,..., ,...
1ˆ , ,
i i
k
i
i
g x y f x y x y i k
f x y g x y
k
η
=
= + =
= ∑
( )ˆ ,f x y ( ),f x y
Linear Filters
• Linear filtering is utilized through a linear
operator
• The operator F is called linear, if for arbitrary
constants a and b the following property
holds:
15
( )( ) ( )( ) ( )
( )( ) ( )
, ( , ) , ( , )
, ( , )
F af x y b x y F af x y F b x y
aF f x y bF x y
η η
η
+ = + =
+
Linear Filters
• A filter, which is represented by a linear
operator is called a linear filter
• Ideally, a linear filter may separate an image
from additive noise. If F is a linear filter, then
and an image can be restored as follows
16
( )( ) ( )( ) ( )( ) ( ), , ( , ) , ( , )F g x y F f x y x y F f x y F x yη η= + = +
( ) ( )( )( ) ( )( ) ( )( )1 1
, , , ( , )f x y F F f x y F F g x y F x yη− −
= −
Linear and Nonlinear Filters
• Since can be estimated only in the
frequency domain and this estimation is
possible only for some particular kinds of
noise, the “ideal” method has a limited
applicability
• Speckle and impulse noise cannot be
separated from an image using a linear filter.
Thus, for their filtering nonlinear filters shall
be used
17
( )( , )F x yη
Linear and Nonlinear Filters
• A filter, which is represented by an operator,
which is not linear, is called a nonlinear filter
• Linear filters can be implemented in the
frequency domain (where they originally were
applied by Norbert Wiener in 1940s ) and in the
spatial domain
• Most of nonlinear filters can be implemented
only in the spatial domain (except some specific
nonlinear transformations of spectra that are
applicable only in the frequency domain)
18
Filter Design
• When any new filter is designed, then to test its
efficiency, the following model should be used:
A clean image shall be artificially corrupted using
a certain kind of noise
Then an artificially corrupted image shall be
filtered and the result shall be compared to the
“ideal” clean image in terms of PSNR
A filter showing stable good results, being applied
to different images (when compared to other
filters), should be considered good
19
Modeling of Additive Noise
• To add noise to a clean image, it is necessary to
generate a matrix of noise with a desired
distribution (Gaussian is most frequently used)
using a random numbers generator, with exactly
the same sizes as the ones of the clean image,
the same mean as the one of the clean image and
σn (standard deviation) equal to of the
clean image.
• Then this noise shall be added to the clean image
component-wise and their common mean shall
be component-wise subtracted from the sum
20
0.2 0.5σ σ−
( ) ( ), , ( , )g x y f x y x y meanη= + −
Spatial Domain Filtering
• Any spatial domain filter is reduced to processing
of a local neighborhood of every pixel
• Filtering creates a new pixel with coordinates
equal to the coordinates of the center of the
neighborhood and whose value is the result of
the filtering operator applied to the
neighborhood of the processed pixel
• Filtering of different pixels is typically
independent and in such a case can be done in
parallel
21
Spatial Domain Filtering
• Any lowpass spatial domain filter averages
intensities (linearly or non-linearly) over an
n x m local neighborhood of each pixel and
smooths the image due to this averaging. This
means that some image details whose size is
about 0.5n x 0.5m may become
undistinguishable.
• Lowpass spatial domain filters are used for noise
reduction. Averaging over each n x m local
neighborhood , they “dissolve” a noise in an
image
22
Spatial Domain Filtering
23
Linear Spatial Domain Filtering
• Linear spatial filtering of an image of size
M x N with a filter of size m x n is defined by
the expression
where g(x,y) is an image to be processed,
a=(m-1)/2, b=(n-1)/2, and the weights w(s,t)
create a filter kernel
24
( ) ( ) ( )ˆ , , ,
a b
s a t b
f x y w s t g x s y t
=− =−
= + +∑ ∑
Linear Spatial Domain Filtering
25
© 1992-2008 R.C. Gonzalez & R.E. Woods
Border Effects in
Spatial Domain Filtering
• To process image borders, it is necessary to
extend an image in all directions, otherwise it
will not be possible to build local
neighborhoods for the border pixels
• The simplest way of such an extension is zero-
padding . However, this method always
creates a “black” frame along the image
borders.
26
Border Effects in
Spatial Domain Filtering
• To take care of border effects, mirroring shall
be used. An N x M image, before it is
processed by a spatial domain filter with an
n x m kernel, shall be extended to an
image as follows
27
2 2
n m
N M
   
+ × +      
( )
( )
( )
( )
( )
( )
, ; 0,1,..., 1, 0,1,..., 1
, ; 1,..., / 2 , 0,1,..., 1
( 1) ( 1), ; ,..., / 2 1, 0,1,..., 1
, ; 0,1,..., 1, 1,..., / 2,
,( 1) ( 1) ; 0,1,..., 1, ,...
f x y x N y M
f x y x n y M
f N x N y x N N n y M
f x y x N y mf x y
f x N y N x N y N
= −= −
− =− − = −  
− − − + = + −= −  
− = − =− −  =  
− − − + = −=

( )
( )
, / 2 1
, ; , 1, 2,...
( 1) ( 1),( 1) ( 1) ; , , 1,...
N m
f x y x y
f N x N N y N x y N N






 + −  
− − =− −

− − − + − − − + = +
Border Effects in
Spatial Domain Filtering
28
0th row
M-1th row
0th
col.
1st
col.
-1th row
Mth row
-1st
col.
Mirroring for a 3x3 local neighborhood window
Arithmetic Mean Filter – the Simplest
Spatial Domain Linear Filter
• Arithmetic mean filter replaces the intensity
value in each pixel by the local arithmetic
mean taken over a local n x m processing
window:
• This corresponds to the filter kernel (mask)
29
( ) ( )
1ˆ , ,
a b
s a t b
f x y g x s y t
nm =− =−
= + +∑ ∑
1 1 1
...
1 1 1
...
... ... ... ...
1 1 1
...
nm nm nm
nm nm nm
nm nm nm
 
 
 
 
 
 
 
 
 
 
Useful Filtering Mask
• Vertical and horizontal adjacent pixels in a 3x3
window are located “closer” to the center of the
window than the diagonal pixels. Evidently, the
distance from a center of a square to any of its sides
is shorter than the one to its vertices:
30
Useful Filtering Mask
• So it can be reasonable to emphasize
contribution of the central pixel and its closest
neighbors to the resulting intensity value. This
can be done by the following filter mask
(kernel)
31
1 2 1
1
2 4 2
16
1 2 1
 
 
 
 
 

Contenu connexe

Tendances

SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGmuthu181188
 
Filtering an image is to apply a convolution
Filtering an image is to apply a convolutionFiltering an image is to apply a convolution
Filtering an image is to apply a convolutionAbhishek Mukherjee
 
Image processing spatialfiltering
Image processing spatialfilteringImage processing spatialfiltering
Image processing spatialfilteringJohn Williams
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processingAbinaya B
 
04 image enhancement edge detection
04 image enhancement edge detection04 image enhancement edge detection
04 image enhancement edge detectionRumah Belajar
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filteringDeepikaT13
 
Noise filtering
Noise filteringNoise filtering
Noise filteringAlaa Ahmed
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainMadhu Bala
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image ProcessingPallavi Agarwal
 
Digital image processing
Digital image processingDigital image processing
Digital image processingSangavi G
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filtersA B Shinde
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatialElsayed Hemayed
 
Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothningVinay Gupta
 
New approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmNew approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmeSAT Publishing House
 

Tendances (20)

SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
Filtering an image is to apply a convolution
Filtering an image is to apply a convolutionFiltering an image is to apply a convolution
Filtering an image is to apply a convolution
 
Image processing spatialfiltering
Image processing spatialfilteringImage processing spatialfiltering
Image processing spatialfiltering
 
Module 2
Module 2Module 2
Module 2
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 
2.spatial filtering
2.spatial filtering2.spatial filtering
2.spatial filtering
 
04 image enhancement edge detection
04 image enhancement edge detection04 image enhancement edge detection
04 image enhancement edge detection
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Noise filtering
Noise filteringNoise filtering
Noise filtering
 
Module 31
Module 31Module 31
Module 31
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image Processing
 
Unit3 dip
Unit3 dipUnit3 dip
Unit3 dip
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial
 
Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothning
 
New approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmNew approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithm
 

En vedette

Edna and sheila slideshare composite
Edna and sheila slideshare compositeEdna and sheila slideshare composite
Edna and sheila slideshare compositePAS_Team
 
Housing & its Basic Requirements | SurgicoMed.com
Housing & its Basic Requirements | SurgicoMed.comHousing & its Basic Requirements | SurgicoMed.com
Housing & its Basic Requirements | SurgicoMed.comMukhdoom BaharAli
 
PAS 106 Workshops Leeds
PAS 106 Workshops LeedsPAS 106 Workshops Leeds
PAS 106 Workshops LeedsPAS_Team
 
Christopher Cant S106 presentation
Christopher Cant S106 presentationChristopher Cant S106 presentation
Christopher Cant S106 presentationPAS_Team
 
Housing chapter 2
Housing chapter 2Housing chapter 2
Housing chapter 2lbonner1987
 
Housing Standards Review: Building Regulations Perspective
Housing Standards Review: Building Regulations PerspectiveHousing Standards Review: Building Regulations Perspective
Housing Standards Review: Building Regulations PerspectivePAS_Team
 
image compression using matlab project report
image compression  using matlab project reportimage compression  using matlab project report
image compression using matlab project reportkgaurav113
 
Chapter 1 housing and human needs
Chapter 1 housing and human needsChapter 1 housing and human needs
Chapter 1 housing and human needslbonner1987
 
Low Cost Housing Concept
Low Cost Housing ConceptLow Cost Housing Concept
Low Cost Housing ConceptDr K M SONI
 
low cost housing delhi
low cost housing delhilow cost housing delhi
low cost housing delhiricha_15b
 
Affordable housing in india
Affordable housing in indiaAffordable housing in india
Affordable housing in indiaPramod Kumar
 
Planning concepts
Planning conceptsPlanning concepts
Planning conceptsctlachu
 

En vedette (15)

Edna and sheila slideshare composite
Edna and sheila slideshare compositeEdna and sheila slideshare composite
Edna and sheila slideshare composite
 
Housing & its Basic Requirements | SurgicoMed.com
Housing & its Basic Requirements | SurgicoMed.comHousing & its Basic Requirements | SurgicoMed.com
Housing & its Basic Requirements | SurgicoMed.com
 
PAS 106 Workshops Leeds
PAS 106 Workshops LeedsPAS 106 Workshops Leeds
PAS 106 Workshops Leeds
 
Christopher Cant S106 presentation
Christopher Cant S106 presentationChristopher Cant S106 presentation
Christopher Cant S106 presentation
 
Housing chapter 2
Housing chapter 2Housing chapter 2
Housing chapter 2
 
Housing Standards Review: Building Regulations Perspective
Housing Standards Review: Building Regulations PerspectiveHousing Standards Review: Building Regulations Perspective
Housing Standards Review: Building Regulations Perspective
 
image compression using matlab project report
image compression  using matlab project reportimage compression  using matlab project report
image compression using matlab project report
 
Chapter 1 housing and human needs
Chapter 1 housing and human needsChapter 1 housing and human needs
Chapter 1 housing and human needs
 
Low Cost Housing Concept
Low Cost Housing ConceptLow Cost Housing Concept
Low Cost Housing Concept
 
Fulltext
FulltextFulltext
Fulltext
 
Neighborhood
NeighborhoodNeighborhood
Neighborhood
 
Housing powerpoint
Housing powerpointHousing powerpoint
Housing powerpoint
 
low cost housing delhi
low cost housing delhilow cost housing delhi
low cost housing delhi
 
Affordable housing in india
Affordable housing in indiaAffordable housing in india
Affordable housing in india
 
Planning concepts
Planning conceptsPlanning concepts
Planning concepts
 

Similaire à Lecture 4

Image enhancement
Image enhancementImage enhancement
Image enhancementKuppusamy P
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIPbabak danyal
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingrkumarankit06875
 
Adaptive unsharp masking
Adaptive unsharp maskingAdaptive unsharp masking
Adaptive unsharp maskingRavi Teja
 
CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureFatmaNewagy1
 
12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.pptAJAYMALIK97
 
Image enhancement
Image enhancementImage enhancement
Image enhancementAyaelshiwi
 
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...Hemantha Kulathilake
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersKuppusamy P
 
05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt05_Spatial_Filtering.ppt
05_Spatial_Filtering.pptpawankamal3
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)Mathankumar S
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image EnhancementMathankumar S
 
Spatial Domain Filtering.pdf
Spatial Domain Filtering.pdfSpatial Domain Filtering.pdf
Spatial Domain Filtering.pdfswagatkarve
 

Similaire à Lecture 4 (20)

Image enhancement
Image enhancementImage enhancement
Image enhancement
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
unit-3.ppt
unit-3.pptunit-3.ppt
unit-3.ppt
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
 
PPT s04-machine vision-s2
PPT s04-machine vision-s2PPT s04-machine vision-s2
PPT s04-machine vision-s2
 
Adaptive unsharp masking
Adaptive unsharp maskingAdaptive unsharp masking
Adaptive unsharp masking
 
CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lecture
 
12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filters
 
05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image Enhancement
 
Spatial Domain Filtering.pdf
Spatial Domain Filtering.pdfSpatial Domain Filtering.pdf
Spatial Domain Filtering.pdf
 
DIP -Unit 3 ppt.pptx
DIP -Unit 3 ppt.pptxDIP -Unit 3 ppt.pptx
DIP -Unit 3 ppt.pptx
 
Edge detection
Edge detectionEdge detection
Edge detection
 
2. filtering basics
2. filtering basics2. filtering basics
2. filtering basics
 

Plus de Wael Sharba (20)

Project 8
Project 8Project 8
Project 8
 
Project 7
Project 7Project 7
Project 7
 
Project 6
Project 6Project 6
Project 6
 
Project 5
Project 5Project 5
Project 5
 
Project 4
Project 4Project 4
Project 4
 
Project 2
Project 2Project 2
Project 2
 
Project 1
Project 1Project 1
Project 1
 
Project 3
Project 3Project 3
Project 3
 
Project 9
Project 9Project 9
Project 9
 
Lecture 14
Lecture 14Lecture 14
Lecture 14
 
Lecture 13
Lecture 13Lecture 13
Lecture 13
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Microsoft system center 1
Microsoft system center 1Microsoft system center 1
Microsoft system center 1
 
Sig2014 vision correcting display
Sig2014 vision correcting displaySig2014 vision correcting display
Sig2014 vision correcting display
 

Dernier

Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Dernier (20)

Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Lecture 4

  • 1. LOCAL NEIGHBORHOOD PROCESSING. CONCEPT OF SPATIAL DOMAIN FILTERING CS-467 Digital Image Processing 1
  • 2. Spatial Domain • The Spatial Domain is a domain (the plane) where a digital image is defined by spatial coordinates of its pixels • (Another domain considered in image processing is the frequency domain where a digital image is defined by braking down into the spatial frequencies participating in its formation – we will consider it later) 2
  • 3. Local Neighborhood in Image Processing • Many image processing operations in the spatial domain (particularly, spatial domain filtering) are reduced to local neighborhood processing 3
  • 4. Local Neighborhood in Image Processing • Let be the set of coordinates of a neighborhood centered on an arbitrary pixel (x, y) in an image f. • Neighborhood processing generates a corresponding pixel at the same coordinates in an output image g, such that the intensity value in that that pixel is determined by a specific operation involving the pixels in the input image with coordinates in 4 xyS xyS
  • 6. Local Neighborhood in Spatial Domain Image Processing • The spatial domain processing can be represented by the following expression where f(x,y) is the input image, g(x,y) is the output image and T is an operator defined over a local neighborhood of pixel with the coordinates (x,y) 6 ( ) ( )( ), ,Tg x y f x y=
  • 7. Local Contrast Enhancement • Local contrast enhancement is utilized through local histogram processing • The local histogram in an n x m window of a digital image with intensity levels {0,1,…,L-1} is a discrete function 7 xyS ; 0,1,..., 1xy xy S k k S h r n k L   = = −   
  • 8. Local Contrast Enhancement • Local contrast enhancement leads to better visibility of local details and, as a result, to the extraction of those details (not necessarily small details) that are hidden in the areas with a poor local contrast • Local contrast enhancement can be utilized, for example, through the same methods that are used for the global contrast enhancement 8
  • 9. Local Contrast Enhancement 9 © 1992-2008 R.C. Gonzalez & R.E. Woods
  • 10. Filtering • Filtering in signal processing is the process of accepting (passing) or rejecting certain frequency components • Lowpass filters preserve low frequencies, rejecting the high ones • Highpass filters preserve high frequencies, rejecting the low ones 10
  • 11. Filtering • Lowpass filters are used in image processing for removal or reduction of noise • Highpass filters are used in image processing for edge detection and distinguishing of small details 11
  • 12. Models of Noise • Models of noise • Additive noise • Multiplicative (speckle) noise • Impulse noise where is the probability of distortion ( in percents is called the corruption rate) 12 ( ) ( ), , ( , )g x y f x y x yη= + ( ) ( ), , ( , )g x y f x y x yη= × ( ) ( ) , ( , ) , 1 , , n n p x y g x y p f x y η =  − np np 100%np ⋅
  • 13. The Goal of Noise Filtering • The goal of noise filtering is to obtain the best approximation of the “ideal” image in terms of the mean square error (root mean square error) or, which is the same, in terms of PSNR • Filtering is utilized through a filtering operator applied to a noisy image: 13 ( ),f x y( )ˆ ,f x y ( ) ( )( )ˆ , ,f x y F g x y=
  • 14. “Ideal” Filtering • If there are k realizations of the same image scene corrupted by the same kind of additive noise, and , then the original image can be restored by taking component-wise mean of its realizations: • The larger is k, the closer is to 14 k → ∞ ( ) ( ) ( ) ( ) 1 , , ( , ); 1,2,..., ,... 1ˆ , , i i k i i g x y f x y x y i k f x y g x y k η = = + = = ∑ ( )ˆ ,f x y ( ),f x y
  • 15. Linear Filters • Linear filtering is utilized through a linear operator • The operator F is called linear, if for arbitrary constants a and b the following property holds: 15 ( )( ) ( )( ) ( ) ( )( ) ( ) , ( , ) , ( , ) , ( , ) F af x y b x y F af x y F b x y aF f x y bF x y η η η + = + = +
  • 16. Linear Filters • A filter, which is represented by a linear operator is called a linear filter • Ideally, a linear filter may separate an image from additive noise. If F is a linear filter, then and an image can be restored as follows 16 ( )( ) ( )( ) ( )( ) ( ), , ( , ) , ( , )F g x y F f x y x y F f x y F x yη η= + = + ( ) ( )( )( ) ( )( ) ( )( )1 1 , , , ( , )f x y F F f x y F F g x y F x yη− − = −
  • 17. Linear and Nonlinear Filters • Since can be estimated only in the frequency domain and this estimation is possible only for some particular kinds of noise, the “ideal” method has a limited applicability • Speckle and impulse noise cannot be separated from an image using a linear filter. Thus, for their filtering nonlinear filters shall be used 17 ( )( , )F x yη
  • 18. Linear and Nonlinear Filters • A filter, which is represented by an operator, which is not linear, is called a nonlinear filter • Linear filters can be implemented in the frequency domain (where they originally were applied by Norbert Wiener in 1940s ) and in the spatial domain • Most of nonlinear filters can be implemented only in the spatial domain (except some specific nonlinear transformations of spectra that are applicable only in the frequency domain) 18
  • 19. Filter Design • When any new filter is designed, then to test its efficiency, the following model should be used: A clean image shall be artificially corrupted using a certain kind of noise Then an artificially corrupted image shall be filtered and the result shall be compared to the “ideal” clean image in terms of PSNR A filter showing stable good results, being applied to different images (when compared to other filters), should be considered good 19
  • 20. Modeling of Additive Noise • To add noise to a clean image, it is necessary to generate a matrix of noise with a desired distribution (Gaussian is most frequently used) using a random numbers generator, with exactly the same sizes as the ones of the clean image, the same mean as the one of the clean image and σn (standard deviation) equal to of the clean image. • Then this noise shall be added to the clean image component-wise and their common mean shall be component-wise subtracted from the sum 20 0.2 0.5σ σ− ( ) ( ), , ( , )g x y f x y x y meanη= + −
  • 21. Spatial Domain Filtering • Any spatial domain filter is reduced to processing of a local neighborhood of every pixel • Filtering creates a new pixel with coordinates equal to the coordinates of the center of the neighborhood and whose value is the result of the filtering operator applied to the neighborhood of the processed pixel • Filtering of different pixels is typically independent and in such a case can be done in parallel 21
  • 22. Spatial Domain Filtering • Any lowpass spatial domain filter averages intensities (linearly or non-linearly) over an n x m local neighborhood of each pixel and smooths the image due to this averaging. This means that some image details whose size is about 0.5n x 0.5m may become undistinguishable. • Lowpass spatial domain filters are used for noise reduction. Averaging over each n x m local neighborhood , they “dissolve” a noise in an image 22
  • 24. Linear Spatial Domain Filtering • Linear spatial filtering of an image of size M x N with a filter of size m x n is defined by the expression where g(x,y) is an image to be processed, a=(m-1)/2, b=(n-1)/2, and the weights w(s,t) create a filter kernel 24 ( ) ( ) ( )ˆ , , , a b s a t b f x y w s t g x s y t =− =− = + +∑ ∑
  • 25. Linear Spatial Domain Filtering 25 © 1992-2008 R.C. Gonzalez & R.E. Woods
  • 26. Border Effects in Spatial Domain Filtering • To process image borders, it is necessary to extend an image in all directions, otherwise it will not be possible to build local neighborhoods for the border pixels • The simplest way of such an extension is zero- padding . However, this method always creates a “black” frame along the image borders. 26
  • 27. Border Effects in Spatial Domain Filtering • To take care of border effects, mirroring shall be used. An N x M image, before it is processed by a spatial domain filter with an n x m kernel, shall be extended to an image as follows 27 2 2 n m N M     + × +       ( ) ( ) ( ) ( ) ( ) ( ) , ; 0,1,..., 1, 0,1,..., 1 , ; 1,..., / 2 , 0,1,..., 1 ( 1) ( 1), ; ,..., / 2 1, 0,1,..., 1 , ; 0,1,..., 1, 1,..., / 2, ,( 1) ( 1) ; 0,1,..., 1, ,... f x y x N y M f x y x n y M f N x N y x N N n y M f x y x N y mf x y f x N y N x N y N = −= − − =− − = −   − − − + = + −= −   − = − =− −  =   − − − + = −=  ( ) ( ) , / 2 1 , ; , 1, 2,... ( 1) ( 1),( 1) ( 1) ; , , 1,... N m f x y x y f N x N N y N x y N N        + −   − − =− −  − − − + − − − + = +
  • 28. Border Effects in Spatial Domain Filtering 28 0th row M-1th row 0th col. 1st col. -1th row Mth row -1st col. Mirroring for a 3x3 local neighborhood window
  • 29. Arithmetic Mean Filter – the Simplest Spatial Domain Linear Filter • Arithmetic mean filter replaces the intensity value in each pixel by the local arithmetic mean taken over a local n x m processing window: • This corresponds to the filter kernel (mask) 29 ( ) ( ) 1ˆ , , a b s a t b f x y g x s y t nm =− =− = + +∑ ∑ 1 1 1 ... 1 1 1 ... ... ... ... ... 1 1 1 ... nm nm nm nm nm nm nm nm nm                    
  • 30. Useful Filtering Mask • Vertical and horizontal adjacent pixels in a 3x3 window are located “closer” to the center of the window than the diagonal pixels. Evidently, the distance from a center of a square to any of its sides is shorter than the one to its vertices: 30
  • 31. Useful Filtering Mask • So it can be reasonable to emphasize contribution of the central pixel and its closest neighbors to the resulting intensity value. This can be done by the following filter mask (kernel) 31 1 2 1 1 2 4 2 16 1 2 1          