0% found this document useful (0 votes)
21 views39 pages

Digital Image Processing

The document discusses digital image processing, focusing on the fundamental concepts of light, the electromagnetic spectrum, image sensing, and acquisition. It explains the processes of sampling and quantization, relationships between pixels, linear and nonlinear operations, and various image enhancement techniques in the spatial domain. Additionally, it covers histogram processing methods to improve image quality and contrast.

Uploaded by

mr.arumugaraja
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)
21 views39 pages

Digital Image Processing

The document discusses digital image processing, focusing on the fundamental concepts of light, the electromagnetic spectrum, image sensing, and acquisition. It explains the processes of sampling and quantization, relationships between pixels, linear and nonlinear operations, and various image enhancement techniques in the spatial domain. Additionally, it covers histogram processing methods to improve image quality and contrast.

Uploaded by

mr.arumugaraja
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/ 39

DIGITAL IMAGE PROCESSING

UNIT-I
LIGHT AND THE ELECTROMAGNETIC SPECTRUM IN DIP:
In digital image processing, light and the electromagnetic spectrum are fundamental
because digital images are formed by capturing and digitizing electromagnetic radiation
from various parts of the spectrum, not just visible light. This includes radio waves for
radar and MRI, infrared for thermal imaging, and X-rays for medical and security scans,
which are then converted into digital data by sensors like Charge-Coupled Devices
(CCDs).
The electromagnetic spectrum and image acquisition
 The spectrum:
The electromagnetic spectrum is the full range of electromagnetic radiation, from low-
energy radio waves to high-energy gamma rays. Visible light is just a narrow portion of
this spectrum, between about 390 and 700 nanometers.
 Image formation:
Digital images can be acquired from any part of this spectrum. Different wavelengths are
used for different applications:
 Visible light: Used for everyday photography.
 Infrared: Used for thermal imaging and night vision.
 X-rays: Used in medicine for bone imaging and in security to scan luggage.
 Radio waves: Used for radar imaging and Magnetic Resonance Imaging (MRI).
 Sensor function:
Digital sensors, such as CCDs, detect this electromagnetic energy. They measure the
intensity of the radiation at various points and convert this information into a numerical
format. This process involves two key steps:
 Sampling: Dividing the image into a grid of pixels.
 Quantization: Assigning a specific intensity value (e.g., a number from 0-255) to each
pixel.
Key concepts
 Wavelength, frequency, and energy:
These are inversely related. Higher frequencies and shorter wavelengths correspond to
higher energy photons.
 Photons:
Electromagnetic radiation is composed of photons, or massless particles, that carry
energy.
 Color perception:
In digital images, color is created by representing the intensity of different wavelengths
of visible light.

IMAGE SENSING AND ACQUISITION:-


Image sensing and acquisition is the initial step in digital image processing that captures
an image by using an energy source to illuminate a scene and a sensor to convert the
reflected or transmitted energy into an electrical signal. The process involves an
illumination source (like a light or X-ray), a sensing device (such as a single sensor, line
sensor, or 2D array), and a digitizer to convert the analog electrical signal into a digital
image format.
Key components and steps
 Illumination source:
Provides the energy to be reflected or transmitted by the object being imaged. Sources
can include visible light, X-rays, radar, or infrared.
 Sensor:
Captures the energy reflected or transmitted from the object. The energy is converted into
a proportional electrical signal (e.g., voltage).
 Single sensor: Captures an image by scanning the scene in two directions (e.g., an older
method in some scanners).
 Line sensor: Uses a single line of sensors. The second dimension of the image is
obtained by moving the sensor or the object perpendicular to the line (e.g., flatbed
scanners).
 Sensor array: A 2D array of sensors that captures an entire image at once, without
relative motion between the sensor and the scene (e.g., digital cameras).
 Digitizer:
Converts the analog electrical signal from the sensor into a digital format through a
process of sampling and quantization.
 Sampling: Discretizes the spatial coordinates of the image.
 Quantization: Discretizes the amplitude values of the image.
Example process
1. An illumination source shines energy onto an object.
2. The object reflects or transmits the energy.
3. A lens focuses this energy onto a sensor (or an array of sensors).
4. The sensor converts the energy into an electrical signal.
5. The digitizer converts the continuous analog signal into a discrete digital image by
sampling its spatial coordinates and quantizing its intensity values.
6. The result is a digital image represented as a 2D array of pixels (picture elements).
IMAGE SAMPLING AND QUANTIZATION:

Sampling and quantization are two fundamental steps in converting an analog image
into a digital one. Sampling digitizes the spatial coordinates (𝑥,𝑦) by taking
measurements at discrete points, creating a grid of pixels and determining the image's
spatial resolution. Quantization digitizes the amplitude (intensity) of each sample by
assigning it to one of a finite number of discrete intensity levels, determining the image's
color or gray-level resolution.
Sampling

 What it is:

Sampling discretizes the coordinate values of a continuous image, effectively


dividing the image into a grid of equally spaced samples (pixels).

 What it affects:

It determines the spatial resolution of the digital image. A higher number of


samples results in a higher resolution and a more detailed image.

 Analogy:

Think of sampling as deciding where to take a snapshot of a continuous scene.


Each snapshot is a sample, and the number of snapshots you take in a given area
determines how much detail you capture.

Quantization

 What it is:

Quantization discretizes the amplitude (intensity) values of the samples obtained


during the sampling process.

 What it affects:

It determines the number of possible intensity levels (e.g., shades of gray or


colors) each pixel can have.

 Analogy:
After taking snapshots (sampling), quantization is like assigning a specific,
predefined color to each snapshot. If you have only two colors (black and white),
you have low quantization. With more colors or shades of gray, you have higher
quantization and a more accurate representation of the original scene.

The relationship between sampling and quantization

 Order:

Sampling is always performed before quantization. You must first have samples
(pixels) before you can assign a discrete intensity value to them.

 Interdependence:

Both processes are essential for creating a digital image. Sampling provides the
"where" (the grid of pixels), and quantization provides the "what" (the
color/intensity of each pixel).

 Result:

