Lecture 13-Neighborhood Processing
Lecture 13-Neighborhood Processing
08/03/2026 1
Noise in Digital Images
Any undesired information that contaminates an
image can be considered as a noise.
Sources of Noise in Machine Vision
Illumination
Environment
Acquisition Devices
Transmission
Spatial Noise descriptor is characterized by a
probability density function.
Common noise models worth learning
Gaussian
Uniform
Impulse
2 08/03/20
Noise Model - Gaussian
Gaussian Noise
where
z: gray scale
μ = mean (average)
σ = standard
deviation
3 08/03/20
Noise Model - Uniform
Uniform Noise
4 08/03/20
Noise Model - Impulse
Salt and Pepper noise
Where b>a
5 08/03/20
NEIGHBORHOOD PROCESSING
6 08/03/20
Spatial Domain
Procedures that operate
directly on pixels
g(x, y) = T[ f(x, y) ]
where
f(x, y) is the input image
g(x, y) is the processed image
T is the operator on f defined
over some neighbourhood of (x,
y)
7 08/03/20
Filter
The term is basically borrowed
from the frequency domain
Also called as spatial masks,
kernels, templates and windows
Neighbourhood of a point (x, y)
can be defined by using a
square/rectangular (commonly
used) or circular subimage area
centred at (x, y) – mask or filter
The centre of the subimage is
moved from pixel to pixel starting
at the top left corner of the image
8 08/03/20
Spatial Filtering
A spatial filter consists of
A neighbourhood
A pre-defined operation
The values of a filter subimage
are referred to as coefficients,
rather than pixel intensities.
9 08/03/20
Linear Spatial Filtering
10 08/03/20
Linear Filtering
Linear Filtering of an image f of size M x N by filter by
mask of size m x n is given by the expression
11 08/03/20
Filtering Operation
Convolution of an image with a filter kernel or
mask.
Such filtering often addresses the removal (or
suppression) of noise (smoothing)
Most effectively accomplished using convolver
(or filtering) hardware.
12 08/03/20
Smoothing Spatial Filters
Use: For blurring images & noise reduction
Blurring is used in preprocessing steps, such as
Removal of small details from an image prior to object extraction
Bridging of small gaps in lines or curves
Smoothing of false contours
14 08/03/20
Weighted Averaging
Instead of averaging all the pixel values in the window, give the
closer-by pixels higher weighting, and far-away pixels lower
weighting
Reduce value of coefficients as a function of increasing distance
from the origin
An attempt to reduce blurring in the smoothing process
Its generally difficult to find difference between box filter and
weighted filter for small masks.
15 08/03/20
Weighted Averaging
Other Filters
16 08/03/20
An Example
What happens if we use
an averaging filter with
a larger window?
Original image, size
500x500 pixels
Results of smoothing
with averaging filter
masks of size n=3, 5, 9,
15, 35 respectively
17 08/03/20
Non-Linear Filters
smoothing.
18 08/03/20
Order-Statistic Filters
Median Filter
Replaces the value of a pixel by the median of the
intensity levels in the neighborhood of that pixel