0% found this document useful (0 votes)
21 views

DIgital Image Processing

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

DIgital Image Processing

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

Fundamental Steps in digital image processing

Image Acquisition –
The first process.
Generally, the image acquisition stage involves preprocessing, such as scaling.
Image is captured by a sensor & digitized if output of sensor is not already in digital form,
Then we convert in analog to digital by sampling and quantization.

Image Enhancement -
Image enhancement is the process of manipulating an image so the result is more suitable than the
original for a specific application.

The word specific is important here, because it establishes at the outset that enhancement
techniques are problem oriented.

Thus, for example, a method that is quite useful for enhancing X-ray images may not be the best
approach for enhancing satellite images taken in the infrared band of the electromagnetic spectrum.

The viewer is the ultimate Judge.

Image Restoration -
Improving the appearance of an image.
Colour image processing –
Colour image processing is an area that has been gaining in importance because of the significant
increase in the use of digital images over the internet.
Fundamental concepts in colour models and basic colour processing in a digital domain.

Colour is used also as the basis for extracting features of interest in an image.

Wavelets –
Wavelets are the foundation for representing images in various degrees of resolution.

In particular, this material is used for image data compression and for pyramidal representation, in
which images are subdivided successively into smaller regions.

Compression –
Compression, as the name implies, deals with techniques for reducing the storage required to save
an image, or the bandwidth required to transmit it.

If size of an image is large then it uses more bandwidth.


E.g., The jpg file extension used in the JPEG (joint photographic Experts Group) image
compression standard.

Morphological –
Morphological processing deals with tools for extracting image components that are useful in the
representation and description of shape.

The material begins a transition from processes that output images to processes that output image
attributes.

Image Segmentation –
Partition an image into its constituent parts or objects.
In general, autonomous segmentation is one of the most difficult tasks in digital image processing

In general, the more accurate the segmentation, the more likely automated object classification is to
succeed.

Representation & Description –


almost always follows the output of a segmentation stage, which usually is raw pixel data,
constituting either the boundary of a region or all the points in the region itself.

The first decision that must be made is whether the data should be represented as a boundary or as
a complete region.

Boundary representation is appropriate when the focus is on external shape characteristics, such as
corners and inflections.

Description, also called feature selection, deals with extracting attributes that result in some
quantitative information of interest or are basic for differentiating one class of objects from another
Recognition –
The process that assigns level to an object based its description.
Knowledge base –
Knowledge about a problem domain is coded into an image processing system in the form of
a knowledge database.

Components of image processing system


Image Formation in The Eye
Image Sampling and Quantization
• there are numerous ways to acquire images, but our objective in all is the same: to generate
digital images from sensed data
• The output of most sensors is a continuous voltage waveform whose amplitude and spatial
behaviour are related to the physical phenomenon being sensed.
• To create a digital image, we need to convert the continuous sensed data into a digital
format. This requires two processes: sampling and quantization.
1. Sampling:
Sampling is the process of converting a continuous signal, such as an analog image, into a
discrete signal by selecting a finite set of points from the continuous signal.

In the context of digital images, these points represent the pixels in the image. A digital
image is composed of a grid of pixels.

Each pixel contains a numerical value representing the intensity or color at that particular
location.

The process of sampling involves capturing the image's information at regularly spaced
intervals in both the horizontal and vertical directions.

The sampling process is influenced by the sampling rate, which determines how many
samples are taken per unit of length or area.

Sampling Rate: The number of samples (pixels) taken per unit length in both the horizontal
and vertical directions determine the sampling rate.

Higher sampling rates result in more detailed digital images but require more storage space.

2. Quantization:
Quantization is the process of mapping the continuous amplitude values of the sampled
image to a finite set of discrete amplitude values.

The number of bits used for quantization determines the quantization levels.
For example, in an 8-bit grayscale image, there are 256 distinct levels of gray (from 0 to 255),
while in a 24-bit color image, there are over 16 million possible colour.

In the case of color images, quantization is performed independently on each color channel
(such as red, green, and blue in RGB images).

Higher bit depths provide more accurate representation of the original image, allowing for a
wider range of colors or shades of gray. However, higher bit depths also require more
storage space

Applications:

• Digital Cameras: Analog signals captured by camera sensors are sampled and
quantized to produce digital images.
• Image Compression: Quantization is a crucial step in lossy image compression
algorithms, where reducing the number of distinct values helps in compressing the
image data efficiently.
• Display Devices: Images need to be quantized to match the bit depth of the display
device for proper visualization.

Neighbors of a Pixel
The set of image locations of the neighbours of a point p is called the neighbourhood of p. The
neighbourhood is said to be closed if it contains p. Otherwise, the neighbourhood is said to be open.

Pixel connectivity(ADJACENCY)
Pixel connectivity refers to the relationship between pixels in an image based on their
adjacency.

For example, if we are dealing with the adjacency of pixels whose values are in the
range 0 to 255, set V could be any subset of these 256 values.
We consider three types of adjacency:
1. 4-adjacency. –
Two pixels p and q with values from V are 4-adjacent if q is in the set N4(p).
2. 8-adjacency –
Two pixels p and q with values from V are 8-adjacent if q is in the set N8(p).
3. m-adjacency (also called mixed adjacency)-
Two pixels p and q with values from V are m-adjacent if
(a) q is in N4(P ), or

(b) q is in ND(P ) and the set has no pixels whose values are from V.

Distance Measure
motion
MODULE 4
Degradation model
Introduction to degradation

Artefacts this term is mainly used in the medical term


Unconstrained and constrained restorations
Unconstrained Restoration:
Unconstrained restoration methods do not make use of any prior knowledge or constraints about the
image, the degradation process, or the noise characteristics. These methods typically involve
techniques like image filtering, inverse filtering, or Wiener filtering. Unconstrained restoration
methods attempt to estimate the original image based solely on the observed degraded image.

Advantages:

• Simple and easy to implement.


• Suitable for cases where there is limited knowledge about the degradation process and noise
characteristics.

Disadvantages:

• Prone to overfitting or amplifying noise if not properly regularized.


• May not perform well in cases where the degradation process is complex or poorly
understood.
Constrained Restoration:
Constrained restoration methods, also known as regularized or constrained inverse methods,
incorporate additional information or constraints into the restoration process. These methods exploit
prior knowledge about the image, the degradation process, or the statistical properties of the noise.
By incorporating constraints, these methods can produce more accurate and reliable results compared
to unconstrained methods, especially when dealing with ill-posed or under-determined problems.

Common constraints used in constrained restoration methods include:

• Spatial Constraints: Encouraging smoothness in the restored image, assuming that


neighboring pixels in the original image have similar intensity values.
• Non-negativity Constraints: Ensuring that pixel values in the restored image are non-
negative, which is often the case in real-world images.
• Total Variation (TV) Regularization: Encouraging piecewise smoothness in the image by
penalizing rapid intensity changes.
• Sparse Representation: Assuming that the image or its features can be sparsely represented
in a suitable transform domain (e.g., wavelet or sparse coding).

Advantages:

• Incorporates additional information, leading to more accurate restoration results.


• Provides better handling of ill-posed problems and noisy images.
• Can be customized based on the specific characteristics of the image and degradation
process.

Disadvantages:

• Requires knowledge about the image, degradation, or noise characteristics, which might not
always be available.
• Increased complexity in algorithm design and implementation.
Inverse filter
Wiener Filters

The Wiener filter is a widely used technique in digital image processing for image restoration
and noise reduction.

It's particularly useful when dealing with images that have been degraded by additive noise.

The Wiener filter aims to minimize the mean squared error between the estimated image
and the original image, taking into account the characteristics of the noise present in the
degraded image.

It does this by employing a frequency domain approach based on the Fourier transform of
the images.
Circulant matrices
In digital image processing, a circulant matrix is a special type of matrix that has a circular
shifting property. Circulant matrices are particularly useful in image processing tasks because
they can efficiently represent certain linear transformations, such as convolution operations.

