0% found this document useful (0 votes)
13 views23 pages

DIP Module 3&4

Uploaded by

shammasshemeem77
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)
13 views23 pages

DIP Module 3&4

Uploaded by

shammasshemeem77
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/ 23

IMAGE COMPRESSION

Image compression is a mapping from a higher dimensional space to a lower


dimensional space. Image compression plays an important role in many multimedia
applications, such as image storage and transmission. The goal of image compression is to
represent an image with minimum number of bits of an acceptable image quality. Image
compression offers ways to represent an image in a more compact way, so that images can be
stored in a compact manner and can be transmitted faster. Compression is achieved through
redundancy and irrelevancy reduction. Redundancy means duplication, and irrelevancy means
the part of the image information that will not be noticed by the human visual system.

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

Spatial redundancy represents the statistical correlation between neighbouring pixels in an


image. Spatial redundancy implies that there is a relationship between neighbouring pixels in
an image.

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.

Lossless Compression or Reversible Compression

In lossless compression, the image after compression and decompression is identical to


the original image and every bit of information is preserved during the decomposition process.
The reconstructed image after compression is an exact replica of the original one. Although
lossless compression methods have the appeal that there is no deterioration in image quality,
this scheme only achieves a modest compression rate. The lossless compression scheme is used
in applications where no loss of image data can be compromised. Lossless compression scheme
is preferred in the case of medical image compression

Lossy Compression or Irreversible Compression

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

An image is linearly transformed to produce a set of linear transform coefficients,


which are usually scalar-quantised and entropy coded for transmission. Thus, transform coding
is a mathematical operation that converts a large set of highly correlated pixels into a smaller
set of uncorrelated coefficients. Transformation is a very useful tool in image compression. It is
used to transform the image data in time domain to frequency domain. By
transforming the data into frequency domain, the spatial redundancies in time domain can be
minimised. The advantage of using transformation is that the energy of the transformed data is
mainly condensed in the low frequency region, and is represented by a few transform
coefficients. Thus, most of these coefficients can be discarded without significantly affecting
the reconstructed image quality.
In a transform coder, the discrete data signal is segmented into non-overlapping blocks,
and each block is expressed as a weighted sum of discrete basis functions. The purpose of
transform coding is to decompose the correlated signal samples into a set of
uncorrelated transform coefficients, such that the energy is concentrated into as few
coefficients as possible. The block diagram of transform-based image coding scheme is shown.

IMAGE-COMPRESSION STANDARD

The objective of an image-compression standard is to enhance the compatibility and


interoperability among systems manufactured by different vendors. JPEG, the Joint
Photographic Experts Group corresponds to the ISO/IEC international standard, digital
compression and coding of continuous-tone still images. The standard
provides a relatively good compression ratio. The most commonly used transform for image
compression is the discrete cosine transform. One of the major reasons for its popularity is its
selection as the standard for Joint Photographic Expert Group (JPEG). The JPEG
standard employs block-based DCT coding. The meaning of block-based technique is that the
transform is not applied to the entire image at a stretch, but it is applied over fixed blocks each
of size usually of 8 × 8 or 16 × 16. The basic encoder and decoder structures used in JPEG
standard are illustrated.

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

In neighbourhood operation, the pixels in an image are modified based on some


function of the pixels in their neighbourhood. The neighborhood operations work with the
values of the image pixels in the neighborhood and the corresponding values of a subimage
(mask, kernel, template, or window) that has the same dimensions as the neighborhood. The
values in a filter subimage are referred to as coefficients, rather than pixels. The process
involves passing a weighted mask, or kernel over the image and replacing the original image
pixel value corresponding to the centre of the kernel with the sum of the original pixel values
in the region corresponding to the kernel multiplied by the kernel weights.

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:
𝑔(𝑥, 𝑦) = 𝑤 (𝑠, 𝑡 ). 𝑓(𝑥 + 𝑠, 𝑦 + 𝑡)

Mean Filter or Averaging Filter or Low-pass Filter

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

Limitations of Averaging Filter


The limitations of averaging filters are given below:
1. Averaging operation leads to the blurring of an image. Blurring affects feature localisation.

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.

For Problems refer Class Notes

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.

FREQUENCY DOMAIN FILTERING

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.

Ideal Lowpass Filter:

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.

Gaussian Lowpass Filter

Gaussian lowpass filter (GLPF) transfer functions have the form

where, D(u,v) is the distance from the center of the frequency


rectangle to any point, (u,v) contained by the rectangle. D0 is the cutoff frequency. The
response of Gaussian lowpass filter is similar to that of Butterworth filter but there are no
ringing effect at all.

HIGHPASS FILTER

Highpass filters are those which attenuates low-frequencies components without


disturbing high-frequencies in the Fourier transform. Because edges and other abrupt changes
in intensities are associated with high-frequency components, image sharpening can be
achieved in the frequency domain by highpass filtering.

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)

Ideal HighPass Filter

A 2D ideal highpass filter is defined as

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.

Gaussian Highpass filter:

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)

The lost information in the degraded image can be mitigated by constraining


the restoration.Constraints add information to the process.Constraints can have additional
information about the original scene. So that the restoration become more faithful
“Constrained restoration is a process of obtaining a meaningful restoration by
biasing the solution towards the minimiser of some specified constraint
function.

Constrained Least Square Filter is a regularization technique which adds the


Lagrange multiplier to control the balance between noise artifacts and
consistency with the observed data.

Constrained Least Square Filter is given as:

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy