Image Processing 3
Image Processing 3
Discuss briefly low pass filtering and high pass filtering in the context of image processing with
mathematical prelims
In image processing, low-pass filtering and high-pass filtering are fundamental operations used to
manipulate and analyze the frequency components of images. These filters are based on the Fourier
transform, which decomposes an image into its frequency components.
1. Mathematical Preliminaries
f (x, y)
M −1 N −1
F (u, v) = ∑ ∑ f (x, y) ⋅ e−j2π( M + N )
ux vy
x=0 y=0
Where:
M −1 N −1
1
∑ ∑ F (u, v) ⋅ ej2π( M + N )
ux vy
f (x, y) =
MN
u=0 v=0
2. Low-Pass Filtering
Mathematical Formulation
HLP (u, v) = {
1 if D(u, v) ≤ D0
0 if D(u, v) > D0
Where D(u, v) = (u − M /2)2 + (v − N /2)2 is the distance from the center frequency and D0 is
3. High-Pass Filtering
Purpose: To preserve high-frequency components (edges, sharp transitions) and suppress low-
frequency components (smooth regions).
Effect: Enhances edges and fine details.
Mathematical Formulation
HHP (u, v) = {
0 if D(u, v) ≤ D0
1 if D(u, v) > D0
Summary
These filters are critical in tasks like noise reduction, edge detection, and image enhancement.
Discuss briefly about different types of filters with their mathematical prelims and interpretetion
In image processing, filters are essential tools used to manipulate images for various purposes such as
smoothing, sharpening, edge detection, noise removal, and feature extraction. These filters are applied
either in the spatial domain (using convolution) or in the frequency domain (using Fourier transforms).
1. Linear Filters
Definition:
Filters where the output is a linear combination of the input pixels and their neighbors.
Mathematical Preliminaries:
i=−m j=−n
Where:
0 1 0
Laplacian Edge detection 1 −4 1
Detects areas with rapid intensity change
0 1 0
−1 0 1
Sobel Edge detection Gx = −2 0 2
Detects vertical edges
−1 0 1
2. Non-Linear Filters
Definition:
Filters where the output is a non-linear function of input pixels, often used to remove noise without
blurring edges.
Mathematical Preliminaries:
No convolution. The output is derived from a function applied over the neighborhood.
Definition:
Operate on the Fourier transform of the image by modifying its frequency components.
Mathematical Preliminaries:
Apply DFT:
Inverse DFT:
4. Directional Filters
Definition:
Specialized edge detectors sensitive to edges in specific directions (e.g., vertical, horizontal, diagonal).
Example:
−1 0 1
−1 0 1
−1 0 1
📌 Summary Table
Filter Type Domain Purpose Example Filter
Linear Spatial Smoothing, Edge Detection Gaussian, Sobel
Non-linear Spatial Noise removal, detail preservation Median, Bilateral
Frequency-based Frequency Frequency component analysis Low/High/Band-pass
Directional Spatial Direction-specific edge detection Prewitt, Sobel
These filters serve various applications in image enhancement, computer vision, feature extraction, and
pre-processing for machine learning. Each type has its own strengths and is chosen based on the goal of
the image processing task.
What is derivative filtering and homomorphic filtering . Explain briefly with mathematical prelims
🔹 1. Derivative Filtering
🧠 Idea:
Derivative filtering is based on approximating the derivatives of an image to detect edges, intensity
changes, and features. It uses the first and second-order derivatives of image intensity.
📘 Mathematical Preliminaries:
Let f (x, y) be a grayscale image. The first-order derivatives (gradient) are:
∂f
≈ f (x + 1, y) − f (x, y)
∂x
∂f
≈ f (x, y + 1) − f (x, y)
∂y
2 2
∂f ∂f
∣∇f (x, y)∣ = ( ) +( )
∂x ∂y
∂2f ∂2f
∇2 f (x, y) = +
∂x2 ∂y 2
−1 0 1
Prewitt First-order Similar to Sobel, used for edge detection
0 1 0
Laplacian Second-order 1 −4 1
0 1 0
🎯 Interpretation:
Highlights edges and transitions in intensity.
Useful in detecting object boundaries, textures, etc.
🔹 2. Homomorphic Filtering
🧠 Idea:
Homomorphic filtering is used to separate illumination and reflectance components of an image. It
enhances image contrast and corrects non-uniform lighting.
📘 Mathematical Preliminaries:
An image can be modeled as:
Where:
This converts multiplication into addition, allowing separation in the frequency domain.
🧮 Steps:
1. Take log of image:
z(x, y) = ln f (x, y)
1
H(u, v) = 2n
( D(u,v) )
D0
1+
Where:
n: order of filter
🎯 Interpretation:
Enhances contrast
Normalizes uneven illumination
Useful in medical imaging, remote sensing, face enhancement, etc.
✅ Summary Table
Feature Derivative Filtering Homomorphic Filtering
Let me know if you'd like a visual example or code snippet for either!
Sure! Let's walk through derivative filtering and homomorphic filtering with simple numerical
examples using small grayscale images (3×3 or 5×5). We’ll demonstrate the effect of the filters step by
step.
🔹 1. Derivative Filtering
🔸 A. Sobel Filter (First-order Derivative)
Used for edge detection – detects horizontal or vertical changes in intensity.
0 0 0
−1 0 1
Gx = −2 0 2
−1 0 1
➤ Interpretation:
Since the top and middle rows have strong contrast, edges are detected between them.
The Sobel filter returns 0, indicating no horizontal edge at the center. Vertical edge detection
would show more here.
0 1 0
L = 1 −4 1
0 1 0
0 0 0
(0)(100) + (1)(100) + (0)(100) + (1)(0) + (−4)(0) + (1)(0) + (0)(0) + (1)(0) + (0)(0) = 100
➤ Interpretation:
🔹 2. Homomorphic Filtering
🧠 Recall the model:
f (x, y) = i(x, y) ⋅ r(x, y)
30 50
f (x, y) = [ ]
200 220
We assume:
−1.10 −0.59
Filtered = [ ]
0.80 0.89
🎯 Interpretation:
The dynamic range is compressed, and contrast is enhanced.
Low illumination areas are brightened, and overly bright areas are normalized.
This makes the image visually more balanced.
Homomorphic Uneven lighting image Enhances contrast and removes uneven brightness
Let me know if you want a code-based simulation (Python/Matlab/OpenCV) of these filters as well!
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 1/1