Image Processing 2
Image Processing 2
What is Image enhancement ? Briefly explain about the need and applications of this .
Image Enhancement is the process of improving the visual appearance of an image or converting the
image to a form better suited for analysis by humans or machines. It involves techniques that highlight
certain features, remove noise, or adjust brightness, contrast, and color to make the image more useful
and visually appealing.
1. Improved Visual Quality: To make images more suitable for viewing by adjusting contrast,
brightness, sharpness, etc.
2. Highlight Key Features: Helps in emphasizing important details such as edges, boundaries, and
textures.
3. Noise Reduction: Removes unwanted information (like blur or graininess) that may hinder proper
interpretation.
4. Better Input for Processing: Enhanced images help improve the performance of computer vision,
object detection, or recognition systems.
5. Restoration of Old/Corrupted Images: Helps in reviving images that are faded, blurred, or
damaged.
1. Medical Imaging: Enhances MRI, CT scans, or X-rays to help doctors diagnose diseases more
accurately.
2. Satellite and Aerial Imaging: Enhances land cover, vegetation, or urban structures for better
geographical analysis.
3. Forensics and Surveillance: Improves low-quality CCTV footage for crime investigation.
4. Photography and Media: Enhances photos and videos for aesthetic and commercial purposes.
5. Industrial Inspection: Enhances images from assembly lines for quality control and defect
detection.
6. Scientific Research: Enhances microscopic or astronomical images for detailed analysis.
In summary, image enhancement is crucial for both human interpretation and machine analysis in
various fields where visual information plays a vital role.
Spatial domain techniques operate directly on the pixels of the image. They modify the intensity values
of individual pixels to enhance image features.
Common Techniques:
Contrast Stretching: Improves the contrast of an image by expanding the range of intensity
values.
Histogram Equalization: Redistributes the intensity histogram of the image to improve contrast.
Smoothing (Blurring): Reduces noise using filters like average or Gaussian filters.
Sharpening: Enhances edges using techniques like the Laplacian or Sobel filters.
Unsharp Masking: Subtracts a blurred version of the image from the original to enhance fine
details.
Advantages:
Simple to implement.
Effective for local enhancement.
Limitations:
Frequency domain techniques involve transforming the image into the frequency domain using
mathematical tools like the Fourier Transform. Operations are performed on the frequency
components (rather than pixels), and the result is converted back to the spatial domain.
Common Techniques:
Advantages:
Limitations:
Computationally complex.
Requires transformation and inverse transformation.
Comparison Table:
Aspect Spatial Domain Frequency Domain
Operates on Image pixels Frequency components
Techniques used Filters, Histogram Equalization Fourier Transform, Filtering
Complexity Low to moderate Higher
Suitable for Local features, real-time apps Global features, periodic patterns
Edge/Detail Handling Through masks (e.g., Laplacian) Through high-pass filters
Conclusion:
Both spatial and frequency domain enhancement techniques are valuable. The choice depends on the
application—spatial domain methods are often preferred for simplicity and real-time use, while
frequency domain methods offer deeper control for more complex enhancements.
What is mask
A mask (also known as a filter, kernel, or window) in image processing is a small matrix or grid of
numbers used to perform operations like blurring, sharpening, edge detection, and noise reduction
on an image.
It is applied over the image using a process called convolution, where the mask slides over each pixel
and modifies it based on the values in the surrounding pixels.
css
This mask averages the values of a pixel and its 8 neighbors to reduce noise.
css
[ 0 -1 0 ]
[ -1 4 -1 ]
[ 0 -1 0 ]
Types of Masks:
Conclusion:
A mask is a fundamental tool in image enhancement and processing. It enables localized operations on
an image to improve quality, extract features, or prepare for further analysis.
Convolution is a mathematical operation used in image processing to apply a mask (or filter/kernel)
to an image. It combines the pixel values of the image with the values of a mask to produce a
transformed image—commonly used for blurring, sharpening, edge detection, etc.
Let:
a b
g(x, y) = ∑ ∑ f (x + i, y + j) ⋅ h(i, j)
i=−a j=−b
Where:
a = ⌊ m2 ⌋, b = ⌊ n2 ⌋
The filter is centered on each pixel, and the weighted sum of the neighborhood is computed.
Note: In convolution, the kernel is usually flipped (rotated 180°), while in correlation, it's
used as is.
1 2 1 0 −1 0
f (x, y) = 0 1 0 and the mask (kernel) h(i, j) = −1 5 −1
2 1 2 0 −1 0
To compute g(1, 1), center the mask at position (1,1) and compute:
=0−2+0+0+5+0+0−1+0=2
3. Properties of Convolution:
Linearity: a ∗ f + b ∗ g = a ∗ (f ∗ g) + b ∗ (g ∗ g)
Commutativity: f ∗h=h∗f
Associativity: f ∗ (h ∗ k) = (f ∗ h) ∗ k
Distributivity: f ∗ (h + k) = f ∗ h + f ∗ k
✅ Conclusion:
Convolution is a foundational operation in image processing and computer vision. It uses a mask to
transform an image based on its neighboring pixel values, enabling powerful features like noise
reduction, edge detection, and texture enhancement.
Discuss about basic gray level transformations and their physical significance
Gray level transformations are techniques used to modify the intensity values (gray levels) of an
image. These operations are applied directly to individual pixels to enhance contrast, brightness, or
extract features.
The general form of a gray level transformation is:
s = T (r)
Where:
Transformation:
s=L−1−r
Where L is the maximum gray level (e.g., 255 for 8-bit images).
Physical Significance:
2. Logarithmic Transformation
Transformation:
s = c ⋅ log(1 + r)
Physical Significance:
Transformation:
s = c ⋅ rγ
Where:
c is a constant.
γ (gamma) controls the degree of enhancement.
Physical Significance:
Includes:
a. Contrast Stretching:
5. Thresholding
Transformation:
s={
0 if r < T
L − 1 if r ≥ T
Physical Significance:
📊 Summary Table:
Transformation Type Formula Application/Significance
Log Transformation s = c ⋅ log(1 + r) Enhances dark regions in high dynamic range images
✅ Conclusion:
Gray level transformations are fundamental techniques in image enhancement. They are essential for
adjusting contrast and brightness, highlighting specific features, and preparing images for further
processing or analysis. Each transformation serves a unique purpose depending on the nature of the
image and the desired enhancement.
Piecewise Linear Transformations are a set of gray level transformations that are defined by multiple
linear segments. Instead of a single equation, the transformation function is defined in pieces, each
acting over a range of input intensity levels.
These transformations are useful in applications where specific intensity ranges need to be enhanced or
suppressed.
🧮 Mathematical Preliminaries
The general form of a piecewise linear transformation is:
T2 (r), r2 ≤ r < r3
s = T (r) = ⎨
⋮ ⋮
⎩
Tn (r), rn ≤ r ≤ rn+1
Where:
⎧0, r < r1
T (r) = ⎨ r −r ⋅ (r − r1 ) + s1 , r1 ≤ r ≤ r2
s2 −s1
⎩ 2 1
L − 1, r > r2
Where:
2. Gray-Level Slicing
a. With background
T (r) = {
L − 1, A ≤ r ≤ B
otherwise
r,
b. Without background
T (r) = {
L − 1, A ≤ r ≤ B
0, otherwise
Significance:
Not a transformation but a method of separating image based on binary representation of pixel
values.
Helps analyze which bits contribute most to image detail.
📉 Visual Representation:
In a graph of s = T (r), piecewise linear transformations look like connected line segments — forming a
broken line that maps ranges of input intensities to output intensities linearly.
✅ Conclusion:
Piecewise linear transformations provide flexibility in modifying specific intensity ranges of an image.
They are widely used in contrast enhancement, feature highlighting, and image segmentation.
Their simplicity and effectiveness make them essential tools in image enhancement workflows.
Thresholding is a simple yet powerful image segmentation technique used to convert a grayscale
image into a binary image. It works by selecting a threshold value and comparing each pixel’s intensity
to that threshold.
🔢 Basic Concept:
Given a threshold value T , the transformation is defined as:
g(x, y) = {
1 if f (x, y) ≥ T
0 if f (x, y) < T
Where:
✅ Types of Thresholding:
1. Global Thresholding:
3. Otsu’s Method:
An automatic method that finds the optimal threshold by minimizing intra-class variance.
No need to manually choose a threshold.
🎯 Applications of Thresholding:
Object detection and extraction
Optical Character Recognition (OCR)
Medical imaging (e.g., detecting tumors)
Document scanning and binarization
Traffic and motion analysis in videos
📌 Advantages:
Simple and fast
Useful for isolating objects from background
⚠️ Limitations:
Global thresholding may fail under uneven lighting
Sensitive to noise
May not perform well with complex backgrounds
🧠 Conclusion:
Thresholding is a foundational technique in image processing used to simplify an image by separating
objects from the background. Its simplicity makes it a preferred method for many real-time and
preprocessing tasks in computer vision.
Discuss briefly about histogram equilization with mathematical prelims and physical significance .
Explain with an example
📐 Mathematical Preliminaries
Let:
rk : gray level k
k
sk = T (rk ) = (L − 1) ∑ pr (rj )
j=0
Where:
✨ Physical Significance
Enhances contrast by stretching the dynamic range of gray levels.
Makes dark areas brighter and bright areas darker, depending on histogram shape.
Especially effective for images that are too dark, too bright, or have low contrast.
📷 Example
Suppose we have an image with 8 gray levels (0 to 7) and the histogram:
0 0
1 2
2 3
3 3
4 2
5 2
6 1
7 1
Total pixels N = 14
nk
1. Calculate probability pr (rk ) =
14
k
2. Compute cumulative distribution CDFk = ∑j=0 pr (rj )
sk = round((L − 1) ⋅ CDFk )
This will remap the original intensities to new ones with a more uniform histogram, improving contrast.
📈 Result
After histogram equalization:
✅ Conclusion
Histogram Equalization is a key technique in image enhancement, especially useful for improving the
visibility of features in low-contrast images. It works by transforming the intensity values based on their
cumulative distribution to achieve a more uniform histogram.
Discuss briefly about frequency domain image enhancement . Describe the transformations related
this with mathematical prelims
⚙️ Mathematical Preliminaries
1. Fourier Transform (FT)
An image f (x, y) is converted to the frequency domain using the 2D Discrete Fourier Transform
(DFT):
M −1 N −1
F (u, v) = ∑ ∑ f (x, y) ⋅ e−j2π( M + N )
ux vy
x=0 y=0
M −1 N −1
1
∑ ∑ F (u, v) ⋅ ej2π( M + N )
ux vy
f (x, y) =
MN u=0 v=0
🔁 Enhancement Process:
1. Convert image to frequency domain using DFT.
2. Apply a frequency domain filter.
3. Transform back to spatial domain using inverse DFT.
Purpose: Smooths the image by removing high-frequency (sharp) details and noise.
Effect: Blurs edges and reduces noise.
Mathematically: Retains values near the origin of F (u, v); attenuates others.
3. Band-Pass Filter:
✅ Conclusion
Frequency domain enhancement techniques are powerful for modifying the frequency content of
images to highlight features or remove noise. By applying filters like low-pass, high-pass, and band-pass
in the Fourier domain, one can selectively manipulate image details that are difficult to handle in the
spatial domain.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 1/1