IT Assignment
IT Assignment
1) Neighbours of a pixel:
A pixel p at coordinates (x,y) has four horizontal and vertical neighbors whose
coordinates are given by:
(x+1, y), (x-1, y), (x, y+1), (x, y-1)
This set of pixels, called the 4-neighbors or p, is denoted by N4(p). Each pixel is one
unit distance from (x, y) and some of the neighbors of p lie outside the digital image if
(x, y) is on the border of the image. The four diagonal neighbors of p have coordinates
and are denoted by ND (p).
(x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)
These points, together with the 4-neighbors, are called the 8-neighbors of p, denoted
by N8 (p).
Adjacency: Let v be the set of gray –level values used to define adjacency, in a binary
image, v={1}. In a gray-scale image, the idea is the same, but V typically contains more
elements, for example, V = {180, 181, 182, …, 200}.
If the possible intensity values 0 – 255, V set can be any subset of these 256 values. if
we are reference to adjacency of pixel with value.
Three types of adjacency-
• 4- Adjacency – two pixel P and Q with value from V are 4 –adjacency if A is in
the set N4(P)
• 8- Adjacency – two pixel P and Q with value from V are 8 –adjacency if A is in
the set N8(P)
• M-adjacency –two pixel P and Q with value from V are m – adjacency if (i) Q
is in N4(p) or (ii) Q is in ND(q) and the set N4(p) ∩ N4(q) has no pixel whose
values are from V.
Connectivity: Let S represent a subset of pixels in an image, two pixels p and q are
said to be connected in S if there exists a path between them consisting entirely of pixels
in S.
For any pixel p in S, the set of pixels that are connected to it in S is called a connected
component of S. If it only has one connected component, then set S is called a connected
set.
Regions: Let R to be a subset of pixels in an image, we call a R a region of the image.
If R is a connected set. Region that are not adjacent are said to be disjoint.
Boundaries: The boundary (also called border or contour) of a region R is the set of
pixels in the region that have one or more neighbors that are not in R.
2) Vector Quantization: Vector Quantization (VQ) is a technique often used in image
compression and pattern recognition. It compresses data by converting large sets of
input vectors into a smaller set of representative vectors. The idea is to partition the data
space into regions and represent each region by a code vector, significantly reducing
the amount of data required to represent the original information.
Process of Vector Quantization
• Training Set: A large set of input vectors (training vectors) is collected.
• Codebook Design: A smaller set of vectors (code vectors) is selected or designed
from the training set. This set of vectors forms the codebook.
• Encoding: Each input vector is replaced with the index of the closest code vector
from the codebook.
• Decoding: The indices are used to reconstruct the original vectors by replacing
each index with the corresponding code vector from the codebook.
pg. 2
measures the average squared difference between the original vectors and the
reconstructed vectors.
𝟏 𝑵
̂𝒊 ||𝟐
MSE = 𝑵 ∑𝒊=𝟏 ||𝒙𝒊 − 𝒙
3) It provides the relation between spatial domain and frequency domain. It is used in the
image enhancement in frequency domain.
1D 2D
4) Discrete Cosine Transform (DCT): The discrete cosine transform (DCT) helps
separate the image into parts (or spectral sub- bands) of differing importance (with
respect to the image's visual quality). The DCT is similar to the discrete Fourier
transform: it transforms a signal or image from the spatial domain to the frequency
domain.
The general equation for a 1D (N data items) DCT is defined by the following equation:
and the corresponding inverse 1D DCT transform is simple F-1(u), i.e.: where
and the corresponding inverse 2D DCT transform is simple F-1(u,v), i.e.: where
5) Hadamard Transform: We define now the 2-D Hadamard transform. It is similar to the
2-D Walsh transform.
pg. 3
The above is equivalent to:
We define now the Inverse 2-D Hadamard transform. It is identical to the forward 2-D
Hadamard transform.
6) We know that for discrete time system, convolution of two sequence can be given by:
x(n) => 3 2 1
h(n) => 3 -2 -1
-3 -2 -1
-6 -4 -2 X
9 6 3 X X
9 0 -4 -4 -1
pg. 4
7) Linear filtering is the filtering method in which the value of output pixel is linear
combinations of the neighbouring input pixels. it can be done with convolution. For
examples, mean/average filters or Gaussian filtering.
8) Pixel/point operation: The simplest operation in the image processing occurs when
the neighborhood is simply the pixel itself.
Example:
Log Transform
Example:
Image smoothing
Image sharpening
pg. 5
• During display mode
• Acquisition mode, or
• Processing mode
10) Blind Convolution: Blind convolution is a process in signal and image processing
where the goal is to recover both the original signal and the convolutional kernel (filter)
from an observed signal or image. This is challenging because both the original signal
and the filter are unknown.
11) Wiener Filtering: It is also known as minimum mean Square Error filtering. The
wiener filtering approach uses the degradation function and statistical characteristics of
noise into the restoration process.
The objective is to find an estimate of the uncorrupted image such that the mean
square error between them is minimized.
pg. 6
12) Histogram Equalization: Histogram equalization is a common technique for
enhancing the appearance of images. Suppose we have an image which is
predominantly dark. Then its histogram would be skewed towards the lower end of the
grey scale and all the image detail are compressed into the dark end of the histogram.
If we could ‘stretch out’ the grey levels at the dark end to produce a more uniformly
distributed histogram then the image would become much clearer.
Let there be a continuous function with r being gray levels of the image to be enhanced.
The range of r is [0, 1] with r=0 representing black and r=1 representing white. The
transformation function is of the form
13) Spatial Smoothing: Spatial smoothing is a technique used to reduce noise and minor
details in an image by averaging the pixel values with their neighbours. This results in
a blurred image, which is useful for reducing high-frequency noise (sharp edges and
fine details).
Common Method: Averaging Filter (Each pixel is replaced by the average of its
neighbourhood pixels)
Spatial Sharpening: Spatial sharpening is used to enhance the edges and fine details
in an image. It increases the contrast between different regions of the image, making
the transitions between them more pronounced.
Common Method: Laplacian Filter (It uses the second derivative to highlight areas of
rapid intensity change (edges))
14) Gaussian Noise: These noise models are used frequently in practices because of its
tractability in both spatial and frequency domain. The PDF of Gaussian random variable
is
pg. 7
Where z represents the gray level, μ= mean of average value of z, σ = standard
deviation.
pg. 8
Gamma Noise: The PDF of Erlang noise is given by
pg. 9
15) (a)Arithmetic Mean filter: It is the simplest mean filter. Let Sxy represents the set of
coordinates in the sub image of size m*n centered at point (x,y). The arithmetic mean
filter computes the average value of the corrupted image g(x,y) in the area defined by
Sxy. The value of the restored image f at any point (x,y) is the arithmetic mean
computed using the pixels in the region defined by Sxy.
This operation can be using a convolution mask in which all coefficients have value
1/mn. A mean filter smoothes local variations in image Noise is reduced as a result of
blurring. For every pixel in the image, the pixel value is replaced by the mean value of
its neighboring pixels with a weight. This will resulted in a smoothing effect in the
image.
(b) Geometric Mean filter: An image restored using a geometric mean filter is given
by the expression
Here, each restored pixel is given by the product of the pixel in the sub image window,
raised to the power 1/mn. A geometric mean filters but it to loose image details in the
process.
(c) Harmonic Mean filters: The harmonic mean filtering operation is given by the
expression
The harmonic mean filter works well for salt noise but fails for pepper noise. It does
well with Gaussian noise also.
pg. 10
(d) Order statistics filter:
Order statistics filters are spatial filters whose response is based on ordering the pixel
contained in the image area encompassed by the filter. The response of the filter at
any point is determined by the ranking result.
The original of the pixel is included in the computation of the median of the filter are
quite possible because for certain types of random noise, the provide excellent noise
reduction capabilities with considerably less blurring then smoothing filters of similar
size. These are effective for bipolar and unipolor impulse noise.
It is used for finding the brightest point in an image. Pepper noise in the image has
very low values, it is reduced by max filter using the max selection process in the
sublimated area sky. The 0th percentile filter is min filter.
This filter is useful for flinging the darkest point in image. Also, it reduces salt noise
of the min operation.
pg. 11
• Experimentation
• Mathematical modeling
Estimation by Experimentation:
pg. 12
Estimation by mathematical modeling:
pg. 13
pg. 14