Circulant Matrices:
A circulant matrix is a square matrix in which each row is a circular shift of the
previous row. In other words, if you take any row of a circulant matrix and cyclically
shift its elements to the right, the resulting row is still a row of the matrix. Circulant
matrices can be represented compactly using just one row, as the entire matrix can
be generated by cyclically shifting the elements of this row.

For example, consider a 4x4 circulant matrix:

Relevance in Digital Image Processing:


1. Convolution Operations: Circulant matrices are particularly useful for
performing convolution operations in digital image processing. Convolution is
a fundamental operation used in tasks like filtering, edge detection, and
feature extraction. By exploiting the properties of circulant matrices,
convolution can be efficiently implemented using Fast Fourier Transform (FFT)
techniques. This approach significantly reduces the computational complexity
of convolution operations.
2. Image Restoration: Circulant matrices are applied in image restoration tasks,
where the goal is to recover the original image from a degraded or noisy
version. Image restoration techniques often involve solving linear equations,
and circulant matrices can be used to efficiently represent the blurring process
or the degradation model, making the restoration process computationally
more efficient.
3. Signal Processing: Circulant matrices are widely used in signal processing
applications, and since images can be viewed as 2D signals, these matrices
find extensive use in various image processing algorithms, including
compression, denoising, and watermarking.
Block circulant matrix
A block circulant matrix is an extension of the concept of a circulant matrix to multiple
blocks. Instead of having a single row that generates the entire matrix through circular shifts,
a block circulant matrix is constructed using multiple circulant blocks. Each block within the
matrix is a circulant matrix, and the entire matrix is formed by repeating these blocks in a
circular fashion.

Relevance in Digital Image Processing:


Block circulant matrices find applications in various areas of digital signal and image
processing:

1. Parallel Processing: Block circulant matrices are utilized in parallel processing


algorithms, where computations can be efficiently distributed across multiple
processing units. Each circulant block can be processed independently,
allowing for parallelization of certain operations.
2. Image Compression: In image compression techniques like JPEG, block
circulant matrices are employed to transform image blocks into frequency
domain representations. By utilizing block circulant structures, efficient
transformations can be performed, leading to better compression ratios.
3. Channel Coding: Block circulant matrices are used in channel coding
schemes, especially in multiple-input multiple-output (MIMO) communication
systems. They help in efficiently encoding and decoding information
transmitted over multiple channels.
4. Error Correction Codes: Block circulant matrices are employed in error
correction codes, where they play a role in encoding and decoding processes.
These matrices facilitate efficient error detection and correction in digital
communication systems.
5. Spectral Analysis: Block circulant matrices are utilized in spectral analysis
tasks, where they can represent the covariance structure of multivariate
signals. This representation is valuable in various applications, including image
processing and data analysis.

Differentiate

1. Basic Structure:
• Circulant Matrix:
• In a circulant matrix, there is a single row or column from which the entire
matrix is generated through circular shifts. The matrix is fully determined by
this single row or column.
• All rows of a circulant matrix are cyclic permutations of this single defining
row, and similarly for columns.
• Example of a 4x4 circulant matrix:

Block Circulant Matrix:


• In a block circulant matrix, the matrix is constructed using multiple circulant
blocks. Each block is a circulant matrix on its own.
• The entire matrix is formed by repeating these circulant blocks in a circular
fashion.
• Example of a block circulant matrix with 2x2 blocks and 2 blocks:

2. Applications:
• Circulant Matrix:
• Circulant matrices are primarily used in applications where circular shifts are
involved, such as convolution operations in digital signal and image
processing.
• They are efficient for operations involving circularly structured data or signals.
• Block Circulant Matrix:
• Block circulant matrices find applications in parallel processing, image
compression, channel coding, error correction codes, and spectral analysis.
• They are suitable for tasks that can be parallelized and involve structured data
in blocks.
3. Usage in Digital Image Processing:
• Circulant Matrix:
• Circulant matrices are used for efficient implementation of convolution
operations in image processing.
• They simplify the computation of convolutions, especially when dealing with
large images and filters.
• Block Circulant Matrix:
• Block circulant matrices are employed in various image processing tasks such
as compression and parallelized operations on image blocks.
• They allow for efficient parallel processing of image data, making them
valuable in applications where parallelization is essential.