The combination of sampling and quantization creates the digital image, which is
a 2D array of pixels, each with a specific numeric value representing its intensity.

SOME BASIC RELATIONSHIP BETWEEN PIXELS:

In digital image processing, pixels have several fundamental


relationships: neighbors, adjacency, and connectivity. Pixels are considered neighbors
based on their spatial proximity, with 4-neighbors being directly above, below, left,
and right, and 8-neighbors including the diagonal pixels. Adjacency refers to whether
two pixels are considered neighbors based on a specific criterion (e.g., 4-adjacency, 8-
adjacency), while connectivity describes the existence of a path between two pixels
through a series of adjacent pixels.
1. Neighbors:
 4-Neighbors:
A pixel's 4-neighbors are its immediate horizontal and vertical neighbors. If a pixel
is at coordinates (x, y), its 4-neighbors are at (x+1, y), (x-1, y), (x, y+1), and (x, y-
1).
 8-Neighbors:
A pixel's 8-neighbors include its 4-neighbors plus its four diagonal neighbors. These
are at (x+1, y+1), (x+1, y-1), (x-1, y+1), and (x-1, y-1).
2. Adjacency:
 4-Adjacency:
Two pixels are 4-adjacent if they are 4-neighbors and share a specified intensity
value (from a set V).
 8-Adjacency:
Two pixels are 8-adjacent if they are 8-neighbors and share a specified intensity
value (from a set V).
 Mixed Adjacency (m-adjacency):
Mixed adjacency is a modification of 8-adjacency designed to eliminate certain
ambiguities in path tracing.
3. Connectivity:
 Connectivity:
Two pixels are connected if there exists a path between them consisting of adjacent
pixels with specified intensity values.
 Paths:
A path between two pixels is a sequence of adjacent pixels, where each pixel is
adjacent to the next according to the chosen adjacency type (4, 8, or m).
 Regions:
A region in an image is a connected set of pixels, where all pixels within the region
are connected according to a chosen adjacency and connectivity criteria.
4. Distance:
 Euclidean Distance: The straight-line distance between two pixels.
 City-Block Distance (D4): The sum of the absolute differences of their coordinates,
equivalent to the number of 4-neighbor steps.
 Chessboard Distance (D8): The maximum of the absolute differences of their
coordinates, equivalent to the number of 8-neighbor steps.

LINEAR AND NONLINEAR OPERATIONS:

In Digital Image Processing (DIP), linear operations involve


transformations where the output pixel value is a linear combination of the input pixel
values. Nonlinear operations, on the other hand, use non-linear mathematical
functions to process image data.
Linear Operations:
 Definition:
Linear operations in DIP are those that satisfy the properties of superposition and
homogeneity. This means that the output of a linear operation on a sum of inputs is
the same as the sum of the outputs of the operation on each individual input
(superposition), and scaling the input scales the output proportionally
(homogeneity).
Examples:
 Arithmetic Operations: Addition, subtraction, multiplication, and division of pixel values by
a constant.
 Characteristics:
 Easily modeled and implemented.
 Good for noise reduction, feature extraction, and image enhancement when the noise
is relatively simple (e.g., Gaussian noise).
 May not be suitable for all types of noise or complex image structures.
Nonlinear Operations:
 Definition:
Nonlinear operations in DIP do not satisfy the properties of superposition and
homogeneity. This means that the output of a nonlinear operation on a sum of inputs
is not necessarily the same as the sum of the outputs of the operation on each
individual input, and scaling the input may not result in a proportional scaling of the
output.
 Examples:
Median Filter: Replacing each pixel's value with the median value of its
neighboring pixels.
Characteristics:
 Can be more complex to implement and model than linear operations.
 Effective in removing impulsive (salt and pepper) noise and preserving sharp edges.
 Useful for tasks like image segmentation, feature extraction, and noise reduction when linear
methods are not sufficient.
UNIT-II
IMAGE ENHANCEMENT IN SPATIAL DOMAIN BACKGROUND:-

Image enhancement in the spatial domain refers to techniques that directly


manipulate the pixel values of an image to improve its visual quality or highlight specific
features. The "spatial domain" simply means working with the image pixels directly in
their original spatial arrangement, as opposed to the "frequency domain" which involves
transforming the image into its frequency components.
Background and Key Concepts:
 Direct Pixel Manipulation:
Spatial domain methods operate directly on the individual pixels of an
image. This can involve changing the intensity value of a single pixel based on a
predefined transformation function (point processing) or considering the values of
neighboring pixels (neighborhood processing).
 Point Processing:
In point processing, the output pixel value at a given location depends only on the
input pixel value at that same location. Examples include:
 Contrast Adjustment: Stretching or compressing the range of pixel intensities to
enhance contrast.
 Histogram Equalization: Redistributing pixel intensities to achieve a more uniform
histogram, thereby improving overall contrast, especially in images with limited
dynamic range.
 Gamma Correction: Adjusting the brightness and contrast by applying a power-law
transformation to pixel values.
 Neighborhood Processing (Spatial Filtering):
In neighborhood processing, the output pixel value depends on the values of pixels in
a defined neighborhood around the current pixel. This is typically achieved using
spatial filters (masks or kernels) that are convolved with the image. Examples include:
 Noise Reduction: Smoothing filters like averaging filters or median filters are used to
reduce noise by averaging or taking the median of pixel values within a neighborhood.
 Edge Enhancement/Sharpening: Sharpening filters like Laplacian filters or unsharp
masking enhance edges by emphasizing high-frequency components (abrupt changes in
intensity).
Advantages and Disadvantages:
 Advantages:
Spatial domain methods are generally intuitive, computationally less complex than
frequency domain methods for many operations, and easier to implement for localized
enhancements.
 Disadvantages:
Some operations, like certain types of filtering, can be computationally intensive
compared to their frequency domain counterparts, especially for large images. Global
enhancements might not always be optimal for all regions of an image.

Basic gray level transformations:-

Basic gray level transformations in digital image processing involve modifying


the pixel intensities of an image to enhance its appearance or extract specific
information. These transformations are applied using a mapping function that alters
the gray level of each pixel based on its original value. Common types include linear,
logarithmic, and power-law transformations.

Here's a breakdown of the key types:

 Linear Transformations:
These transformations involve a linear mapping of input gray levels to output gray
levels.
 Identity Transformation: The simplest form where the output gray level is
identical to the input gray level, resulting in no change to the image.
 Negative Transformation: Inverts the gray levels by subtracting each pixel value
from the maximum possible value (L-1, where L is the number of gray levels). This
is useful for enhancing details in dark regions.
Logarithmic Transformations:
These transformations map a narrow range of input values to a wider range of output
values.
 Log Transformation: The formula is s = c * log(1 + r), where 'r' is the input pixel
value, 's' is the output pixel value, and 'c' is a constant. This transformation is used to
expand the values of darker pixels and compress the values of brighter pixels.

 Inverse Log Transformation: The inverse of the log transformation, which


compresses darker values and expands brighter ones.
Power-Law (Gamma) Transformations:
The power law (or gamma) transformation is of the form:
s = T(r) = c * r^γ
where, c, γ are constants; c, γ > 0
Gamma Correction:
Generally, the response of image acquiring, printing or displaying image is affected
by power law. The cathode ray tube (CRT) has intensity to voltage response which
is a power function with γ = 1.8 to 2.5. The process used to correct them is called
gamma correction, also known as gamma encoding.

In essence, gray level transformations are a fundamental tool in image processing for:

 Contrast enhancement: Adjusting the dynamic range of pixel intensities to improve


visibility.
 Image normalization: Standardizing the range of pixel values to a specific range.
 Detail enhancement: Highlighting specific features or regions within an image.
 Noise reduction: Minimizing the impact of noise on the image by manipulating pixel
values.
Types of Image Enhancement Methods
Advantages and Disadvantages
Advantages
 It makes light and dark areas more distinct in an image.
 Helps to see details more clearly.
 Makes it easier to interpret and analyze images.
Disadvantages
 May amplify unwanted elements like noise or artifacts.
 Adjustments can be subjective, leading to inconsistent outcomes

HISTOGRAM PROCESSING:

Histogram processing is a set of techniques in image processing that manipulate


an image's histogram to improve its visual appearance or prepare it for further
analysis. This involves analyzing and modifying the distribution of pixel intensities to
enhance contrast, brightness, or other desired characteristics.

1. Understanding Histograms:

 A histogram is a graphical representation of the distribution of pixel intensities in an


image.
 It shows the frequency of each intensity level, revealing the image's overall tonal
characteristics.
 For example, a histogram with a narrow peak indicates low contrast, while a wide, flat
histogram suggests high contrast.
2. Histogram Processing Techniques:

 Histogram Equalization:
This technique redistributes the pixel intensities to create a more uniform
distribution, effectively enhancing the contrast of the image.
 Histogram Matching (or Specification):
This method transforms the histogram of one image to resemble the histogram of
another, allowing for specific contrast or tonal characteristics to be transferred.
 Local Histogram Processing:
This involves applying histogram processing to smaller regions or blocks of the
image, which can be useful for enhancing details in specific areas.

 Contrast Enhancement: Improves the visibility of details by spreading out the pixel
intensities.
 Brightness Adjustment: Can be used to increase or decrease the overall brightness of
an image.
 Image Preprocessing: Prepares images for further analysis, such as feature extraction
in computer vision or medical image analysis.
 Improved Visual Quality: Makes images more pleasing to the eye and easier to
interpret.
4. Examples of Applications:

 Medical Imaging: Enhancing the visibility of subtle features in X-rays, MRIs, or CT


scans.
 Remote Sensing: Improving the interpretability of satellite imagery.
 Security and Surveillance: Enhancing low-light images for better identification.
 Digital Photography: Adjusting the contrast and brightness of photos.
5. Key Concepts:

 Intensity Transformation: Applying a mathematical function to modify pixel


values.
 Cumulative Distribution Function (CDF): Used in histogram equalization to map
pixel intensities.
 Probability Density Function (PDF): Used in histogram matching to define the
desired intensity distribution.
ENHANCEMENT USING ARITHMETIC/LOGIC OPERATIONS:
In digital image processing refers to improving an images visual quality or
emphasizing certain features by applying pixel based mathematical and logical
operations.

Arthimetic operations

Performed between corresponding pixels of one or more images or between an


image and a constant.
 Addition-Brightens the image(increase pixel values).
 Subtraction –Highlights differences(useful for change detection)
 Multiplication-scales brightness or contrast.
 Division- Normalizes pixel intensities.

Logical Operations:
 AND-Keeps only overlapping parts of two images/masks.
 OR-Combines features from both images.
 NOT-inverts pixel values (useful for negative images).
 XOR-Hightlights differences in binary images,.

Applications:
 Removing or adding specific regions using masks.
 Highlighting changes between two images.
 Combining images for overlays.
 Brightness/contrast adjustments.

BASIC OF SPATIAL FILTERING


Spatial filtering is a fundamental technique in image processing
that manipulates pixel values based on their spatial relationships to enhance or modify
an image. It involves applying a filter, often represented as a small matrix called
a kernel or mask, to the image. This kernel slides across the image, and at each
position, a mathematical operation (like averaging or weighted averaging) is
performed on the pixels under the kernel, producing a new value for the center pixel.

Here's a breakdown of the fundamental concepts:

1. Image as a Grid of Pixels: An image is essentially a grid of pixels, each with a


specific intensity value.

2. Spatial Domain: Spatial filtering operates directly on these pixel values in the
spatial domain, meaning it works with the image's physical structure.

3. The Filter (Kernel/Mask): A spatial filter is a small matrix (e.g., 3x3, 5x5) that
defines the neighborhood of pixels to be considered and the operation to be
performed.

4. Sliding the Filter: The filter is moved across the image, one pixel at a time,
applying the defined operation at each location.

