You are on page 1of 51

University of Zawia Faculty of Engineering

Dept. of Electrical and Electronic Engineering

Performance of Different Transforms on Image Contour


By: Almadni Ahmed Almadni
Supervisor: prof.Ali Amuri
CHAPTER ONE

INTRODUCTION
1.1 General Background
Image Contour is defined as lines and boundaries of interesting
regions within digital images, including object boundaries and
boundaries of regions defined by sudden changes of brightness,
color or texture. It also described as a curve along boundary of
pixels with the same intensity or depth.
Object boundaries are identified based on how well they
separate foreground and background features. This is followed
by a shape matching step which identifies the object boundary
contours based on their expected shape.
The region of interest contour is determined by the difference
between foreground and background. In conclusion,
Segmentation technique is not robust against compression while
the image contour technique takes a long time to process.
1.1 General Background
Edges are significant local changes in the image and are
important features for analyzing images. Edges typically occur
on the boundary between two different regions in an image.
Edge detection is frequently the first step in recovering
information from images. Several computational models have
been reported in the literature for contour or edge detection in
images.
Robert , Sobel and Prewitt edge detectors, all of which use local
derivative filters to do the boundary detection. Canny edge
detector is one of the well-known edge detection algorithm that
uses sharp discontinuities in the brightness channel to detect
edges.
1.1 General Background

Contour shape representations include global shape


descriptors such as eccentricity and circularity, shape
signatures such as centroid distance and cumulative
angles.
Curvature scale space descriptors (CSSD) . Global shape
descriptors are very inaccurate shape descriptors which
are not suitable for standalone shape descriptors.
Therefore, these representations need further processing
using scale space or using spectral transform such as
Fourier transform, and walsh transform.
1.1 General Background

During the last few years, the theory and applications


of wavelet transforms have been developed.
Wavelets have been found to be very useful in many
scientific and engineering applications including
computer graphics, scientific visualization, data
compression and signal processing.
Wavelet transform has become well known as
powerful tool for image data compression. Different
approaches have been published dealing with the
coding of wavelet coefficients.
1.2 The Research Overview

The Thesis Study will investigate the effect of noise on the


image contour in spectral domain , the suitable method for
contour compression is based on splitting of the contour into
two one-dimensional signals X, and Y with similar number of
points along the contour or length of the contour.
The additive noise effect is applied in the extracted contour
with removing the other objects which are considered as
background and rejection a suitable number of spectral
components and then using the inverse transform the original
contour signals.
1.2 The Research Overview

The contour domain transformation in spectral domain can be


applied using different transforms such as Fourier and Walsh
then their performance will be explained with respect to
different noise levels. The Fast Fourier Transform (FFT) is
assumed to be the implementation of choice.
The wavelet simplest transform which is chosen in this study is
Walsh transform is suitable because it offers less required
storage space, and fast signal reconstruction.
Fourier and Walsh spectra of both of Original Image and The
Noisy Image can be compared using The Root Mean Square
Error (RMSE)
1.3 Research Objectives
1.4 Organization of the Thesis

CHAPTER ONE: concepts of the image contour extraction,


noise effect in the contour spectrum.
CHAPTER TWO: exploration of the main techniques for edge
feature detection of the images. the contour extraction and the
contour coordinates in the image.
CHAPTER THREE: introduces the analysis of image contour
transformation considering noise effect.
CHAPTER FOUR: study of contour recognition technique,
detection and description in spectral domain .
CHAPTER FIVE: simulation with testing the images and
estimating the performance of spectral transforms.
CHAPTER SIX: Conclusions and future work of the thesis
CHAPTER TWO

Contour Extraction
and Description
2.1 Introduction
Contour extraction is obtaining the object outline of target
object from the image of object; it is the key to ensure
measurement accuracy. As to the characteristics that the
images of computer vision measurement often contain only
two targets, the object and the background area, In general,
contour extraction techniques can be classified into two main
categories: region-based, and line-based. Region-based
techniques use similar brightness, color or texture properties to
segment the image into regions and extract contours directly
from the segmented region boundaries. Line-based techniques
use high contrast of luminance, color, or texture to find lines or
boundaries.
2.2 Survey of different methods of
extraction of image contours

Two main approaches:


Object Contour Following (OCF).
Multiple Step Contour Extraction (MSCE).
The OCF methods sequentially detect and extract object
contour edges.
The MSCE methods are referred to as parallel schemes for
object contour extraction. By parallel, it is meant that the
decision of whether or not a point is on an edge is made on
the basis of the gray level of the point and its neighbors.
2.2.1 Object Contour Following (OCF)