In summary, while both circulant and block circulant matrices involve circular shifting of
elements, they differ in their structures and applications. Circulant matrices focus on efficient
representation of entire matrices through a single defining row or column, primarily used in
circular shift-related operations. Block circulant matrices, on the other hand, consist of
multiple circulant blocks arranged in a circular fashion, making them useful for parallelized
and block-based operations in various fields, including digital image processing.

Effect of diagonalization of circulant and block circulant matrices

In digital image processing, circulant and block circulant matrices are commonly
used for various operations, such as convolution and filtering. Diagonalization of
these matrices can significantly simplify and speed up these operations.
Block Circulant Matrices:
Block circulant matrices extend the concept of circulant matrices to blocks of
circulant submatrices. Diagonalization of block circulant matrices involves
diagonalizing the individual circulant submatrices and forming block diagonal
matrices. This diagonalization process can simplify operations involving block
circulant matrices, making computations more efficient.

Effect of Diagonalization:
1. Faster Operations: Diagonalization reduces complex matrix operations to simple
element-wise operations on the diagonal matrices, which are much faster to
compute. This speedup is particularly significant for large matrices, as it reduces the
computational complexity of algorithms used in image processing.
2. Efficient Convolution: In image processing, convolution operations are fundamental.
Diagonalization of circulant or block circulant matrices allows convolution operations
to be performed efficiently in the frequency domain. This is the basis for fast
convolution algorithms like the Fast Fourier Transform (FFT) and its variants, which
exploit the diagonalization properties to speed up convolution operations on large
images.
3. Storage Efficiency: Diagonal matrices are more storage-efficient than general
matrices, especially for sparse matrices. Storing only the diagonal elements (and
possibly the transformation matrices) can save memory, which is crucial in
applications dealing with large images.
4. Numerical Stability: Diagonalization can improve the numerical stability of
algorithms. Diagonal matrices are well-behaved numerically, and computations
involving them are less prone to rounding errors compared to general matrices.

In summary, diagonalization of circulant and block circulant matrices in digital image


processing leads to faster, more efficient, and numerically stable algorithms for
various operations, ultimately improving the overall performance of image
processing tasks.
MODULE 2
Histogram based Techniques
By definition histogram of an image represents the relative frequency of
occurrence of various grey levels in an image.

This is the variation of the pixels and each and every square represent
Grey levels.
• Techniques very effective
• Useful in many image processing applications.
• Also used for manipulating contrast and brightness of image.
• Quality of image can be controlled by normalizing its histogram to a flat
profile.
Histogram matching
Median filtering

The median filter is the filtering technique used for noise removal from images and signals.
Median filter is very crucial in the image processing field as it is well known for the
preservation of edges during noise removal.
The prior duty of the filter is to scan every input data interceding the overall entries with the
median function known as “window” method.
The window tends to be a little bit complex over the higher-dimensional signals.
The number of medians is set according to the number of windows, falling under odd and
even categories.

Median filtering is a common technique used in digital image processing to remove noise
from an image. Image noise can be caused by various factors such as sensor limitations,
transmission interference, or environmental conditions. Median filtering is effective in
preserving edges and fine image details while effectively reducing different types of noise,
including salt-and-pepper noise.

Here's how median filtering works:

1. Understanding Noise:
• Salt-and-Pepper Noise: This type of noise presents itself as randomly
occurring white and black pixels scattered throughout the image.
2. Sliding Window Operation:
• Median filtering operates on a small, square-shaped neighborhood (or kernel)
around each pixel in the image.
• The size of the neighborhood (usually a 3x3 or 5x5 window) is chosen based
on the characteristics of the noise and the desired level of noise reduction.
3. Pixel Replacement:
• For each pixel in the image, the values of the pixels within the neighborhood
are sorted.
• The median value (middle value when the pixel values are sorted in ascending
order) is then selected from the sorted list.
4. Replacing Noisy Pixel:
• The original value of the pixel being processed is replaced with the computed
median value from the neighborhood.