5. Creating a New Image: The output of the filtering operation replaces the original
pixel value, resulting in a new, filtered image.

Types of Spatial Filters:

 Linear Spatial Filters:


These filters apply linear operations, like convolution or correlation, to the pixel
values within the kernel. Common examples include:
 Averaging filters: Smooths the image by replacing each pixel with the average of
its neighbors.
 Gaussian filters: Similar to averaging filters but uses a Gaussian distribution for
weighting the neighbors, providing smoother results.
 Sharpening filters: Enhance edges and details by emphasizing differences between
neighboring pixels.
Non-linear Spatial Filters:
These filters use non-linear operations, such as median filtering or order statistics
filtering, which are particularly useful for noise reduction.

 Median filters: Replace each pixel with the median value of its neighbors, effective
at removing salt-and-pepper noise while preserving edges.
Applications:

Spatial filtering has a wide range of applications, including:

 Noise reduction: Smoothing filters can effectively reduce random noise in images.
 Edge detection: Sharpening filters can highlight edges and boundaries in an image.
 Image enhancement: Spatial filtering can improve the overall appearance of an
image by adjusting its contrast, sharpness, or other visual characteristics.
 Feature extraction: Specific spatial filters can be designed to extract particular
features from an image, such as textures or patterns.

SMOOTHING SPATIAL FILTERS:

Smoothing spatial filters, also known as low-pass filters, are used in image
processing to reduce noise and blur images. They work by averaging the pixel values
in a neighborhood, effectively reducing sharp transitions in intensity that characterize
noise and fine details.

Characteristics:
 Noise Reduction:
Smoothing filters are highly effective in removing random noise, which often
appears as sharp, high-frequency variations in pixel values.
 Blurring:
By averaging pixel values, these filters reduce the sharpness of edges and fine
details, leading to a blurring effect.
 Low-Pass Filtering:
Smoothing filters allow low-frequency components (representing gradual changes in
intensity) to pass through while attenuating high-frequency components
(representing sharp transitions).
Types of Smoothing Filters:
1. 1. Linear Filters:
These filters perform a weighted average of pixel values within a
neighborhood. Common examples include:
 Mean/Box Filter: A simple averaging filter where each pixel in the neighborhood is
given equal weight.
 Weighted Average Filter: Assigns different weights to pixels in the neighborhood,
often giving more weight to the central pixel.
 Gaussian Filter: Uses a Gaussian function to define the weights, resulting in a
smoother blurring effect.
2. Non-linear Filters:
These filters do not rely on simple averaging. Examples include:
 Median Filter: Replaces each pixel with the median value of the pixels in its
neighborhood. This is particularly effective at removing salt-and-pepper noise.
 Max/Min Filters: Replace each pixel with the maximum or minimum value in its
neighborhood.
Applications:
 Noise Reduction:
Smoothing filters are widely used to remove noise from images before further
processing or analysis.
 Preprocessing for Object Extraction:
Blurring can simplify image analysis by removing fine details and making it easier
to identify larger objects.
 Edge Smoothing:
Smoothing filters can reduce the jaggedness of edges, making them appear
smoother.
 Anti-aliasing:
Smoothing is used in resampling to reduce aliasing artifacts, which can occur when
an image is scaled down.

SHARPENING SPATIAL FILTERS:


Sharpening spatial filters are used in image processing to enhance fine details and edges,
effectively counteracting blurring introduced by image acquisition or processing

How Sharpening Filters Work:

 Differentiation:
Sharpening filters utilize derivative operators (first and second order) to identify and amplify
differences in pixel intensities.
 Edge Enhancement:
By accentuating these intensity differences, sharpening filters make edges and boundaries
appear more prominent, improving image clarity.
 Inversion of Smoothing:
Since smoothing filters (like averaging filters) perform integration, sharpening filters, which
are based on differentiation, essentially reverse this process.
Types of Sharpening Filters:

 Derivative Filters:
These filters, such as the Sobel operator, are used to calculate image gradients, highlighting
edges and other discontinuities.
 High-boost Filtering:
This technique amplifies the high-frequency components of an image, further enhancing detail
and sharpness.

Applications:

Sharpening filters find applications in various fields, including:

 Electronic Printing: Improving the visual quality of printed images.


 Medical Imaging: Enhancing the visibility of subtle details in medical scans.
 Industrial Inspection: Detecting defects and imperfections in manufactured products.
 Autonomous Guidance Systems: Improving image clarity for machine vision applications.

COMBINING SPATIAL IMAGE ENHANCEMENT METHODS :


Combining spatial image enhancement methods involves applying multiple
complementary techniques to an image to improve specific aspects, such as reducing noise
while preserving edges, or increasing contrast and detail simultaneously. This often requires a
multi-step process, such as using a smoothing filter to reduce noise, followed by a sharpening
filter like a Laplacian filter to enhance edges and details, and perhaps a contrast stretching
method to improve overall brightness.

Steps for combining spatial enhancement methods

1. Analyze the image and identify goals: Determine the primary issues with the image (e.g.,
noise, low contrast, blurry edges) and what improvements are needed.
2. Select complementary techniques: Choose methods that address the identified issues and
can be applied sequentially.
 Noise Reduction: Apply a smoothing filter like an averaging or median filter to reduce noise.
 Edge Enhancement: Use a sharpening filter like the Laplacian to highlight edges and fine
details, often applied after noise reduction.
 Contrast Adjustment: Employ techniques like histogram equalization or power-law
transformations to improve the overall contrast.
 Gradient Enhancement: Use filters like Sobel or Prewitt to enhance edges.
3. Apply methods sequentially: Process the image with one technique, then use the result as
the input for the next technique in the sequence.
4. Iterate and refine: Evaluate the result and repeat steps to further refine the image if the initial
combination is not satisfactory.
Examples of combined methods
 Denoising + Sharpening:
o Apply a median or averaging filter to reduce noise.

o Apply a Laplacian or Unsharp mask filter to sharpen the image.

 Edge and Detail Enhancement + Contrast Improvement:


o Use a Sobel or Laplacian filter to detect and enhance edges.