also called Bug Following, can be used to trace (follow) the


contour edges of a 2-D digital image.

The extraction procedure consists of finding a starting point and


then cross the edge between then white and black regions.
2.2.2 Multiple Step Contour Extraction (MSCE)

the gradient between two pixels with different gray scale levels
represents the difference between the two pixels, and the gradient will
be zero for the pixels with the same gray scale level.
The main steps of the MSCE methods:
a) Edge Detection

Pixel numbering for 2x2 Pixel numbering for 3x3


edge detecting operators edge detecting operators.
b) Gradient Operators:
(a) Original image,

(b) Prewitt gradient Operator,

(c) Roberts crossgradient operator,

(d) Sobel gradient operator,

(e) Prewitt compassoperator,

(f - h) Three types of Laplacian operators


2.2.3 Object-oriented Contour Extraction OCE

is based on 4x4 pixels window structure to extract the object


contours by the four central pixels
The extracted contours from objects using this procedure are
near the image boundary.

(a) (b)
OCE procedure (a)Without correcting the first step and
(b)After correcting the first step
2.2.4 Single Step Parallel Contour Extraction
‘SSPCE’ (3x3 windows)
There are two algorithms; the first uses 8-connectivity scheme
between pixels, The second algorithm uses the 4-connectivity
scheme between pixels
The edges can be extracted by applying the definition that an
object contour edge is a straight line connecting two neighboring
pixels which have both a common neighboring object pixel and
a common neighboring underground pixel.
no edges can be extracted from the three following cases:
1- If all nine pixels are object pixels object region.
2- If all nine pixels are background pixels.
3- If the center pixel is an object pixel surrounded by
background pixels.
2.2.5 Contour Extraction Based on 2x2 Windows

This algorithm is mainly used for gray scale images. It uses a


smaller window for contour extraction than its predecessors

Pixel numbering for 2x2 windows

The processed pixel is the darker one. Two buffers are required
for a real time contour extraction system. First buffer is used for
the storage of a previously processed image line and the second
one keeps pixel values of the currently processed image line.
2.2.5 Comparison of Contour Extraction
Algorithms (Different Windows)

(a) (b) (c)


Test images (a) Circle
(b) Square Extracted contours using (a) Contour
(c) E letter extraction(2x2 windows) (b) SSPCE method
(3x3 windows) (c)OCE method (4x4 windows)
Number of operations versus number of edges for the all
algorithms for the shapes of (a) Circle (b) Square (c) E letter
2.3. Contour Description

, object descriptors are referred to object representations which give ways of


describing object properties or features.

Polar representation Polar representation Cartesian representation


CHAPTER THREE

Spectral Domain of
Image Contours
3.1 Introduction

The idea behind transform coding method is to represent


the original signal with a small number of transform
coefficients. In typical images, Transform Techniques have
an important property to reduce the distortion at an
acceptable level by minimizing the number of transform
coefficients.
There are different image contour transforms (Fourier/
Discrete Cosine Transform (DCT) / Walsh/ Haar) which
widely applied to both contour x- and y- coordinates of
pixels. In a transformed image, low frequency elements
correspond to smoothness of an image and high frequency
elements are responsible for texture and edges .
3.2 Spectral Transform of image contours

The structure and features of the given image contour may


be better understood by transforming the data into another
domain. There are several transforms available like the
Fourier transform, and wavelet transform.
Spectral Transform is major component of image
processing applications. It is based on the fact that pixels in
an image exhibit a certain level of correlation with their
neighboring pixels.
Transform based techniques use a reversible linear
mathematical transform to map the pixel values as a set of
coefficients which are then quantized and encoded.
3.2 Spectral Transform of image contours

Fourier Transform:
The Fourier transform of a discrete function of one variable

Similarly, given F(u), we can obtain the original function


back using the inverse DFT:

Where M and N are the number of samples in the first and


second dimensions (x and y), respectively, which are
considered are equal for simplicity.
3.2 Spectral Transform of image contours

Discrete Cosine Transform (DCT) :


The DCT is similar to the discrete Fourier transform (DFT)
in order to transforms a signal or image from the spatial
domain to the frequency domain.

The two-dimensional block of the input signal :

64 (8 x 8) DCT basis functions


3.2 Spectral Transform of image contours

Walsh Transform:
The Walsh functions form an orthogonal and complete set
of functions representing a discretized function.
The Walsh transformation W(u, v) is a separable and
symmetric one which has the following form in 2D:

