IP Assignment Mid 2
IP Assignment Mid 2
The Wiener filter is a widely used technique in image processing for noise reduction and signal
enhancement. It's named after Norbert Wiener, who introduced the concept in the 1940s. Wiener
filter is a type of image restoration filter that tries to undo the degradation of an image caused by
some known factors, such as blurring, noise, or distortion. It is based on the assumption that the
degraded image is the result of the original image being convolved with a degradation function
and corrupted by additive noise. That is,
g(x,y)=f(x,y)∗h(x,y)+n(x,y)
where g(x,y) is the degraded image, f(x,y) is the original image, h(x,y) is the degradation
function, n(x,y) is the noise, and ∗ denotes convolution.
The Wiener filter tries to estimate the original image by dividing the degraded image by the
degradation function in the frequency domain, and applying a correction term that depends on
the signal-to-noise ratio. That is,
H (u , v )G (u , v )
F′(u,v) = 2 Sf (u , v )
∣ H (u , v )∣ +
Sn(u , v)
where F′(u,v) is the estimated original image, G(u,v), H(u,v), Sn(u,v), and Sf(u,v) are the Fourier
transforms of g(x,y), h(x,y), n(x,y), and f(x,y), respectively.
The Wiener filter has a variety of applications in signal processing, image processing, control
systems, and digital communications. These applications generally fall into one of four main
categories: system identification, deconvolution, noise reduction, and signal detection.
Image restoration is the process of recovering an image that has been degraded by some known factors,
such as blurring, noise, or distortion. The goal of image restoration is to enhance the quality of the
image and extract meaningful information from it.
Inverse filter is a type of restoration filter that tries to invert the degradation process and recover the
original image. It is based on the assumption that the degraded image is the convolution of the original
image and the degradation function, plus some additive noise. That is,
g(x,y)=f(x,y)∗h(x,y)+n(x,y)
where g(x,y) is the degraded image, f(x,y) is the original image, h(x,y) is the degradation function, n(x,y)
is the noise, and ∗ denotes convolution. In the frequency domain, the above equation becomes:
G(u,v)=F(u,v)H(u,v)+N(u,v)
where G(u,v), F(u,v), H(u,v), and N(u,v) are the Fourier transforms of g(x,y), f(x,y), h(x,y), and n(x,y),
respectively.
The inverse filter tries to estimate the original image by dividing the degraded image by the degradation
function in the frequency domain. That is,
F′(u,v)=H(u,v)/G(u,v)
However, inverse filtering is very sensitive to noise and small values of H(u,v). If H(u,v) is zero or close to
zero, the inverse filter will amplify the noise and produce a poor restoration. Therefore, inverse filtering
is only effective when the degradation function is known and the noise is negligible.
Detection of discontinuities is a method of image segmentation that aims to find the pixels where
the gray level changes abruptly. These pixels can indicate the boundaries of objects or regions in
an image. There are three basic types of discontinuities: points, lines, and edges.
· Point detection: A point is a pixel that has a significantly different gray level from its neighbors.
To detect points, we can use a mask that computes the difference between the center pixel and
the average of its neighbors. If the absolute value of this difference is greater than a threshold,
we mark the pixel as a point. An example of a point detection mask is:
-1 -1 -1
-1 8 -1
-1 -1 -1
· Line detection: A line is a set of pixels that form a straight or curved segment with a distinct
orientation. To detect lines, we can use masks that are sensitive to specific directions, such as
horizontal, vertical, or diagonal. If the result of applying a mask to a pixel is greater than a
threshold, we mark the pixel as a line in the direction of the mask. Some examples of line
detection masks are:
-1 2 -1 -1 -1 2 -1 -1 -1 2 -1 -1
-1 2 -1 -1 2 -1 2 2 2 -1 2 -1
-1 2 -1 2 -1 -1 -1 -1 -1 -1 -1 2
· Edge detection: An edge is a boundary between two regions with different gray levels. To detect
edges, we can use masks that measure the gradient or the second derivative of the image. The
gradient is the vector that points in the direction of the maximum change in gray level, and its
magnitude indicates the strength of the edge. The second derivative is the rate of change of the
gradient, and its zero crossings indicate the locations of the edges. Some examples of edge
detection masks are:
-1 -2 -1 0 -1 0 0 -1 0 -1 -1 -1
0 0 0 1 0 -1 -1 4 -1 -1 8 -1
1 2 1 0 1 0 0 -1 0 -1 -1 -1
These are the basic techniques for detecting discontinuities in an image. However, there are more
advanced methods that can improve the performance and accuracy of the segmentation, such as edge
linking, boundary detection, and Hough transform.
Local processing operates on small regions or neighborhoods of an image, such as pixels, edges, or
patches. This method is capable of capturing fine details and local variations in an image, making it
suitable for tasks like edge detection, segmentation, and feature extraction. However, it may also be
sensitive to noise and occlusion due to its focus on localized regions.
On the other hand, global processing operates on the whole image or large regions of it, considering
factors like histograms, frequency domains, or shapes. While global processing can capture global
patterns and structures in an image, it may lose some local information and nuances. This approach is
often employed for tasks such as image enhancement, restoration, and compression.
In summary, local processing is adept at handling specific, localized details, while global processing
provides a broader understanding of the overall image characteristics. The choice between these
methods depends on the specific requirements of the image processing task, with a balance often
sought to achieve a comprehensive analysis and manipulation of images.
Some image processing techniques combine both local and global processing to achieve better
results. For example, region-based segmentation can use local processing to grow regions based on
similarity and connectivity, and global processing to merge regions based on shape and size 1. Another
example is image classification, which can use local features to describe the appearance of objects, and
global features to describe the context and layout of the scene.
Variable length coding is a method of data compression that assigns different numbers of bits to
different symbols based on their frequency in the data. This way, the most common symbols can be
encoded with fewer bits, and the less common symbols can be encoded with more bits. This reduces the
average number of bits per symbol, and thus the size of the data.
One example of variable length coding is Huffman coding, which is a type of prefix code. A prefix code is
a code where no codeword is a prefix of another codeword. This makes the code uniquely decodable,
meaning that there is only one way to decode a given bit string.
To construct a Huffman code, we first need to find the frequency of each symbol in the data. Then, we
create a binary tree where each leaf node represents a symbol and its frequency, and each internal node
represents the sum of the frequencies of its children. We start by creating a leaf node for each symbol,
and then we repeatedly merge the two nodes with the lowest frequencies until we have a single root
node. The codeword for each symbol is then obtained by traversing the tree from the root to the leaf,
and appending a 1 for each left branch and a 0 for each right branch.
For example, suppose we want to encode the string “aabacdad” using Huffman coding. The frequency of
each symbol is as follows:
Table
Symbol Frequency
a 4
b 1
c 1
d 2
Treediagram
Table
Symbol Codeword
a 0
Symbol Codeword
b 111
c 110
d 10
0 0 111 0 110 0 10 10
This bit string has 14 bits, whereas the original string would have 24 bits if we used a fixed-length code
of 3 bits per symbol. Therefore, we have achieved a compression ratio of 14/24 = 0.583.
5. Draw the block diagram of basic image compression system & explain about each block
Compression has two types i.e. Lossy and Lossless technique. A typical image compression system
comprises of two main blocks An Encoder (Compressor) and Decoder (Decompressor). The image f(x,y)
is fed to the encoder which encodes the image so as to make it suitable for transmission. The decoder
receives this transmitted signal and reconstructs the output image f(x,y). If the system is an error free
one f(x,y) will be a replica of f(x,y).
The encoder and the decoder are made up of two blocks each. The encoder is made up of a Source
encoder and a Channel encoder. The source encoder removes the input redundancies while the channel
encoder increases the noise immunity of the source encoders. The decoder consists of a channel
decoder and a source decoder. The function of the channel decoder is to ensure that the system is
immune to noise. Hence if the channel between the encoder and the decoder is noise free, the channel
encoder and the channel decoder are omitted.
The three basic types of the redundancies in an image are interpixel, coding redundancies and
psychovisual redundancies. Run length coding is used to eliminate or reduce interpixel redundancies
Huffman encoding is used to eliminate or reduce coding redundancies while I.G.S is used to eliminate
interpixel redundancies. The job of the source decoders is to get back the original signal. The problem
solved by runlength coding, Huffman encoding and I.G.S coding are examples of source encoders and
decoders.
The input image is passed through a mapper. The mapper reduces the interpixel redundancies. The
mapping stage is a lossless technique and hence is an reversible operation. The output of a mapper is
passed through a Quantizer block. The quantizer block reduces the psychovisual redundancies. It
compresses teh data by eliminating some information and hence is an irreversible operation. The
quantizer block uses JPEG compression which means a lossy compression. Hence in case of lossless
compression, the quantizer block is eliminated. The final block of the source encoder is that of a symbol
encoder. This block creates a variable length code to represent the output of the quantizer. The
Huffman code is a typical example of the symbol encoder. The symbol encoder reduces coding
redundancies.
The source decoder block performs exactly the reverse operation of the symbol encoder and the
mapper blocks. It is important to note that the source decoder has only two blocks. Since quantization is
irreversible, an inverse quantizer block does not exist. The channel is noise free and hence have ignored
the channel encoder and channel decoder.
The channel encoder is used to make the system immune to transmission noise. Since the output of the
source encoder has very little redundancy, it is highly susceptible to noise. The channel encoder inserts a
controlled form of redundancy to the source encoder output making it more noise resistant.