The median filtering process is effective for salt-and-pepper noise because this type of noise
can randomly affect pixels, making some pixels extremely bright (white) or dark (black). By
using the median value, extreme values are eliminated, resulting in a smoother and less noisy
image.

Advantages of Median Filtering:

• Preserves edges and fine details better than some other noise reduction techniques
like mean filtering, which tends to blur edges.
• Robust against outliers and extreme values in the image.
Disadvantages of Median Filtering:

• Can result in loss of fine image details, especially if the kernel size is too large,
leading to oversmoothing.
• Not effective for reducing other types of noise like Gaussian noise, which follows a
normal distribution.

In summary, median filtering is a valuable tool in image processing, particularly when dealing
with salt-and-pepper noise, as it helps in preserving image features while effectively
reducing noise.

Now
Grey level image kya hota ha, its like it start from 0 and it ends to like 255 pixels

10 mtlb bi like to the black side or 251 mtlb to the white side ab es
image ko dekh ke me bol sakta hu ki white pixel in black
background

Or pepper noise eska ulta hota ha


pepper noise is black pixels in white background

ab jo hamara median filtering hota ha uska kaam hota ha salt noise or pepper noise ko
eliminate karna ha
to ab ham ne median filtering ko salt noise me apply kiya to to answer milega

idar hmm ne salt noise ko eliminate kiya


Same pepper noise pe kiya to answer milega

Ab salt noise ko remove kese kiya or kese answer aya


Median filtering ko jo filter hota ha that is completely blank space or es filter ko hame salt
noise me apply karna padega mtlb hame origin find out karna padega

Salt noise me saare no. ko ascending order me arrange karna ha


ab middle element pick up karna ha or wo ha 10 mtlb hamra
answer 10 ha to hame jo origin select kiya to uski jagah 10 likh
dege

ab ham dibba aage sirkaege to to origin ye hoga

circle 251 wala origin ha to or replication use karege to agge 251,251,10


milega box me jo vertical me dikh rha ha.
esko ab dubara ascending order me arrange karege
10,10,10,10,10,251,251,251,251
Esme middle value 10 ha to answer 10 hoga or origin me 10 put se replace
karna ha
Same process karna ha or aapko har ek anser 10 milega
Ab esi konsi condition ha jaha median filtering failed ho jayegga ,
To agar aaddha pixel koi or pixel ha or addha pixel koi or pixel aha to es condition me jo
hamra median filtering ha wo failed ho jayega
Another example
Low pass filter

Low pass filter me hmm image ko smooth karte yani thoda sab bluring karta ha by
decreasing the disparity between pixel values or ye sab hota ha near by pixel ha uska average
calculate karke hmm log karte ha.
Ab low frequency information usko bolte ha jo information jaha pixel intensity variation
kaam ha yaani pixel intensity ka value drastically nhi change ho rha ha almost pixel intensity
value same ha us particular area ko bolte ha low frequency information.
Ab hmm low pass filtering kar rhe ha to uske phele image ka near by boundary ha usko kis
tara se handling karna ha

Salt or pepper puure tarike se nhi gya ha thoda kaam hua ha iska mtlb ha ki average filter ha
to salt or pepper ko pure tarike se remove nhi karta ha sirf usko fade karta ha
Median filter salt or pepper ko puure tarike remove karne ke liya use hota ha
Module 3
Compare DFT and FFT algorithm in digital image processing

DFT (Discrete Fourier Transform) and FFT (Fast Fourier Transform) are essentially the
same thing, but FFT is a more efficient algorithm to compute DFT. Let me explain
both concepts to clarify.

1. Discrete Fourier Transform (DFT): DFT is a mathematical technique used to


transform a signal from its spatial domain (original domain, like an image) to its
frequency domain. In digital image processing, DFT is applied to images to analyze
their frequency components. DFT is defined for a discrete, finite signal or image.

• Computational Complexity: The basic DFT algorithm has a computational


complexity of O(N^2), where N is the number of samples in the signal or
image.

