0% found this document useful (0 votes)
7 views

4 Chapter2

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)
7 views

4 Chapter2

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/ 45

BIM 33203

IMAGE PROCESSING
CHAPTER 2: IMAGE TRANSFORMATION

ALPINE SKI HOUSE


OUTLINE

▪ Image transforms
▪ Convolution
▪ Fourier series and transform
▪ Wavelets
▪ Filters

ALPINE SKI HOUSE 2


IMAGE TRANSFORMS

▪ All image processing approaches discussed thus far


operate directly on the pixels of the input image;
➢ that is, they work directly in the spatial domain
▪ In some cases, image processing tasks are best
formulated by transforming the input images,
carrying the specified task in a transform domain,
and applying the inverse transform to return to the
spatial domain
IMAGE TRANSFORMS
▪ Transformation is a function
➢ that maps one set to another set after
performing some operations
▪ Image transforms are the foundation of image
processing and analysis
▪ By applying transformation procedure, we get
another image of similar size
▪ When applying ‘Inverse Transform’, we get the
original image
IMAGE TRANSFORMS
▪ Image transforms are used in
➢ pre-processing – filtering, enhancement, etc.
➢ data compression
➢ restoration and reconstruction
➢ feature extraction - edge detection, region
extraction, etc.
IMAGE TRANSFORMS
▪ A particularly important class of 2-D linear transforms, denoted T(u, v),
can be expressed in the general form of:

Eq. (1)

➢ f(x, y) is the input image


➢ r(x, y, u, v) is called the forward transformation kernel
➢ equation above is evaluated for u = 0, 1, 2, …, M – 1 and v = 0, 1, 2,
…, N – 1
➢ x and y are spatial variables
➢ M and N are the row and column dimensions of f
➢ variables u and v are called the transform variables
➢ T(u, v) is called the forward transform of f(x, y)
IMAGE TRANSFORMS

▪ With a given T(u, v) , we can recover f(x, y) using the inverse


transform of T(u, v)

Eq. (2)

▪ For x = 0, 1, 2, …, M - 1 and y = 0, 1, 2, ..., N - 1, s(x, y, u,


v) is called the inverse transformation kernel
▪ Together, Eq. (2) and (1) are called a transform pair
IMAGE TRANSFORMS

▪ The basic steps for performing image processing in the linear


transform domain:
➢ (1) transform the image
➢ (2) carry the task(s) in the transformed domain
➢ (3) apply inverse transform to return to the spatial domain
IMAGE TRANSFORMS
(a) Image corrupted by (a) (b)
sinusoidal interference.
(b) Magnitude of the
Fourier transform
showing the bursts of
energy responsible for
the interference.
(c) Mask used to
eliminate the energy (c) (d)
bursts.
(d) Result of computing
the inverse of the
modified Fourier
transform. (Original
image courtesy of
NASA.)
CONVOLUTION

▪ Convolution is a mathematical way to combine two signals


to generate a third signal
▪ Convolution is a general-purpose filter effect for images
▪ Convolution is a matrix applied to an image and a
mathematical operation comprised of integers
▪ It works by determining the value of a central pixel by
adding the weighted values of all its neighbours together
▪ The output is a new modified filtered image
CONVOLUTION

▪ Why convolve an image?


➢ blurring
➢ sharpening
➢ edge detection
➢ noise reduction
CONVOLUTION
▪ A convolution is done by multiplying a
pixel’s and its neighbouring pixels
colour value by a matrix Example of a kernel
▪ Kernel: A kernel is usually a small
matrix of numbers that is used in 0 1 0
image convolutions
1 1 1
▪ Different size of kernels may contain
different patterns of numbers and 0 1 0
produce different results under
convolution
▪ The size of a kernel is arbitrary but
3x3 is often used
CONVOLUTION
▪ Any input signal can be represented by an infinite sum of shifted
and scaled impulses:

▪ Convolution:

▪ Continuous:
CONVOLUTION
▪ Output function is a scaled shifted version of impulse response
▪ , * - convolution operator ; h(x) – convolution kernel or filter
▪ If h(x) = (x) , then we have an ideal filter (output = input)
▪ Usually h(x) extends over several neighbours
▪ Discrete convolution:

▪ g(x) is a continuous convolution summation to compute at particular


values at x
CONVOLUTION: EXAMPLE 1
Input image Output image
2 4 6 7 9 Kernel/filter 52 a b c d

8 10 12 3 5 9 8 7 e F G h i

14 16 18 1 6  6 5 4 = j k L m n

20 22 24 4 7 3 2 1 o p q r s

26 28 30 2 3 t u v w x

▪ The box in red colour is the mask (or filter or kernel), and the values in red
are the values of the mask.
▪ The grey colour box and its values belong to the input image. Now for the
first pixel of the input image, the value will be calculated as:
First pixel = (5*2) + (4*4) + (2*8) + (1*10)
= 10 + 16 + 16 + 10
= 52
▪ Place 52 in the original image at the first index and repeat this procedure
for each pixel of the image
CONVOLUTION: EXAMPLE 2 (AVERAGING)

 New pixel colour/value =


932/5
= 186.4
= 186
CONVOLUTION: SAMPLE OF KERNELS
Other kernel examples
1. Blurring 2. Sharpening
CONVOLUTION

▪ Start out with an image


▪ The choice of kernel affects the output image
▪ Base your choice of kernel on the desired results for the image (smooth, blur,
enhance, sharpen)
▪ Remember! The output will always be integers
FOURIER SERIES &TRANSFORM

▪ Frequency domain analysis


