0% found this document useful (0 votes)
24 views14 pages

IT Assignment

Uploaded by

Chandan Kumar
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)
24 views14 pages

IT Assignment

Uploaded by

Chandan Kumar
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/ 14

Image Processing 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.

Fig.1 Vector quantization for image compression purposes


Mean Square Error (MSE) Measure for Vector Quantization: The quality of the
quantization can be measured using the Mean Square Error (MSE). The MSE

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

The general equation for a 2D (N by M image) DCT is defined by the following


equation:

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.

The above is equivalent to:

6) We know that for discrete time system, convolution of two sequence can be given by:

y(n) = x(n) * h(n) = ∑ x[i]h[n-i]

Where * denotes the convolution operator, and

where i ranges from -∞ to +∞

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

=>y(n) = [9, 0, -4, -4, -1]

We can also verify the no of samples present in y(n),as

The no of samples in y(n) = x+h-1 = 3+3-1 = 5, which is exactly the no of samples


present in the above result.

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.

A non-linear filtering is one that cannot be done with convolution or Fourier


multiplication. A sliding median filter is a simple example of a non-linear filter.

8) Pixel/point operation: The simplest operation in the image processing occurs when
the neighborhood is simply the pixel itself.

Example:

Image negation or invert

Power Law Transform

Log Transform

Piece wise linear Transform

Mask operations: g depends on the predefined number of neighbors of f at (x,y). It


Implemented by using mask processing or filtering.

Example:

Image smoothing

Image sharpening

Global operations: An operation on an image that will manipulate the images as a


whole.

Example: Histogram Equalization

9) Image Restoration: Restoration improves image in some predefined sense. It is an


objective process. Restoration attempts to reconstruct an image that has been degraded
by using a priori knowledge of the degradation phenomenon. These techniques are
oriented toward modeling the degradation and then applying the inverse process in
order to recover the original image. Restoration techniques are based on mathematical
or probabilistic models of image processing. Enhancement, on the other hand is based
on human subjective preferences regarding what constitutes a “good” enhancement
result. Image Restoration refers to a class of methods that aim to remove or reduce the
degradations that have occurred while the digital image was being obtained. All natural
images when displayed have gone through some sort of degradation:

pg. 5
• During display mode
• Acquisition mode, or
• Processing mode

Fig.2 A model of the image Degradation / Restoration process

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.

In many practical applications, such as image deblurring and signal restoration,


knowing neither the exact degradation process (the filter) nor the original signal
requires sophisticated methods to estimate both.

Methods of Blind Convolution

1. Iterative Blind Deconvolution (IBD): Iterative Blind Deconvolution (IBD) is


a popular method for blind deconvolution, which works by iteratively refining
estimates of both the original signal and the filter.
2. Total Variation Regularization: Total Variation (TV) Regularization is used
to preserve edges while reducing noise and smooth regions. It is commonly used
in blind deconvolution to avoid over-smoothing of important features in the
signal or image.

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.

The error measure is given by

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

S=T(r) where 0<r<1

It produces a level s for every pixel value r in the original image.

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.

Rayleigh Noise: Unlike Gaussian distribution, the Rayleigh distribution is no


symmetric. It is given by the formula.

pg. 8
Gamma Noise: The PDF of Erlang noise is given by

Its shape is similar to Rayleigh disruption. This equation is referred to as


gamma density it is correct only when the denominator is the gamma
function.

Exponential Noise: Exponential distribution has an exponential shape.


The PDF of exponential noise is given as

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.

(e) Median filter:


It is the best order statistic filter; it replaces the value of a pixel by the median of gray
levels in the Neighborhood of the pixel.

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.

(f) Max and Min filter:


Using the l00th percentile of ranked set of numbers is called the max filter and is
given by the equation

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.

16) There are three ways degradation function can be estimated:


• Observation

pg. 11
• Experimentation
• Mathematical modeling

Estimation by Image Observation:

• Let the image is degraded by an unknown degradation function H.


• Assume that H is linear and position invariant.
• Gather information from the image.
• Look at the small rectangular section of a blurred image, which contain
sample structure.
• To reduce the noise effect, look at the strong signal content area (area of
high contrast).
• Now process the sub-image to arrive at a result that it a unblurred as
possible. (Using sharpening filter or by processing small areas in hand)
• Let the observed sub-image be denoted by gs(x, y) and the processed sub-
̂ (x, y)
image 𝑓𝑠
• Assuming negligible noise effect, we have

Estimation by Experimentation:

• If the equipment, with which we obtained the degraded image is available,


accurate estimation of the degradation function can be obtained.
• With various system settings of the equipments, obtain a degraded as closely
as possible to the given degraded image.
• Using the system settings (Response) get an impulse response by imaging an
impulse (small dot of light.
• An impulse is simulated by bright dot of light as bright as possible to reduce
the effect of noise to negligible value.
• Then Fourier transform of an impulse is a constant

Where A is constant describing strength of the impulse.

pg. 12
Estimation by mathematical modeling:

• The mathematical degradation model proposed by Hufnagel and Stanley


[1964] is based on the physical characteristics of the atmospheric turbulence.

Where k is the constant depends on the nature of the turbulence.

pg. 13
pg. 14

You might also like