0% found this document useful (0 votes)
66 views35 pages

Chapter 3

Uploaded by

abrahymysry269
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)
66 views35 pages

Chapter 3

Uploaded by

abrahymysry269
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/ 35

Chapter-3

Image Enhancement using Filtering

Spatial Frequency
Enhancement Enhancement
Spatial Domain vs. Frequency Domain

Spatial Domain
- Works directly on pixel values.
- Easier to implement but less control over individual frequency components.
- Useful for operations like blurring, sharpening, and edge detection.
Frequency Domain
- Works on the frequency components of the image.
- Provides finer control over specific frequency ranges.
- Used for more sophisticated filtering, such as removing periodic noise or
enhancing specific details.
Filtering

Filtering is a key image processing technique for enhancing images, removing


noise, or extracting features.

Filters are used to modify or enhance certain aspects of an image by altering


the pixel values or the frequency components.

Filters can be applied in both the spatial domain (directly on pixel values) and
the frequency domain (on frequency components after a Fourier Transform).
Low-Pass Filter: Removes high-frequency components, smooths images.
High-Pass Filter: Removes low-frequency components, sharpens images.

Low-Pass Filter (LPF) in the Spatial Domain, Common LPF in the spatial domain:
Averaging Filter, Gaussian Filter
-Reduces sharp transitions, smoothens the image.
- Blurs the image to reduce noise or unnecessary details.
High-Pass Filter (HPF) in the Spatial Domain, Common HPF in the spatial domain:
Laplacian Filter
- Enhances edges by emphasizing high-frequency details.
- Useful for sharpening images or detecting edges.
Applications

- Low-Pass Filters
- Used for noise reduction, image blurring, smoothing, and creating soft-focus effects.
- Examples: Photography post-processing, medical imaging.
- High-Pass Filters
- Used for edge detection, image sharpening, and enhancing fine details
Averaging filtering

Each pixel is replaced by weighted W is a suitable chosen


average of its neighborhood pixels, neighborhood around the pixel
resulting image is the low pass filtered location (m,n)
image and the output image is: A(k,1) is the filter weight
Directional Smoothing

A technique in image processing used to reduce noise while preserving


directional structures in an image.
Useful in applications such as edge detection and enhancing features without
blurring important edges.

Smoothing is performed along a specific direction (horizontal, vertical,


diagonal).
It minimizes distortion along that direction while maintaining the structure
of edges perpendicular to the smoothing direction.
Advantages:
Preserves directional features.
Reduces unwanted noise without blurring.
Limitations:
Can be computationally expensive.
Requires manual selection of direction for optimal results.
Median Filtering

Input pixel is replaced by median of


the pixels contained in the
neighborhood
Useful in removing
impulsive noise (salt-and-
pepper noise) without
smoothing the rest of the
image.
Sharpening Spatial Filters

Sharpening spatial filters seek to highlight fine detail


Remove blurring from images
Highlight edges
Sharpening filters are based on spatial differentiation
Spatial Filtering

The output (response) of a smoothing, linear


spatial filter is simply the average of the
pixels contained in the neighbourhood of the
mask. These filters sometimes are called
averaging filters. they also are referred to a
lowpass filters.
Filtering in the Frequency Domain

Frequency Representation of Images


• Images can be represented as a sum of sine and cosine functions using
the Fourier Transform.
• Low frequencies represent slow variations (e.g., smooth areas).
• High frequencies represent rapid changes (e.g., edges and noise).
•Why Filter in the Frequency Domain?
Frequency domain filtering allows precise control over which frequency
components are retained or suppressed.
- It's especially effective for removing specific types of noise.
Low-Pass and High-Pass Filtering in the Frequency Domain

a low-pass filter is a filter that attenuates high frequencies while ``passing'' low
frequencies.
Low frequencies correspond to the slowly varying components of an image (e.g.,
uniform background);
a high-pass filter is a filter that attenuates low frequencies while ``passing'' high
frequencies.
High frequencies correspond to the sharply varying components of an image (e.g.,
edges).
However, filters in the spatial domain have smaller masks than those in the
frequency domain. That is, one can first specify a filter in the frequency domain,
take its inverse Fourier transform, and then use the resulting filter in the spatial
domain as a guide for constructing smaller spatial filter masks!
Low-pass (LP) in frequency domain

