0% found this document useful (0 votes)
7 views44 pages

Unit II

Spatial filtering is an image processing technique that modifies pixel values based on their neighborhood using kernels to perform tasks like smoothing, sharpening, and edge detection. It includes linear filters (e.g., mean and Gaussian filters) and non-linear filters (e.g., median filters) for various applications such as noise reduction and feature extraction. Additionally, frequency domain filtering enhances specific frequency components of signals, with techniques like low-pass and high-pass filters to achieve desired image quality.

Uploaded by

payakulatarun
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)
7 views44 pages

Unit II

Spatial filtering is an image processing technique that modifies pixel values based on their neighborhood using kernels to perform tasks like smoothing, sharpening, and edge detection. It includes linear filters (e.g., mean and Gaussian filters) and non-linear filters (e.g., median filters) for various applications such as noise reduction and feature extraction. Additionally, frequency domain filtering enhances specific frequency components of signals, with techniques like low-pass and high-pass filters to achieve desired image quality.

Uploaded by

payakulatarun
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
You are on page 1/ 44

Spatial filtering is a key image processing technique used to modify or enhance the spatial properties of an

image by applying a filter directly in the spatial domain. This involves manipulating pixel values based on their
neighborhood, usually using a kernel or mask. The technique is widely used in tasks such as image smoothing,
sharpening, edge detection, and noise reduction.
Key Concepts in Spatial Filtering
1. Spatial Domain: Operations performed directly on the pixels of an image.
2. Kernel/Mask: A small matrix (e.g., 3x3, 5x5) used to apply filtering. It is convolved with the image to compute
new pixel values.
3. Convolution: A mathematical operation where the kernel slides over the image, and each pixel is replaced by
a weighted sum of its neighbors, determined by the kernel.
Types of Spatial Filters
1. Linear Filters:
1. Smoothing Filters: Reduce noise and smooth the image by averaging pixel values. Examples:
1. Mean filter
2. Gaussian filter
2. Sharpening Filters: Enhance edges and details in the image by emphasizing intensity differences.
Examples:
1. Laplacian filter
2. High-pass filter
2. Non-Linear Filters:
1. These filters do not use a fixed kernel and often rely on ranking or statistical operations. Examples:
1. Median filter: Reduces noise, especially salt-and-pepper noise.
2. Mode filter: Replaces a pixel value with the most common value in its neighbourhood.
Applications of Spatial Filtering
•Noise Reduction: Smoothing filters like the Gaussian filter help remove unwanted noise while preserving edges
to some extent.
• Edge Detection: Filters like the Sobel, Prewitt, or Laplacian are designed to highlight edges in an image.
• Image Sharpening: High-pass filters are used to accentuate fine details and edges in an image.
•Feature Extraction: Spatial filters can emphasize specific patterns, such as textures or contours, to assist in image
analysis tasks.
Implementation Steps
1. Choose a Kernel: Based on the intended purpose (e.g., smoothing, edge detection).
2. Apply Convolution: Slide the kernel over the image and compute the filtered pixel value.
3. Handle Borders: Techniques like padding or ignoring borders are used to deal with edge cases where the kernel
exceeds image dimensions.
Combining Spatial Enhancement Methods
Combining spatial enhancement methods involves integrating different techniques to
achieve improved image quality, balancing contrast, edge sharpness, and noise
reduction. Below is an example process for combining methods effectively:
Advantages of Combining Methods
•Noise Removal: Smoothing filters remove noise, ensuring a cleaner image.
•Detail Preservation: CLAHE enhances local contrast, revealing fine textures.
• Balanced Enhancement: Combining local and global enhancement avoids over-
enhancement or loss of uniformity.
• Improved Edge Clarity: Sharpening filters ensure edges are distinct, improving feature
detection.
FILTERING IN THE FREQUENCY DOMAIN
Filtering in the frequency domain is a signal processing technique used to modify or enhance certain
frequency components of a signal while attenuating others. It is widely applied in image processing,
audio processing, and other domains where frequency information is critical.

Key Steps in Frequency Domain Filtering


1. Transform the Signal:
1. Convert the spatial domain representation of the signal (e.g., an image or time-domain audio signal) into
the frequency domain using a Fourier Transform (e.g., Discrete Fourier Transform (DFT) or Fast Fourier
Transform (FFT)).
2. Apply a Frequency Filter:
1. Design a filter in the frequency domain, such as:
1. Low-pass filter (LPF): Allows low frequencies to pass, blocks high frequencies.
2. High-pass filter (HPF): Allows high frequencies to pass, blocks low frequencies.
3. Band-pass filter (BPF): Allows a specific range of frequencies to pass.
4. Band-stop filter (BSF): Blocks a specific range of frequencies.
2. Multiply the Fourier-transformed signal with the designed filter in the frequency domain.
3. Inverse Transform:
1. Convert the filtered signal back to the spatial or time domain using the Inverse Fourier Transform (IFT).
Frequency Domain Filters are used for smoothing and sharpening of image by removal of high or low
frequency components. Sometimes it is possible of removal of very high and very low frequency. Frequency
domain filters are different from spatial domain filters as it basically focuses on the frequency of the images. It
is basically done for two basic operation i.e., Smoothing and Sharpening.
3. Band pass filter:
Band pass filter removes the very low frequency and very high frequency
components that means it keeps the moderate range band of frequencies.
Band pass filtering is used to enhance edges while reducing the noise at the
same time

You might also like