0% found this document useful (0 votes)
6 views117 pages

Non-Linear Image Filtering Techniques

Uploaded by

dayakeriyavar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views117 pages

Non-Linear Image Filtering Techniques

Uploaded by

dayakeriyavar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IMAGE PROCESSING

MODULE 2

Likewin Thomas
AIML
CONTENT
3.3 MORE NEIGHBORHOOD OPERATORS
"More neighborhood operators" refers to a class of image filters that operate on local
regions (neighborhoods) of pixels in an image.

These operators modify pixel values based on the values of nearby pixels, often in a
non-linear way.
Non-linear filtering refers to a class of image processing techniques where the
output at each pixel is not a simple weighted sum of the input pixels (as in linear
filtering) but instead
depends on more complex, non-linear combinations of the pixel values in its
neighborhood.
These filters are particularly effective for tasks where preserving edges or
removing specific types of noise is important, which linear filters often struggle
with.
3.3 MORE NEIGHBORHOOD OPERATORS
Key Type of Non-Linear: (Median Filtering & Bilateral filtering)
1. Median filtering: Replaces each pixel with the median value from its
neighborhood to reduce noise.
This filter is effective at removing salt-and-pepper noise (random black and white
pixels) without blurring edges.
Example: Consider an image where the pixel intensities in a 3x3 neighborhood are
{2, 3, 4, 8, 100, 101, 102, 150, 200}. The median of these values is 100, which
replaces the central pixel value.
If the number of pixels is even, the median is typically the average of the two
central values
3.3 MORE NEIGHBORHOOD OPERATORS
3.3 MORE NEIGHBORHOOD OPERATORS
Key Type of Non-Linear:
1. Median filtering:
3.3 MORE NEIGHBORHOOD OPERATORS
Key Type of Non-Linear:
1. Median filtering:
3.3 MORE NEIGHBORHOOD OPERATORS
1. Weighted median filter:
In the weighted median filter, each pixel is assigned a weight based on its distance from the
center of the neighborhood, which means that pixels closer to the center of the neighborhood
have a stronger influence on the median.
3.3 MORE NEIGHBORHOOD OPERATORS
1. Weighted median filter:
Steps for the Weighted Median Filter:
1. Neighborhood Selection: For each pixel in the image, a neighborhood (e.g., 3x3 or 5x5)
is selected, centered around the pixel being processed.
2. Weight Assignment: Assign a weight to each pixel in the neighborhood, with weights
usually based on the pixel's distance from the center. For instance, pixels closer to the
center could receive a higher weight, meaning they contribute more to the median
calculation.
3. Sorting and Weighted Median Calculation: Instead of simply selecting the median value
of the intensities in the neighborhood, the pixels are sorted, and each pixel is counted
multiple times depending on its weight. The pixel value that falls in the middle of the
sorted, weighted list is chosen as the new value for the central pixel.
3.3 MORE NEIGHBORHOOD OPERATORS
1. Weighted median filter:
3.3 MORE NEIGHBORHOOD OPERATORS
1. Weighted median filter:
3.3 MORE NEIGHBORHOOD OPERATORS
1. Weighted median filter:
3.3 MORE NEIGHBORHOOD OPERATORS
Key Type of Non-Linear:
2. Bilateral filtering: combines two different types of filters:
Domain filters (which consider spatial proximity) and
Range filters (which consider pixel intensity similarity).
The key feature of bilateral filtering is that it smooths images while
preserving edges, which is often a problem with other smoothing
techniques like Gaussian filters.

Spatial proximity: closeness or nearness of pixels in an image based on their spatial (geographical)
positions.
Pixel intensity similarity: how similar or close the intensity (or color value) of one pixel is compared to
another.
3.3 MORE NEIGHBORHOOD OPERATORS
Key Type of Non-Linear:
2. Bilateral filtering: combines two different types of filters:
Domain filters (which consider spatial proximity) and
Range filters (which consider pixel intensity similarity).
The key feature of bilateral filtering is that it smooths images while
preserving edges, which is often a problem with other smoothing
techniques like Gaussian filters.

Spatial proximity: closeness or nearness of pixels in an image based on their spatial (geographical)
positions.
Pixel intensity similarity: how similar or close the intensity (or color value) of one pixel is compared to
another.
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter

The filter computes a weighted average of the neighboring pixel values. The weights w(i,j,k,l)
make sure that pixels close to (i,j) in space and intensity have more influence on the final value.
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter
Summary:
The bilateral filter combines spatial proximity and intensity similarity to create a
smoothing effect that preserves edges.
Pixels close to the center (in space and intensity) have more influence on the final
pixel value, making bilateral filtering very effective at reducing noise while keeping
sharp transitions intact.
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
Guided Image Filtering is an extension of bilateral filtering where an additional guide image is used to
filter a noisy input image.
This guide image influences the output by helping the filter adaptively preserve edges and fine details.
In bilateral filtering, the output is determined by the spatial and range proximity.

This guide image (denoted as h() in the equations) controls the filtering process to produce smoother results
while preserving important features in the guide image.
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering

The local affine transformation is applied locally, meaning it is done in a small neighborhood
around each pixel, and it assumes that the output pixel is a linear function of the
corresponding pixel in the guide image.
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
Imagine you have a guide image that is used to guide the filtering process for another image. Let's say
both images are grayscale for simplicity, and you are focusing on a small 3x3 neighborhood around a
pixel.
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - Guided Image Filtering
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral filter - 3.3.3 Binary image processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter - Erosion shrinks the objects (1s) in a binary image. The general rule for erosion is:
3.3.3 A pixel in the output image will be set to 1 only if all pixels in the structuring
element that are 1s overlap with 1s in the binary image.
Binary If there is even one 1 in the structuring element that doesn’t overlap with a 1 in the
binary image, the center pixel will be set to 0.
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing

Therefore, the center pixel in the output will be 0.


3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing

Therefore, the center pixel in the output will be 0.


3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing

Therefore, the center pixel in the output will be 0.


3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing

Therefore, the center pixel in the output will be 0.


3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform
The distance transform converts a binary image (with
filter -
foreground and background pixels) into a grayscale image,
3.3.3 where each pixel's value represents the distance to the nearest
Binary background pixel (typically 0s).
image The resulting image shows how far each foreground pixel
processing (typically 1s) is from the closest background pixel.
The distance transform is especially useful for:
Identifying the center of objects.
Analyzing the shape and size of objects.
Finding skeletal structures of shapes, thinning, or medial
axis transformations.
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform
How Distance Transform Works:
filter -
In a binary image, pixels are either foreground (typically
3.3.3 marked as 1s) or background (typically marked as 0s).
Binary The distance transform computes, for each foreground
image pixel, the minimum distance to the nearest background pixel.
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform
Types of Distance Metrics:
filter - There are different ways to compute the distance between pixels, and this
3.3.3 choice impacts the resulting distance transform.
City Block Distance (Manhattan Distance):
Binary
image
Euclidean Distance:
processing

Chessboard Distance:
The distance is the maximum of the horizontal, vertical, or
diagonal steps between the two pixels.
This metric is similar to how a king moves in chess.
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform

filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral Distance Transform
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3
Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Bilateral
filter -
3.3.3 Binary
image
processing
3.3 MORE NEIGHBORHOOD OPERATORS
Summary:
Bilateral Binary image processing converts a grayscale image into a
filter - binary image using thresholding.
Morphological operations (dilation, erosion, opening,
3.3.3 Binary closing) modify the shapes of objects in binary images.
Distance transforms compute the distance of each pixel from
image the nearest background pixel.
processing Connected components analysis identifies groups of
connected pixels (objects) in the binary image.
3.4 FOURIER TRANSFORMS
The Fourier Transform is a mathematical tool that transforms a signal (or
image) from the spatial domain (or time domain for signals) into the frequency
domain.
Essentially, it decomposes a complex signal (like an image) into simpler
sinusoidal components (waves) of varying frequencies, amplitudes, and phases.
In the case of images:
The spatial domain represents the pixels' intensities in the image.
The frequency domain represents how rapidly these pixel intensities change
across the image.
3.4 FOURIER TRANSFORMS
Fourier transforms are essential in image processing to break down images into
their constituent frequencies.
An image can be thought of as a composition of sinusoidal waves of varying
frequencies.
Low frequencies correspond to smooth, gradual changes in pixel intensity,
representing the overall structure or large shapes in the image.
High frequencies capture rapid changes in pixel intensity, representing fine
details, sharp edges, and textures.
The Fourier transform allows us to switch from the spatial domain (pixels in an
image) to the frequency domain,
where an image is represented by its frequency components (sinusoids).
This helps analyze how different image filters (such as blurring, sharpening, or
edge detection filters) affect various frequencies in the image.
3.4 FOURIER TRANSFORMS
Sinusoidal Waves
A sinusoidal wave is a smooth,
periodic oscillation that can be
described mathematically by the
sine or cosine function.
It is one of the most
fundamental waveforms and
appears in many natural and
man-made phenomena, such as
sound, light, and electrical
signals.
3.4 FOURIER TRANSFORMS
Key Characteristics of Sinusoidal Waves:
Sinusoidal Waves (A) Amplitude: The height of the wave,
determining the wave's strength or
intensity.
(f) Frequency: The number of cycles
completed in one second. Higher
frequencies mean more cycles, and lower
frequencies mean fewer cycles.
Wavelength: The distance between two
successive peaks or troughs. A higher
frequency means shorter wavelengths,
t is the time or position variable, which while a lower frequency means longer
represents the wave's progression. wavelengths.
sin is the sine function, which produces the Phase Shift: A horizontal displacement
characteristic oscillating shape. that moves the wave left or right along the
time axis.
3.4 FOURIER TRANSFORMS
Sinusoidal Waves
Why Fourier Transforms?
In image processing, some filters are designed to emphasize or suppress certain frequencies.
For example, edge detection filters highlight high frequencies, while blur filters suppress high
frequencies and retain low frequencies.
The Fourier transform provides a clear way to understand this behavior.
How Fourier Transforms?
1. Convert the Image to Frequency Domain: Use the 2D Fourier Transform to transform the
image into its frequency components.
2. Apply Filtering: Modify the frequency components:
a. For edge detection, emphasize high frequencies.
b. For blurring, emphasize low frequencies.
3. Inverse Fourier Transform: After filtering, apply the inverse Fourier Transform to convert
the modified frequency components back into the spatial domain, resulting in the processed
image.
3.4 FOURIER TRANSFORMS
Sinusoidal Signals
Sinusoidal Signals are key to this analysis. A sinusoidal signal of the form
3.4 FOURIER TRANSFORMS
How Convolution Affects Sinusoids:
Sinusoidal Signals are key to this analysis. A sinusoidal signal of the form
3.4 FOURIER TRANSFORMS
How Convolution Affects Sinusoids:
Sinusoidal Signals are key to this analysis. A sinusoidal signal of the form
3.4 FOURIER TRANSFORMS
Complex Notation:
3.4 FOURIER TRANSFORMS
The Fourier Transform:
3.4 FOURIER TRANSFORMS
Equations for Computing Fourier Transforms:
3.4 FOURIER TRANSFORMS
Equations for Computing Fourier Transforms:
3.4 FOURIER TRANSFORMS
The plot visually shows the behavior of
the kernel in the frequency domain.
The horizontal axis represents frequency
(ranging from low to high), and
the vertical axis represents the amplitude
(the kernel’s response to different
frequencies).
Interpretation of the plots:
Low frequencies (left side of the plot)
correspond to smooth areas in an
image (like the background).
High frequencies (right side of the plot)
correspond to edges or sharp
transitions (like the border between
two objects).
3.4 FOURIER TRANSFORMS

The box-3 filter smooths images, as shown


in its plot where the response to low
frequencies is high, and it tapers off as the
frequencies increase, indicating the
suppression of high frequencies.

The Sobel filter (an edge detector)


emphasizes high frequencies, as indicated
by the upward slope in its plot, where
higher frequencies are retained, and lower
frequencies are suppressed.
3.4 FOURIER TRANSFORMS
3.4 FOURIER TRANSFORMS
3.4 FOURIER TRANSFORMS
3.4 FOURIER TRANSFORMS
3.4 FOURIER TRANSFORMS
3.4 FOURIER
TRANSFORMS
Equations for
Computing Fourier
Transforms:
For example, the box filter shows a
strong response at low frequencies
but less so at higher ones.
The Sobel filter, on the other hand,
emphasizes certain frequency ranges,
making it useful for detecting edges.
3.4 FOURIER TRANSFORMS
3.4 FOURIER TRANSFORMS
3.4 FOURIER TRANSFORMS
3.4 FOURIER TRANSFORMS
3.4 FOURIER TRANSFORMS
3.4.1 TWO-DIMENSIONAL FOURIER TRANSFORMS:
In the context of image processing, two-dimensional (2D) Fourier transforms
are the extension of the 1D Fourier transform to 2D signals, which in this case,
are images.
An image can be treated as a function that depends on two spatial variables: x
and y, which represent the horizontal and vertical dimensions of the image,
respectively.
Just as the 1D Fourier transform decomposes a 1D signal into its constituent
frequencies, the 2D Fourier transform does the same for a 2D image.
The 2D Fourier transform is used to convert an image from the spatial domain
(where pixel intensities are represented) into the frequency domain, which
reveals how different frequency components make up the image.
3.4.1 TWO-DIMENSIONAL FOURIER TRANSFORMS:
3.4.1 TWO-DIMENSIONAL FOURIER TRANSFORMS:

You might also like