DIgital Image Processing
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.
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.
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.
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.
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
Advantages:
Disadvantages:
Advantages:
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.
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:
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.
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.
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.
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.
• 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
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
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.
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
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.