o Apply a power-law or logarithmic transformation to increase the dynamic range and contrast of
the image.

 Non-linear Combination:
o Use a bilateral filter, which combines spatial and intensity information to smooth images while
preserving edges.

UNIT-III

1.A MODEL OF THE IMAGE DEGRADATION RESTORATION PROCESS

Image degradation and restoration involves modeling the processes that corrupt an
image and then reversing those processes to recover the original, pristine image. The
degradation process is often modeled as a combination of a degradation function (like
blurring or geometric distortion) and additive noise. Image restoration aims to
estimate the original image by inverting the degradation and noise effects.

Here's a more detailed breakdown:

1. Degradation Model:

 Degradation Function (H):


This represents blurring, geometric distortions, or other transformations that alter the
image's visual quality.
 Noise (η(x,y)):
This includes random variations in pixel values, often due to the image acquisition
process (e.g., sensor noise, quantization noise).
 Degraded Image (g(x,y)):
The resulting image after the degradation function and noise are applied to the
original image (f(x,y)).
 Spatial Domain:
The degradation process in the spatial domain is often expressed as a convolution of
the original image with the degradation function, plus additive noise: g(x,y) = h(x,y)
* f(x,y) + η(x,y).
 Frequency Domain:
In the frequency domain, this convolution becomes a multiplication: G(u,v) = H(u,v)
* F(u,v) + N(u,v).

2. Restoration Process:

 Inverse Process:
The restoration process aims to reverse the effects of the degradation function and
noise to recover an estimate of the original image, denoted as f̂(x,y).
 Knowledge of Degradation:
Restoration relies on having some knowledge about the degradation function and
noise characteristics.
 Techniques:
Various techniques are used for restoration, including inverse filtering, Wiener
filtering, and other methods that attempt to estimate and compensate for the
degradation and noise.

3. Examples:

 Blurring:
If the degradation function is a blurring filter, the restoration process would involve
applying a deblurring filter.
 Noise Reduction:
If the degradation is primarily due to noise, restoration would involve noise
reduction techniques.
2.NOISE MODELS:
A noise model in digital image processing describes the statistical distribution of
unwanted variations (noise) in an image

 Statistical Description:
Noise models use probability distributions (like Gaussian, Poisson, or uniform) to characterize the
random variations in pixel intensities.
 Noise Types:
Common noise types include:
 Gaussian noise: A normal distribution, often appearing as a bell-shaped curve in histograms.
 Impulse noise (Salt and Pepper): Randomly scattered bright (salt) and dark (pepper) pixels.
 Uniform noise: Values are uniformly distributed within a certain range.
 Rayleigh noise: Often found in radar images.
 Exponential noise: Can arise in various applications.
Additive vs. Multiplicative Noise:
Noise can be added to the original signal (additive) or multiplied with it (multiplicative).
Impact on Images:
Noise can degrade image quality, introducing artifacts, blurring details, and obscuring important
features.
Noise Removal:
By understanding the noise model, appropriate filtering techniques (e.g., Gaussian filter for Gaussian
noise, median filter for impulse noise) can be applied to reduce noise and improve image quality.
3. RESTORATION IS THE PROCESS OF NOISE ONLY:
Image restoration, specifically in the context of noise, aims to recover the original, "clean" image
from a degraded version that contains unwanted variations in intensity, known as noise

 Image Degradation:
Images can be degraded by various factors, including noise, blurring, and geometric distortions. In
some cases, the only form of degradation is noise.
 Noise:
Noise is unwanted variations in pixel intensities that obscure the true image content. It can arise from
various sources, such as sensor imperfections, transmission errors, or environmental factors.
 Spatial Filtering:
When noise is the primary degradation, spatial filtering techniques are often used. These methods
involve applying a filter mask to the image, averaging or modifying pixel values within a neighborhood
to reduce the noise effect.
 Restoration vs. Denoising:
While often used interchangeably, "restoration" in the context of noise implies bringing the image back
to its presumed original state, whereas "denoising" might simply aim to reduce noise without specific
regard for the original image.
 Example Techniques:
Mean filters (like arithmetic mean filters) are common examples. These filters replace each pixel with
the average value of its neighboring pixels within a defined window. Other techniques include median
filters, which replace each pixel with the median value of its neighbors, and alpha-trimmed mean
filters, which discard a certain number of extreme pixel values before averaging.
 Frequency Domain:
In some cases, noise characteristics (e.g., periodic noise) can be better addressed in the frequency
domain using Fourier transforms, but spatial filtering is often the primary approach when noise is the
only degradation.

4.SPATIAL FILTERING:
Spatial filtering is a digital image processing technique that modifies pixel values by applying a
filter mask to a pixel and its neighbors to perform operations like smoothing, sharpening, or
edge detection. The mask, also called a kernel, slides across the image, and at each position, a
predefined calculation is performed to determine the new value of the center pixel. Spatial
filtering is broadly classified into linear filters (like average and weighted average filters)
and non-linear filters (like median filters).

How it works

 Filter mask: A small matrix of weights is used as the filter, sliding across the image.
 Neighborhood operation: At each pixel, a calculation is performed using the values of the
pixels under the mask.
 Pixel replacement: The result of this calculation becomes the new value for the center pixel of
the mask's current position.
Types of spatial filters

 Linear filters:
The new pixel value is a weighted sum of the original pixel values within the neighborhood.
 Smoothing (low-pass): Filters like the mean or box filter average pixel values to reduce noise
and blur the image.
 Sharpening (high-pass): Filters that use differentiation to highlight edges and details by
emphasizing high frequencies.
 Non-linear filters:
The new pixel value is determined by a non-linear function of the pixel values in the
neighborhood.

 Median filter: Replaces the center pixel with the median value of its neighbors, which is very
effective at reducing salt-and-pepper noise while preserving edges.
Applications

 Noise reduction:
Smoothing filters like the mean and median filters are used to reduce unwanted noise in an
image.
 Image sharpening:
Filters are used to enhance edges and details, making the image appear sharper.
 Edge detection:
Filters that approximate derivatives are used to find the locations of edges and sharp changes in
intensity.
5.PERIODIC NOISE REDUCTION BY FREQUENCY DOMAIN FILTERING:
Periodic noise is reduced in digital image processing by filtering it out in the frequency
domain, which is done by applying the Discrete Fourier Transform (DFT) to convert the
image, filtering the noise in the frequency domain, and then applying the inverse Discrete
Fourier Transform (IDFT) to convert back to the spatial domain. Periodic noise appears
as distinct spikes or peaks in the frequency domain, so filters like notch and band reject
are used to specifically remove these frequency components.

Steps for periodic noise reduction

1. Transform to frequency domain:


Convert the image from the spatial domain to the frequency domain using the Discrete
Fourier Transform (DFT).
2. Identify noise:
Analyze the frequency spectrum to identify the locations of the periodic noise, which will
appear as bright spikes or impulses, often symmetrically around the origin.
3. Apply a frequency domain filter:
Use a filter to eliminate the noise frequencies while preserving the rest of the image
information. Common filters include:
 Notch filters: These reject frequencies within a specific, narrow neighborhood around a
center frequency. They are ideal for isolating and removing single, sharp noise spikes,
notes OpenCV.
 Band reject filters: These are designed to reject or "notch out" a wider band of
frequencies. They are useful for broader or less distinct periodic noise patterns,
explains this YouTube video.
 Band pass filters: These are the opposite of band reject filters, allowing only a specific
band of frequencies to pass through.

4. Transform back to spatial domain:


Apply the inverse Discrete Fourier Transform (IDFT) to the filtered frequency spectrum
to obtain the denoised image in the spatial domain.
Linear, portion:-
In digital image processing, a "linear portion" refers to a process where the output pixel values have a

linear relationship with the input pixel values, often achieved through methods like convolution or
piecewise linear transformations. This allows for operations such as image filtering (sharpening, noise
reduction) and contrast stretching, where a change in one part of the image's intensity range is applied
consistently across the entire image or in specific defined segments.

Key concepts

 Linear transformation: A transformation where the output pixel values are a linear combination
of the input values. This can be represented by the equation

 Convolution: A common linear operation where an image is filtered by applying a kernel (a small
matrix) across each pixel. The result is a new image where each pixel's value is a weighted sum
of its neighbors, as defined by the kernel. This is the basis for many filters, including those that
sharpen images or reduce noise.

 Piecewise linear transformation: A type of transformation that is linear in different segments or


"pieces" of the input image's intensity range.
o Contrast stretching: A common example that stretches the range of intensity values in
an image to span the full display range. Low-intensity values are mapped to near-black,
high-intensity values to near-white, and all other values are mapped linearly in between,
making details that were previously obscure more visible.
o Gray level slicing: Isolates a specific range of intensity values, setting values within the
range to a constant (often white) and others to a different constant (often black).
 Linear Position Invariant (LTI) systems: A class of linear systems where the same linear
operation is applied to every pixel, regardless of its position. This is a core assumption for many
image processing operations like convolution, where the filter is the same across the image.

Applications

 Image enhancement: Used for improving the visual quality of an image, such as sharpening
edges, enhancing contrast, or reducing noise.
 Image restoration: Correcting degradations like blur caused by motion or an unfocused lens.
 Feature extraction: Used to find and emphasize linear features like roads, canals, or geological
lineaments in satellite or aerial imagery.
INVARIANT DEGRADATIONS:

Invariant degradations in digital image processing refer to situations where the


degradation affecting an image is linear and position-invariant. This means the
degradation process can be modeled as a convolution with a specific function
(the point spread function or PSF) and is not dependent on the location within the
image. These degradations are often accompanied by additive noise.

Key Concepts:

 Linearity:
A linear system satisfies two properties: homogeneity (multiplying the input by a
constant also multiplies the output by that constant) and additivity (the output of the
sum of inputs is the sum of the individual outputs).
 Position Invariance:
The degradation effect is the same regardless of where it occurs in the image. This
means the point spread function (PSF) is constant across the image.
 Degradation Function:
This function, often represented as h(x, y), describes how the image is degraded. In
linear, position-invariant systems, this function is the PSF.
 Noise:
Additive noise is a common component of image degradation models, represented as
u(x, y) or η(x, y).
 Convolution:
The mathematical operation that combines the degradation function and the original
image, essentially blurring or otherwise altering the image based on the PSF.

Mathematical Representation:

In the spatial domain, a linear, position-invariant degradation model can be


represented as:

g(x, y) = (f(x, y) * h(x, y)) + u(x, y)

Where:

 g(x, y) is the degraded image.


 f(x, y) is the original, undegraded image.
 h(x, y) is the point spread function (degradation function).
 u(x, y) is the additive noise.
 '*' denotes convolution.
In the Frequency Domain:

The same model can be represented in the frequency domain using Fourier
transforms:

G(k, l) = F(k, l) * H(k, l) + N(k, l)

Where:

 G(k, l) is the Fourier transform of the degraded image.


 F(k, l) is the Fourier transform of the original image.
 H(k, l) is the Fourier transform of the PSF (also known as the transfer function).
 N(k, l) is the Fourier transform of the noise.
 '*' denotes element-wise multiplication.
Implications:

 Image Restoration:
Understanding the model of invariant degradations is crucial for developing image
restoration techniques, which aim to recover the original image from the degraded
version.
 Restoration Algorithms:
Algorithms like inverse filtering and Wiener filtering can be applied to address these
types of degradations, particularly when the PSF and noise characteristics are known
or can be estimated.
 Blind Deconvolution:
When the PSF is unknown, the problem becomes more challenging, and techniques
like blind deconvolution are used to estimate both the original image and the PSF.

ESTIMATING THE DEGRADATION FUNCTION:

Estimating the degradation function, which models how an image is blurred or


distorted, can be achieved through observation, experimentation, or mathematical
modeling. These methods help in understanding and subsequently restoring a
degraded image.

Methods for Estimating Degradation Functions:

1. Observation:
This approach involves analyzing a degraded image to infer the degradation. It often
involves identifying a small, relatively sharp portion of the image (where the
degradation is minimal) and using its characteristics to estimate the overall
degradation function, according to some sources on digital image processing.
2. Experimentation:
This method involves creating a controlled environment similar to the one in which
the degraded image was captured. By imaging a known object (like a small, bright
dot) under similar conditions, researchers can directly measure the impulse response
of the degradation.
3. Mathematical Modeling:
This approach relies on developing mathematical models that represent the physical
processes causing the degradation. These models can be based on principles of
optics, motion, or other relevant factors, according to information on degradation
models from ScienceDirect.

Inverse filtering is a digital image processing technique used for image restoration,
specifically to reverse the effects of blurring and other degradations. It works by
applying the inverse of the degradation function (also known as the point spread
function or impulse response) in the frequency domain

How it works:

1. 1. Degradation Model:
It's assumed that the image degradation (blurring, etc.) can be modeled by a specific
function (point spread function or impulse response).
2. 2. Frequency Domain Analysis:
The degraded image and the degradation function are transformed into the frequency
domain using the Fourier transform.
3. 3. Inverse Filtering:
The inverse of the degradation function (1/H) is calculated. This inverse filter is then
multiplied by the transformed image.
4. 4. Restoration:
The result is transformed back to the spatial domain using the inverse Fourier
transform, yielding a restored image.

Challenges:

 Noise Amplification:
If the degradation function has values close to zero, its inverse can become very
large, amplifying any noise present in the image.
 Ill-posed Problem:
In cases with significant noise, inverse filtering can lead to unstable and inaccurate
image restoration.

Applications:

 Image Restoration:
Recovering images degraded by motion blur, out-of-focus blur, or other known
distortions.
 Bridge Monitoring:
Identifying the fundamental frequency of a bridge by analyzing vibrations caused by
vehicles.
 Vocal Fold Vibration Analysis:
Estimating the glottal volume velocity waveform during speech by inverse filtering
the radiated acoustic waveform or volume velocity at the mouth.

Alternatives:

 Wiener Filtering:
A more robust approach that incorporates statistical information about the noise to
minimize the mean square error, making it less susceptible to noise amplification.
 Regularization Techniques:
Methods that add constraints to the solution to prevent noise amplification and
improve stability.
MINIMUM MEAN SQUARE ERROR FILTERING:

Minimum Mean Square Error (MMSE) filtering aims to find the optimal filter
that minimizes the average squared difference (mean squared error) between the
filter's output and a desired signal. This technique is widely used in signal processing,
particularly for image and speech enhancement, to reduce noise and improve signal
quality.

Here's a more detailed explanation:

Core Concept:

 The goal of MMSE filtering is to design a filter that produces an output as close as
possible to a desired signal, in terms of minimizing the average squared error between
them.
 This is achieved by minimizing the mean squared error (MSE) between the filter's
output and the desired signal.
 MMSE filtering is often used in situations where the desired signal is corrupted by
noise or other distortions.
Key Applications:

 Image Restoration:
MMSE filters, like the Wiener filter, are used to restore images degraded by blur and
noise by estimating the original, uncorrupted image.
 Speech Enhancement:
MMSE filters can be applied to noisy speech signals to improve their quality and
intelligibility.
 Noise Cancellation:
In applications like noise-canceling headphones, MMSE filters help remove
unwanted background noise.
 Channel Equalization:
MMSE filters can mitigate the effects of inter-symbol interference in communication
systems.

How it Works:

1. 1. Problem Formulation:
The filtering problem is formulated as finding a filter (represented by its
coefficients) that minimizes the MSE between its output and the desired signal.
2. 2. Statistical Assumptions:
MMSE filtering often relies on statistical information about the signals involved,
such as their power spectra or correlation properties.
3. 3. Filter Design:
The filter coefficients are chosen to minimize the MSE, often using techniques like
solving a system of linear equations or applying optimization algorithms.
4. 4. Wiener Filter:
The Wiener filter is a prominent example of an MMSE filter, particularly for image
restoration and noise reduction.

Advantages of MMSE Filtering:

 Optimal in a Statistical Sense:


MMSE filters are designed to minimize the average error, making them optimal in a
statistical sense.
 Versatile:
They can be applied to various signal processing tasks, including image and speech
processing.
 Adaptive:
MMSE filters can be adapted to changing signal characteristics by updating their
coefficients based on new data.

Limitations:

 Requires Statistical Knowledge:


The performance of MMSE filters often depends on the accuracy of the statistical
information used in their design.
 Computational Complexity:
Some MMSE filter designs can be computationally intensive, especially for complex
signals or high-dimensional data.
 Not Always Optimal in Practice:
While MMSE filters minimize the MSE in theory, their performance in practice can
be affected by factors like non-stationary signals or inaccurate statistical
assumptions.

CONSTRAINED LEAST SQUARES (CLS) FILTERING:

Constrained least squares (CLS) filtering is a technique used in image


processing to restore degraded images by minimizing an error function while adhering
to a constraint. This constraint typically limits the smoothness or high-frequency
energy of the restored image, preventing excessive noise amplification. CLS filtering
is often used in deblurring and denoising applications.

Here's a more detailed explanation:

1. The Problem:

 Images are often degraded by blurring and noise during acquisition.


 Image restoration aims to recover the original, undegraded image.
 Traditional methods like Wiener filtering require knowledge of the power spectra of
the original image and noise, which can be difficult to obtain.
 CLS filtering offers a solution by incorporating a constraint on the restored image,
often related to its smoothness.
2. The Approach:

 CLS filtering minimizes an error function that measures the difference between the
degraded image and a filtered version of the estimated original image.
 This minimization is performed subject to a constraint, which can be expressed as an
inequality involving a Laplacian operator or a similar measure of image roughness.
 The constraint ensures that the restored image doesn't become excessively noisy or