• An ideal low-pass filter transfer function in 2D is given by:


Smoothing
Frequency Domain,
Ideal Low-pass
Filters
Butterworth filter

Transfer function of Butterworth


Butterworth filter transfer function has low-pass filter of order n is
a smooth transition from pass band to
cutoff band and when
Butterworth Lowpass Filters

A butterworth lowpass filter (BLPF) of order


n with cutoff frequency at a distance D0 from
the origin is given by the following transfer
function 1
H (u, v) =
1 + [ D(u, v) / D0 ]2 n
BLPF does not have a sharp discontinuity
For BLPF, the cutoff frequency is defined
as the frequency at which the transfer
function has value which is half of the
maximum
Sharpening
Frequency Domain,
Ideal High-pass
Filters
Band Pass Filter
Homomorphic Filtering
•Homomorphic filtering is a technique in image processing used to enhance contrast and
remove unwanted variations in illumination.
•It operates in the frequency domain to separate illumination and reflectance components
of an image.
An image can be expressed as the product of illumination and reflectance:
I(x,y)=i(x,y)⋅r(x,y)
Where:
I(x,y) is the observed image,
i(x,y) is the illumination (low frequency),
r(x,y) is the reflectance (high frequency).
Homomorphic Filter Process
•Step-by-Step Overview
• Convert the image into the log domain to separate illumination and
reflectance.
• Perform a Fourier Transform to get the frequency components.
• Apply a high-pass filter in the frequency domain.
• Take the inverse Fourier Transform to convert back to the spatial
domain.
• Use the exponential function to revert to the original scale.
Applications of Homomorphic Filtering
•Image Enhancement
• Used in medical imaging to improve contrast in X-rays, MRI scans.
• Enhances low-light images by correcting uneven lighting conditions.
•Pattern Recognition
• Improves image preprocessing for better feature extraction.
•Document Scanning
• Reduces background shading in scanned documents for improved readability.
Homomorphic Filtering Workflow
Log Transformation log(I(x,y))=log(i(x,y)+log(r(x,y)
Fourier Transform:
Convert the image into the frequency domain using Fourier Transform.

Filtering:
Apply a filter to modify the frequency components.
Low-frequency components (illumination) are attenuated.
High-frequency components (reflectance) are amplified.
Inverse Fourier Transform:
Convert back to the spatial domain.
Exponential Transform: Undo the logarithmic transformation
Unsharp Masking

▪ A sharp image can be obtained by high


pass filtering a blurred image
▪ Subtracting blurred image from original
image Leads to the sharpening of the
image.
convolution Theorem
establishes a correspondence between filtering in the spatial and frequency
domains as shown in the following table.

Spatial domain Frequency domain

Average filter Gaussian lowpass filter

Convolution
Laplacian Gaussian high pass filter

The convolution theorem links filters in both domains (spatial


and frequency)
• It states that convolution in spatial domain is equivalent to multiplication in
frequency domain.

Convolution
theorem
❑Noise: means any unwanted signal

❑ Common types of noise:


Salt and pepper noise: contains random
occurrences of black and white pixels
Impulse noise: contains random
occurrences of white pixels
Gaussian noise: variations in intensity
drawn from a Gaussian normal distribution
Poisson Noise (Shot Noise): Caused by
variations in photon detection.
Speckle Noise: Occurs in radar and
ultrasound images, producing
• Additive noise
Noise generated from sensors are white Gaussian

• Impulse noise
It generated from digital image transmission system
• Multiplication noise

Speckle noise from imaging system as SAR, ultrasound imaging


Quantization noise
Like produces artifacts , produce false contours around the object

Quantization noise removes image details which are of low


contrast
Steps for Noise Reduction

1. Apply Fourier Transform to convert the noisy image to the


frequency domain.
2. Use a low-pass filter to suppress high-frequency noise.
3. Apply Inverse Fourier Transform to revert to the spatial
domain.

You might also like