where f(x, y) is the intensity of the pixel with the coordinates (x, y) in the
original binary image. The size of the image f is N × N
3.2 Spectral Transform of image contours
Haar Transform:
The Haar wavelet is the simplest possible wavelet.
The 2-Dimensional Haar Transform

The Haar transform matrix with size 8 x 8


3.3Contour Image Noise Performance in
Transform Domain

The degradation model is represented the imaging system


which introduces additive noise n(x,y) to the blurred image.
The result of the acquisition is the degraded output image
g(x,y)

Where h (x,y) is the spatial representation of the degradation function


and, the symbol "*" indicates convolution operation.
3.3Contour Image Noise Performance in
Transform Domain

Power spectral density (PSD) is a function that measures


the distribution of power of a random signal with frequency
which has different characteristics work with multiple noise
models

Adding noise to the image using (a) Gaussian noise (b)


Rayleigh noise (c) Gamma noise (d) Exponential noise
(e) Uniform noise (f) Pulse Noise
3.3Contour Image Noise Performance in
Transform Domain

(a) original image of “car” (b) image contour (c) image Fourier spectrum (d) adding noise
to the image Fourier spectrum (e) image Walsh spectrum (f) adding noise to the image
Walsh spectrum (g) image spatial domain where the noise added to its Fourier spectrum
(h) image spatial domain where the noise added to its Walsh spectrum
CHAPTER FOUR

Contour Recognition
Experimental Work Flowchart
CHAPTER FIVE

Experimental Results
5.1 Introduction

The study work will describe a MATLAB realization of a


noise effect in the image contour spectra. The aim of this
work is to deeply investigate the behavior of noise applied
on two image transform methods Fourier and Walsh
transforms.
The method which used to recognize the image contour is
object boundaries tracing method, this method is based on
the rapid change in the pixel intensity, so the exterior
boundaries of objects are detected, as well as boundaries
of holes inside these objects, then the outermost object is
considered as the contour and rest of image is considered
as a background.
The original image of “cat”, correspondent binary image and its contour extracted

The image contour is restored where the noise is added to its spectrum with SNR of 15, 20, 25, 30, 35, 40, and 45dB

Inverse Fourier Transform Inverse Walsh Transform


Signal Representation of Original x-points, contour Original y-points contour, Adding noise with SNR = 15dB to
x-points contour, and Adding noise with SNR = 15dB to y-points contour

Signal Representation of Adding noise with SNR = 40dB to x-points contour, and Adding noise with SNR = 40dB
to y-points contour , Adding noise with SNR = 45dB to x-points contour, and Adding noise with SNR = 45dB to
y-points contour
Fourier Transform Walsh Transform

(a) Original x-points contour (b) Original y-points contour (c) Adding noise with SNR = 15 dB to x-points contour (d)
Adding noise with SNR = 15 dB to y-points contour (e) Adding noise with SNR = 20 dB to x-points contour (f) Adding
noise with SNR = 20 dB to y-points contour
5.2 Comparison Analysis

The RMSE formula for calculated image matrices are:

Where:

f (x, y) is the input image data

f*(x, y) is block of the reference image.


M and N are the matrix dimensions in x and y, respectively
Comparison Results (cat image)
Comparison Results (sunglasses image)
Comparison Results (sofa image)
CHAPTER SIX

Conclusions
Conclusion
• For different sample images, the contour is detected by
tracing the variation of pixels in closed line representing
the object exterior boundaries (object edges).
• The description of the extracted contours has been
provided based on splitting of the contour into two one-
dimensional signals X, and Y.
• The image contour recognition approach which is used
in this thesis is based on object boundaries tracing by
detecting rapid change in the pixel intensity
• The effect of noise on the contour has been investigated,
by selecting two spectral transform methods (Fourier and
Walsh).
Conclusion
• To obtain the contour spectrum the transform technique
is applied to the original contour and when it is effected
by the noise with different levels of signal to noise ratio
from 15 to 45 dB
• Performance of the two transforms is compared using
Root Mean Square Error (RMSE) as a performance
measure with respect to SNR values. Experimental
results prove that RMSE is reduced and get closer to
zero as the SNR increases and the performance of the
Fourier transform is better than that provided by Walsh
Transform.
Future Work

• The thesis work could be extended with new computational


techniques of filtering such as Butterworth or Chebyshev filters,
which has the ability to observe the noise effect and minimize
the errors to restore the contour much closer to the original.
• Also using a developed methods of domain transformations such
wavelets and piece-wise linear (PWL) is more efficient to get a
better performance in error reduction including the widely used
filter types such as Haar and Wiener Filters
Thank You

You might also like