➢ until now, all the domains in which we have discussed, we
analyse it with respect to time. But in frequency domain we
don’t analyse signal with respect to time, but with respect
of frequency
▪ Difference between spatial domain and frequency domain
➢ in spatial domain, we deal with images as it is. The value of
the pixels of the image change with respect to scene.
Whereas in frequency domain, we deal with the rate at
which the pixel values are changing in spatial domain
FOURIER SERIES &TRANSFORM

▪ Spatial domain
Output image
matrix

▪ Frequency domain
FOURIER SERIES & TRANSFORM
FOURIER SERIES & TRANSFORM

▪ Fourier was a French mathematician, born in 1768


▪ He published Fourier series and Fourier transform - to
convert a signal into frequency domain
▪ Fourier series simply states that, periodic signals can be
represented into sum of sines and cosines when multiplied
with a certain weight. It further states that periodic signals
can be broken down into further signals with the following
properties:
➢ the signals are sines and cosines
➢ the signals are harmonics of each other
FOURIER SERIES

The function at the bottom is the sum of the four functions above it
FOURIER SERIES

dx dy

du dv
FOURIER TRANSFORM

▪ The Fourier transform states that the non periodic signals


whose area under the curve is finite, can also be
represented into integrals of the sines and cosines after
being multiplied by a certain weight
▪ The Fourier transform has many wide applications which
include, image compression (e.g. JPEG compression),
filtering and image analysis
▪ Fourier series is applied on periodic signals and Fourier
transform is applied for non periodic signals
FOURIER TRANSFORM

Periodic vs non-periodic signals


FOURIER TRANSFORM
FOURIER TRANSFORM

Sample applications
WAVELETS
▪ In real world, data or signals ▪ Images with smooth regions
frequently exhibit slowly interrupted by edges or
changing trends or oscillations abrupt changes in contrast
punctuated with transients
WAVELETS
▪ These abrupt changes are often the most interesting parts of the
data both perceptually and in terms of the information they
provide
▪ The Fourier transform is a powerful tool for data analysis.
However, it does not represent abrupt changes efficiently, i.e.:
➢ the Fourier transform represents data as a sum of sine waves
which are not localized in time or space
➢ the sine waves oscillate forever
WAVELETS
▪ Therefore, to accurately analyze signals and images that have
abrupt changes, a new class of functions that are well localized in
time and frequency need to be used
▪ A wavelet is a rapidly decaying wave like oscillation that has
zero mean unlike sinusoids which extends to infinity
▪ A wavelet exists for a finite duration
▪ Wavelet come in different sizes and
shapes

=
WAVELETS
▪ A key strength of
wavelet analysis is to
choose the right
wavelet
➢ need to consider the
application you will
use it for
▪ 2 important wavelet
transform concepts:
scaling and shifting (or
translation)
WAVELETS
▪ Signal of wavelet, Ψ(t):
➢ scaling refers to the process of stretching or shrinking the
signal in time which can be expressed as follows, where:

❖ s is a scaling factor which is a positive value;


❖ corresponds to how much a signal is scaled in time
WAVELETS

▪ Scaling the sine wave by two:


➢ reducing its original frequency by half
WAVELETS
▪ For a wavelet there is a reciprocal relationship between the
scale and the frequency with a constant of proportionality
▪ Constant of proportionality is called the center frequency of
the wavelet
WAVELETS

▪ Comparison of a wavelet with a sine wave of same


frequency
WAVELETS

large scale factor


low frequency

small scale factor


high frequency
WAVELETS
▪ Shifting a wavelet : delaying or advancing the onset of the
wavelet along the length of the signal
▪ A shifted wavelet represented using the following formulation:

▪ Which means that the wavelet is shifted and centered at k


▪ We need to shift the wavelet to align with the feature we are
looking for in a signal
WAVELETS
▪ Wavelet transforms:
➢ continuous wavelet transform
➢ discrete wavelet transform
▪ These transforms differ based on how the wavelets are scaled
and shifted
➢ applications include:
❖ continuous wavelet: ❖ discrete wavelet:
✓ time frequency analysis ✓ de-noising
✓ filtering of time localized ✓ compression
frequency components ✓ image fusion

FILTERS
▪ Most images (to some extent) are affected by noise:
➢ that is unexplained variation in data
➢ disturbances in image intensity which are either
uninterpretable or not of interest
▪ Image analysis is often simplified if this noise can be filtered
out
▪ In signal processing, the meaning of the term filter is to
include operations which accentuate features of interest in
data
▪ Filter is a process that removes some unwanted components or
details in an image
FILTERS
▪ In image processing filters are mainly used to suppress either:
➢ the high frequencies in the image, i.e. smoothing the image;
OR
➢ the low frequencies, i.e. enhancing or detecting edges in the
image
▪ An image can be filtered either in the frequency or in
the spatial domain
▪ Filters provide an aid to visual interpretation of images and can
also be used as a precursor to further digital processing (such as
segmentation)
FILTER – SPATIAL DOMAIN
▪ The application of filter is similar to the
approach of convolution, in which a
filter mask (of size 3x3, 5x5, 7x7, etc.)
with different masking configuration is
applied to the image
➢ consist of 2 step:
❖ a neighbourhood pixels
❖ a predefined operation
performed on image pixels
➢ filtering generates a new pixel value
▪ Smoothing and sharpening are some of
the example of spatial domain filters
▪ Smoothing filters can be divided into
linear and non-linear filter
FILTER – FREQUENCY DOMAIN
▪ Modification (or image enhancement) is done via Fourier transform or
wavelet transform of an image

▪ The most common image transform is to take spatial data and transforms it
into a frequency data
▪ Low-pass filter and high-pass filters are some of the basic frequency
domain filters
THAT’S ALL!
END OF CHAPTER 2

ALPINE SKI HOUSE

You might also like