fluctuate wildly in areas where the original image might be smooth.
3. Key Components:

 Degradation function (H): Represents the blurring process.


 Noise (N): Represents the random disturbances corrupting the image.
 Estimated undegraded image (F̂): The output of the filtering process.
 Laplacian operator (P): Used to measure the smoothness of the image.
 Parameter gamma (γ): A user-defined parameter that controls the strength of the
constraint.
4. Frequency Domain Solution:

 In the frequency domain, the CLS filter is expressed as a function of the degradation
function, the Laplacian operator, and the parameter γ.
 The formula involves dividing the Fourier transform of the degraded image by a term
that includes the degradation function and the Laplacian operator, weighted by γ.
5. Advantages of CLS Filtering:

 It can be more effective than Wiener filtering when the noise is significant.
 It doesn't require explicit knowledge of the power spectra of the original image and
noise.
 It allows for control over the smoothness of the restored image.
6. Applications:

 Image deblurring and denoising.


 Restoration of images from various imaging systems, including medical imaging and
remote sensing.
 Applications in areas where high-quality images are crucial.

GEOMETRIC MEAN FILTER:

A geometric mean filter is a type of image processing filter used to reduce noise and
smooth images, particularly those affected by Gaussian noise. It works by replacing
each pixel's value with the geometric mean of the pixel values within a defined
neighborhood. This method is known for preserving edges better than some other
smoothing filters like the arithmetic mean filter.
Here's a more detailed explanation:
How it works:
1. 1. Neighborhood Definition:
The filter operates on a defined neighborhood around each pixel, typically a square
window (e.g., 3x3, 5x5).
2. 2. Geometric Mean Calculation:
For each pixel, the filter calculates the geometric mean of all pixel values within its
neighborhood. The geometric mean is calculated by multiplying all the pixel values
together and then taking the nth root, where n is the number of pixels in the
neighborhood.
3. 3. Pixel Replacement:
The original pixel's value is then replaced with the calculated geometric mean.
Mathematical Representation:
If S(x, y) represents the original image, and the filter mask is m x n pixels, then the
output image G(x, y) is calculated as:
G(x, y) = [ Π (S(i, j)) ] ^ (1 / mn) , where the product is taken over all pixels (i, j)
within the mask.
Advantages:
 Noise Reduction: Effective at reducing Gaussian noise.
 Edge Preservation: Generally better at preserving edges compared to
arithmetic mean filters.
 Susceptibility to Negative Outliers: The filter can be sensitive to negative
outliers, meaning it might not perform as well in images with extreme negative
values.
Disadvantages:
 Blurring: Larger filter sizes can lead to more blurring.
 Computational Cost: Calculating the geometric mean can be computationally
more expensive than simpler filters.
 Sensitivity to Negative Values: The filter can be sensitive to negative outliers.
GEOMETRIC TRANSFORMATIONS:

Geometric transformations are mathematical operations that alter the position,


size, or orientation of a geometric object. These transformations can be broadly
categorized into rigid transformations, which preserve shape and size, and non-rigid
transformations, which may alter size. Common types include translation, rotation,
reflection, and dilation.

TYPES OF GEOMETRIC TRANSFORMATIONS:

 Translation:
Shifting a shape without changing its size or orientation. Think of sliding a piece on
a board game.
 Rotation:
Turning a shape around a fixed point (the center of rotation). Imagine spinning a
wheel.
 Reflection:
Creating a mirror image of a shape across a line (the line of reflection). Like seeing
your reflection in a still lake.
 Dilation:
Changing the size of a shape, either enlarging or shrinking it. This is like using a
magnifying glass.

RIGID VS. NON-RIGID TRANSFORMATIONS:


 Rigid transformations:
These preserve the shape and size of the object. Translation, rotation, and reflection
are rigid transformations.
 Non-rigid transformations:
These can change the size of the object. Dilation is a non-rigid transformation.

APPLICATIONS:
Geometric transformations are fundamental in various fields, including:
 Computer graphics: Used to manipulate objects on screen, create animations, and
render images.
 Image processing: Used for image enhancement, registration, and object
recognition.
 Computer-aided design (CAD): Used to design and model objects.
 Robotics: Used to plan robot movements and manipulate objects.
 Mathematics and geometry: Provide a framework for understanding spatial
relationships and geometric properties.

UNIT-IV
IMAGE COMPRESSION STANDARDS :

Major image compression standards include JPEG for lossy and lossless
compression, JPEG 2000 which uses wavelet transforms, and PNG and GIF for lossless
compression. These standards are crucial for ensuring compatibility and efficiency in
storing and transmitting digital images, with lossy compression reducing file size by
discarding some data, while lossless methods retain all original information.

Lossy compression

 JPEG:
The most common standard for photographs, it uses a lossy compression method based
on the Discrete Cosine Transform (DCT) to separate an image into frequency
components. It is highly effective at reducing file size for web and digital photography
use.
 JPEG 2000:
An evolution of JPEG that uses a Fast Wavelet Transform for more efficient compression
and offers both lossy and lossless compression options.

Lossless compression

 PNG:
A popular format that uses lossless compression techniques, making it ideal for web
graphics and images where data integrity is critical.
 GIF:
Primarily used for animations, GIF files are limited to a palette of 256 colors and use a
lossless compression algorithm.
 TIFF:
A flexible format that supports various compression schemes, including lossless methods
like LZW.

Compression techniques
 Discrete Cosine Transform (DCT):
Transforms image blocks into the frequency domain, where high-frequency information
(details) can be more easily compressed. This is a core component of the JPEG standard.
 Quantization:
Reduces the precision of the DCT coefficients, discarding information that is less
perceptible to the human eye, which is a key step in lossy compression.
 Run-Length Encoding (RLE):
Replaces sequences of the same data value with a count, such as storing "12 zeros" as a
single entry.
 Huffman Coding:
Assigns shorter binary codes to more frequently occurring data values, reducing the
overall size of the file.
 Wavelet Transforms:
A method used in the JPEG 2000 standard that decomposes an image into different
frequency sub-bands, allowing for more effective compression, particularly at different
scales.

You might also like