DIP Module 3&4
DIP Module 3&4
REDUNDANCY IN IMAGES
Redundancy can be broadly classified into (i) statistical redundancy, and (ii) psychovisual
redundancy.
Statistical redundancy can be classified into (a) interpixel redundancy, and (b) coding
redundancy. Interpixel redundancy can be further classified into (1) spatial redundancy, and (2)
temporal redundancy.
Statistical Redundancy
As stated, statistical redundancy can be classified into two types: (i) interpixel redundancy, and
(ii) coding redundancy.
Interpixel redundancy is due to the correlation between neighbouring pixels in an image. It
means that the neighbouring pixels are not statistically independent.
Coding redundancy is associated with the representation of information. The information is
represented in the form of codes. The Huffman code and arithmetic codes are some examples
of codes.
Spatial Redundancy
Temporal Redundancy
Temporal redundancy is the statistical correlation between pixels from successive frames in a
video sequence. The temporal redundancy is also called interframe redundancy.
Psychovisual Redundancy
Psychovisual redundancy is associated with the characteristics of the human visual system
(HVS). In the HVS, visual information is not perceived equally. Some information may be
more important than other information. If less data is used to represent less important visual
information, perception will not be affected.
CLASSIFICATION OF IMAGE-COMPRESSION SCHEMES
Image-compression schemes can be broadly classified into two types: (i) lossless compression
scheme, and (ii) lossy compression scheme.
In lossy compression, the reconstructed image contains degradations with respect to the
original image. Here, a perfect reconstruction of the image is sacrificed by the elimination of
some amount of redundancies in the image to achieve a higher compression ratio. In lossy
compression, a higher compression ratio can be achieved when compared to lossless
compression. Lossy compression scheme is preferred in the case of multimedia applications.
RUN-LENGTH CODING
Run-length coding (RLC) is effective when long sequences of the same symbol occur.
Run-length coding exploits the spatial redundancy by coding the number of symbols in a run.
The term run is used to indicate the repetition of a symbol, while the term run-length is used to
represent the number of repeated symbols. Run-length coding maps a sequence of numbers into
a sequence of symbol pairs (run, value). Images with large areas of constant shade are good
candidates for this kind of compression. Run-length coding is used in the Windows bitmap file
format. Run-length coding can be classified into (i) 1D run-length coding, and (ii) 2D run-
length coding.
TRANSFORM-BASED COMPRESSION
IMAGE-COMPRESSION STANDARD
The input image is partitioned into an 8 × 8 sub-block. The FDCT (Forward Discrete
Cosine Transform) is computed on each of the 8 × 8 blocks of pixels. The FDCT processing
step lays the foundation for achieving data compression by concentrating most of the signal in
the lower spatial frequencies. The 64 DCT coefficients are scalarquantised using uniform
quantisation tables based upon psychovisual experiments. After the DCT coefficients are
quantised, the coefficients are ordered according to the zigzag scan as shown in Fig. 9.39. The
purpose of zigzag scanning is based upon the observation that most of the high-frequency
coefficients are zero after quantisation. The resulting bit stream is run-length coded to generate
an intermediate symbol sequence, and then these symbols are Huffman coded for transmission
or storage. To perform JPEG decoding, the reverse process of coding is applied, that is, the
encoded data stream is entropy decoded and passed through a reverse zigzag table in order to
generate a 2D array. This array is then rescaled using the quantising factor and then passed
through Inverse DCT.
LOCAL OR NEIGHBOURHOOD OPERATION
The process consists simply of moving the filter mask from point to point in an image.
At each point (x, y), the response of the filter at that point is calculated using a predefined
relationship. The response is given by a sum of products of the filter coefficients and the
corresponding image pixels in the area spanned by the filter mask. In general, linear filtering of
an image f of size M x N with a filter mask of size m x n is given by the expression:
𝑔(𝑥, 𝑦) = 𝑤 (𝑠, 𝑡 ). 𝑓(𝑥 + 𝑠, 𝑦 + 𝑡)
The mean filter replaces each pixel by the average of all the values in the local
neighbourhood. The size of the neighbourhood controls the amount of filtering. In a spatial
averaging operation, each pixel is replaced by a weighted average of its neighbourhood pixels.
The low-pass filter preserves the smooth region in the image and it removes the sharp
variations leading to blurring effect. The 3 by 3 spatial mask which can perform the averaging
operation is given below:
1 1 1 1 2 1
3 by 3 low-pass spatial mask = × 1 1 1 another 3 by 3 mask is × 2 4 2
1 1 1 1 2 1
1 1 1 1 1
⎡1 1 1 1 1⎤⎥
⎢
Similarly, the 5 by 5 averaging mask = × ⎢1 1 1 1 1⎥
⎢1 1 1 1 1⎥
⎣1 1 1 1 1⎦
It is to be noted that the sum of the elements is equal to 1 in the case of a low-pass spatial mask
2. If the averaging operation is applied to an image corrupted by impulse noise then the
impulse noise is attenuated and diffused but not removed.
3. A single pixel with a very unrepresentative value can affect the mean value of all the pixels
in its neighbourhood.
Median filters
Median filters are statistical non-linear filters that are often described in the spatial
domain. A median filter smoothens the image by utilising the median of the neighbourhood.
Median filters are particularly effective in the presence of impulse noise, also called salt-and-
pepper noise Median filters perform the following tasks to find each pixel value in the
processed image:
1. All pixels in the neighbourhood of the pixel in the original image which are identified by the
mask are sorted in the ascending (or) descending order.
2. The median of the sorted value is computed and is chosen as the pixel value for the
processed image.
The frequency domain methods of image enhancement are based on convolution theorem. This
is represented as, g(m, n) = h (m, n)*f(m,n)
Where.
g(m, n) = Resultant image
h(m, n) = Impulse response of Filter
f(m, n)= Input image
The Fourier transform representation of equation above is, G (u, v) = H (u, v).F (u, v)
The function H (u, v) in equation is called transfer function of the filter It is used to boost the
edges of input image f (m, n) to emphasize the high frequency components.
LOWPASS FILTER:
The edges and other sharp transitions (such as noise) in the gray levels of an image
contribute significantly to the high-frequency content of its Fourier transform. Hence Low pass
filtering/blurring (smoothing) is achieved in the frequency domain by attenuating edges and
other sharp transitions from the transform of a given image.
A 2-D ideal lowpass filter (ILPF) is one whose transfer function satisfies the relation
where D0 is a specified nonnegative quantity, and D(u, v) is the distance from point (u, v) to
the origin of the frequency plane;
The lowpass filters are radially symmetric about the origin. For an ideal lowpass filter cross
section, the point of transition between H(u, v) = 1 and H(u, v) = 0 is often called the cutoff
frequency. The sharp cutoff frequencies of an ideal lowpass filter cannot be realized with
electronic components, although they can certainly be simulated in a computer.
Butterworth Lowpass filter:
The transfer function of the Butterworth lowpass (BLPF) of order n and with cutoff frequency
at a distance Do, from the origin is defined by the relation.
Where D(u,v) is the distance from the center of the frequency rectangle to any point, (u,v ),
contained by the rectangle and D0 is the cutoff frequency.
Unlike the ILPF, the BLPF transfer function does not have a sharp discontinuity that
establishes a clear cutoff between passed and filtered frequencies. As the order of filter goes on
increasing, a small amount of ringing effect does creep in.
HIGHPASS FILTER
Subtracting a lowpass filter transfer function from 1 yields the corresponding highpass filter
transfer function in the frequency domain:
Hhp(u,v) = 1- Hlp(u,v)
where D0 is the cutoff frequency, and D(u,v) is the distance from point (u, v) to the origin of
the frequency plane;
Butterworth Highpass filter:
The transfer function of a Butterworth highpass filter (BHPF) transfer function is given by
The high pass Butterworth filter does not have a sharp Cut-off ie, the transition is smooth and
hence there are no ringing effects.
The transfer function of a Gaussian highpass filter (GHPF) transfer function is given by
MODULE - 4
Constrained restoration with Lagrange multiplier (Constrained Least Square Filter)
H*(k,l)
F(k,l)= G(k,l)
|H(k,l)|2 + λ|P(k,l)|2
Where P(k,l) is the Laplacian filter and has larger amplitudes at high
frequencies where the noise will dominates.Which reduces noise at high frequencies. Proper
choice of P(k,l) and λ will reduce noise by minimizing higher order derivatives.