2. Fast Fourier Transform (FFT): FFT is an algorithm designed to compute DFT


efficiently. It significantly reduces the number of computations required to calculate
DFT, making it much faster, especially for large datasets.

• Computational Complexity: FFT algorithms have varying complexities


depending on the specific algorithm used, but they are generally much faster
than the basic DFT algorithm. The most common FFT algorithms, like Cooley-
Tukey FFT, have a computational complexity of O(N log N).
• Implementation: FFT algorithms are based on clever mathematical
techniques that exploit the periodic nature of sinusoidal functions, allowing
for more efficient computation of DFT. The Cooley-Tukey FFT algorithm, for
example, recursively divides the DFT computation into smaller sub-problems,
making it faster for large N.
Walsh Transform
Hadamard Transform
Discrete Cosine Transform
Module 5

Variable Length Coding

Variable Length Coding (VLC) is a lossless data compression technique.


In lossless compression, the original data can be perfectly reconstructed from the
compressed data without any loss of information.
Variable Length Coding achieves compression by assigning shorter codes to more frequent
symbols and longer codes to less frequent symbols, optimizing the representation of the
data without losing any information during the compression process.

When the data needs to be decompressed, the original information is fully recovered from
the compressed form.

This property ensures that Variable Length Coding, including methods like Huffman coding,
is lossless.

Variable Length Coding (VLC) is a data compression method where each symbol (or group of
symbols) is represented by a unique binary code, and the length of the code varies based on
the frequency of occurrence of the symbol in the data. More frequently occurring symbols
are represented by shorter codes, leading to efficient compression of the data. One popular
VLC technique is Huffman coding. Let's consider an example of Huffman coding for a set of
characters and their frequencies.

VLC, also called entropy coding, is a technique whereby each event is assigned a code that may
have a different number of bits.

To obtain compression, short codes are assigned to frequently occurring events and long codes are
assigned to infrequent events.
Bit plane coding

Now this image A is divided into you can see there are 3 bits in each pixel value so now you can
divided into 3 planes

In this way three pattern can generated


Individual planes of image can be
compressed by using RLC Technique.
Lossless predictive coding

Same predictor important line


Lossy predictive coding
Lossless Compression:

1. Data Integrity:
• Lossless: Preserves the original data integrity. No information is lost
during compression or decompression.
• Use Case: Suitable for applications where data fidelity is critical, such as
medical imaging or text documents.
2. Compression Ratio:
• Lossless: Offers moderate compression ratios. Typically reduces file
size by 20-60%.
• Use Case: Ideal for scenarios where preserving all the information is
more important than achieving high compression.
3. Reconstruction:
• Lossless: Can perfectly reconstruct the original data from the
compressed version.
• Use Case: Best suited for applications where the exact reproduction of
the original data is necessary, like scientific data analysis.
4. Examples:
• Lossless: PNG, GIF, BMP image formats, ZIP, RAR archive formats.
5. Suitability:
• Lossless: Suitable for scenarios where even a small loss of data is
unacceptable, such as legal documents or databases.

Lossy Compression:

1. Data Integrity:
• Lossy: Sacrifices some data integrity for higher compression ratios.
Some information is lost during compression.
• Use Case: Commonly used for multimedia applications where minor
loss of quality is acceptable, like images, audio, and video files on the
internet.
2. Compression Ratio:
• Lossy: Offers higher compression ratios compared to lossless methods.
Can achieve significant reduction in file size.
• Use Case: Ideal for applications where reducing file size is a priority,
such as streaming videos or large image databases.
3. Reconstruction:
• Lossy: Cannot perfectly reconstruct the original data. Some details are
lost, especially in high compression settings.
• Use Case: Suitable for applications where human perception can
tolerate slight loss, such as web images or digital media streaming.
4. Examples:
• Lossy: JPEG, MP3, MP4, and other multimedia formats.
5. Suitability:
• Lossy: Appropriate for multimedia applications where high
compression ratios are needed, and a minor loss of quality is
acceptable to achieve smaller file sizes.

You might also like