Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of...

73
Weighting-Adjacent-Region Segmentation and Application to Image Vectorisation Master’s Thesis of Xu Xiang Dong January 2007 University of Nottingham Malaysia Campus Faculty of Engineering & Computer Science Supervisor: Dr. Michael Hartley Dr. Qussay Salih

Transcript of Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of...

Page 1: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Weighting-Adjacent-Region Segmentation and Application

to Image Vectorisation

Master’s Thesis of

Xu Xiang Dong

January 2007

University of Nottingham Malaysia Campus

Faculty of Engineering & Computer Science

Supervisor: Dr. Michael Hartley

Dr. Qussay Salih

Page 2: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Abstract

The use of vector drawing has long been practiced in the field of

Computer-Aided Design. Hence, research on Image Vectorisation has been an

active topic for both engineering drawing and coloured image. However, the

needs for identifying regions of interest while vectorising the image are also

undeniably important. This process of subdividing an image into its

constituent parts and extracting these parts of objects is widely known as

Image Segmentation.

Image Segmentation is one of the problems of image processing for which

there is still no general-purpose solution approaching human-level

competence. In order to obtain a meaningful segmentation, the higher level

descriptions of the objects and often also of the relations among them must

be taken into account. Generally, research on the typical segmentation tasks

involves edge detection, region segmentation, and detection of curvilinear

structures.

This research concentrates on discovering and applying a mathematical

analysis with algorithms applied and implemented in finding a better image

vectorisation approach. An improved Weighting-Adjacent-Region

Segmentation technique is devised and integrated into BATIK application

applicable particularly to Image Vectorisation. In addition, experimental

results demonstrate that this technique performs better and shows improved

results than the existing techniques.

Page 3: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Table of Contents

1. Introduction 1

2. Background Studies 4

2.1 Image Vectorisation 4

2.2 Image Segmentation 5

2.2.1 Reviews on Image Segmentation 6

2.2.1.1 Histogram Thresholding 6

2.2.1.2 Edge-based Segmentation 7

2.2.1.3 Region-based Segmentation 8

• Region Growing 8

• Split and Merge Algorithm 9

• Data Clustering 10

2.2.2 Reviews on Evaluation Techniques of

Image Segmentation 17

2.2.3 Reviews on Border Tracing Technique 19

3. Methodology 21

3.1 Overview of BATIK 22

3.2 Colour Space Conversion 24

3.3 Discontinuity-Preserving Smoothing 25

3.3.1 Bilateral Filtering 26

3.3.2 Mean-Shift Filtering 31

3.4 WAR (Weighting Adjacent Regions) Segmentation 34

3.4.1 Building Region Adjacent Graph (RAG) 34

3.4.2 Weighting Adjacent Regions (WARs) 38

3.4.3 Merging Adjacent Regions 40

3.5 Region Pruning 45

Page 4: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

3.6 Region Border Tracing 47

4. Experimentation and Evaluation 51

4.1 Results Evaluation 52

4.1.1 Comparison between WAR and Mean-Shift

based Segmentation 53

4.1.2 Comparison among WAR, CorelTrace, and

BitmapTrace 55

5. Conclusion 57

6. Bibliography 59

7. Appendices 64

List of Tables

Table 1. Comparison among WAR, CorelTrace, and BitmapTrace

56

List of Figures

Figure 1. The Flow of BATIK application 23

Figure 2. An illustration of building the initial RAG map 37

Figure 3. Two different Regions-Merging approaches 41

Figure 4. Proposed Regions-Merging approach 42

Figure 5. Tracing steps based on conventional look-up table 48

Figure 6. The proposed look-up table 49

Figure 7. Tracing result by using proposed look-up table 49

Figure 8. Ethnic-Lady (a) Original (b, b’) Mean-Shift Segmented

(c, c’) WAR Segmented 53

Figure 9. Ethnic-Lady (c, c’) WAR Segmented (d, d’) Corel-

Trace Segmented (e, e’) BitmapTrace Segmented 55

Page 5: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Figure 10. Landscape images (a) Original (b, c) WAR segmented

65

Figure 11. House images (a) Original (b, c) WAR segmented 65

Figure 12. Fruit images (a) Original (b, c) WAR segmented 66

Figure 13. Flower images (a) Original (b, c) WAR segmented 67

Figure 14. Flamingo images (a) Original (b, c) WAR segmented 68

List of Algorithms

Algorithm 1. Bilateral Filtering 31

Algorithm 2. Labelling pixels in image 36

Algorithm 3. Building first level RAG map 38

Algorithm 4. Weighting Adjacent Regions 40

Algorithm 5. Merging Adjacent Regions 44

Algorithm 6. Region Pruning 46

Algorithm 7. Extended Boundary Tracing 50

Page 6: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

1. Introduction

Vector drawing is the main course of Computer-Aided Design (CAD) for

both engineering design and graphics design. Unlike raster image or bitmap,

or digital image where graphics are represented by a collection of pixels,

vector image uses geometrical objects such as lines, curves, and polygons

with editable attributes such as colour, fill, and outline to represent image.

It is worth noting that choosing vector images over raster images has

indeed brought certain benefits. Vector images can be easily stored,

manipulated or analysed. It even closely mimics the human brain in

interpreting visual world. Unfortunately, computers are only able to perceive

raster image rather than vector image, therefore the conversion between

raster image and vector image is very significant. This conversion is believed

to bridge the understanding gap from computer’s perspective to human’s

perspective.

Image Vectorisation, which is a process of converting raster image to

vector image, has been a research topic for both engineering drawing (most

of the drawing covers binary or grey scale image) and colour image. This can

be seen from the amount of research work to devise algorithms and software

packages in solving the problem of Vectorisation, such as Dori and Liu [1],

Nieuwenhuizen et al. [2], Jimenez and Navalon [3], Tombre and Tabbone [4],

Ju and Hong [5], and Valiente et al. [6]. The works from [1, 2, 3, 4] are

applicable to engineering drawing that mostly concentrate on binary or grey

scale image. On the other hand, [5, 6] focus on artificial kind of colour image

such as cartoon and textile pattern.

1

Page 7: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

This research work devises an Image Vectorisation technique (which also

involves Image Segmentation) that can be applied not only to artificial image

but also real image to be used in computer graphic design. Moreover, the

vectorisation result needs to be as reliable as possible in terms of both shapes

and colour of objects. Hence, it is understood that the needs for identifying

regions of interest while vectorising the image are also undeniably important,

and this is widely known as Image Segmentation.

Therefore, a research work is proposed to develop an improved

Weighting-Adjacent-Region Segmentation technique applicable to Image

Vectorisation, particularly on two-dimensional colour images such as a

photograph of a natural scene or an artificial image to be used in computer

graphics design. To show the reliability of the proposed technique, an

experimental BATIK application is developed and results demonstrate that the

technique performs better with improved results over the existing

segmentation techniques.

The presentation of this thesis is organised as follows. Chapter 2 covers

literature reviews and background studies on the Image Vectorisation and

Image Segmentation. Chapter 3 presents an in-depth discussion on the

overview flow of the colour Image Vectorisation application and the processes

inside Weighting-Adjacent-Regions (WAR) segmentation. Chapter 4

elaborates the newly devised distinct set of evaluation criteria and the

experimentation conducted to compare the results generated by EDISON

(Mean-shift based Segmentation) [10, 11, 17], CorelTrace (©Corel Draw),

and BitmapTrace (©Macromedia). Chapter 5 concludes the findings and

outlines future direction. Finally, chapter 6 shows the list of references used

2

1. Introduction

Page 8: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

in this research study and chapter 7 includes other samples of images

experimented with WAR segmentation approach.

3

1. Introduction

Page 9: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

2. Background Studies

In the following sections, comprehensive discussions on the theoretical

studies, empirical work and the state of art in the domains of Image

Vectorisation and Image Segmentation are presented. Discussions on the

techniques, and processes involved in these domains are both elaborated in

detail.

2.1 Image Vectorisation

In order to accommodate the various requirements in image vectorisation,

there are numerous different studies that come out with approaches to do

raster to vector conversion. Liu and Dori [7] have identified that the basic

method or Crude Vectorisation has to be as accurate as possible. Hence, the

method needs to preserve the original shapes of the graphic objects in the

raster image. Moreover, they have classified Crude Vectorisation method into

six categories: Hough Transform based, Thinning based, Contour based, Run-

graph based, Mesh-pattern based, and Sparse-pixel based. Other work such

as Tombre et. al. [8] have also devised the steps involved in the Crude

Vectorisation are: to find the lines in the original raster image; to

approximate the lines found into a set of vectors; to not only perform some

post-processing but also find better positions for the junction points; to merge

some vectors and remove some others, etc.; and to find the circular arcs.

However, the methods and steps outlined are particularly aimed at

engineering drawing. Therefore, they might not be suitable for very complex

colour image, such as natural scene image.

4

Page 10: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

The vectorisation technique proposed in this research mainly focuses on

two-dimensional colour image such as a photograph of natural scene or

artificial image to be used in computer graphics design. The suggested

examples of computer graphic design may range from batik pattern design,

cartoon design, and etc. Therefore the vectorisation result needs to be as

reliable as possible in terms of both shapes and colour of objects. It is

believed that colour image segmentation can be one of the optimal choices as

a core technique to do raster-to-vector conversion. This is due to fact that all

critical objects and their colours in raster image can be easily preserved

during the process. Moreover, image segmentation is a relatively mature

image processing technique since there have been numbers of different image

segmentation techniques proposed for different application areas, for example

in object recognition and object motion tracking areas [36, 37, 38].

The outcome of this research work shows promising result such that the

author strongly believes that any good image segmentation method can be

easily adopted in this vectorisation application with little or no modifications

needed.

2.2 Image Segmentation

The field of image segmentation has been an active research topic for

years. This can be seen from the availability of numerous different image

segmentation techniques presently. The following sections will analyse and

review the segmentation techniques that are aimed at complex colour image.

Studies on other segmentation methods are also conducted and outlined to

help categorising the different segmentation techniques. In addition to that,

study on evaluation of segmentation technique will also be briefly discussed.

5

2.2 Image Segmentation

Page 11: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

And finally the review on a technique known as Boundary Tracing that is used

to extract regions in an image to vector representation from segmentation

results is succinctly outlined.

2.2.1 Reviews on Image Segmentation

Image segmentation, which partitions a raster image into multiple

regions, is one of the most important steps in image analysis and processing.

According to Sonka et. al. [12], segmentation methods can be divided into

three groups based on dominant features they employ: histogram

thresholding, edge-based, and region-based.

2.2.1.1 Histogram Thresholding

The basic thresholding is a very simple segmentation process that

compares each pixel in an image to a brightness constant or threshold. It sets

the pixel to object pixel if it is greater than the threshold or to background

pixel otherwise. On the other hand, an image histogram is used to analyse

the image and help finding the threshold. Sezgin and Sankur [14] have

categorised the thresholding methods into six groups according to the

information they are exploiting, which namely are:

1. Histogram shape-based methods that get thresholding by analysing the

shape properties, such as the peaks, valleys, convex hulls of the

histogram.

2. Clustering-based methods that generally group grey-level data into two

parts as background and foreground, or alternatively model the data as a

mixture of two Gaussians.

3. Entropy-based methods, which divide the histogram of the image into the

entropy of the distribution of both background and foreground objects.

6

2. Background Studies

Page 12: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

4. Object attribute-based methods, which use a measure of similarity, such

as edge coincidence, fuzzy shape, etc, between the grey-level and the

binarised image.

5. Spatial information-based methods, which utilise both grey value

distribution and correlation between pixels in a neighbourhood.

6. Local adaptive methods, which calculate a threshold at every pixel that

depends on some local statistics like range or variance.

Thresholding is computationally inexpensive and fast, and can be easily

done in real time using specialised hardware [12]. However, it is observed

that by using only thresholding technique may not create satisfactory result in

this research application because thresholding usually outputs a binary image

and binary image is not commonly accepted in graphic design patterns.

Furthermore, Sox et. al. [32] believe that threshold-based approaches often

lack of sensitivity and specificity needed for accurate classification.

2.2.1.2 Edge-based Segmentation

Edge-based segmentation is one of the earliest segmentations relying on

edges found in a digital image [12]. Prager [17] has proposed a set of

algorithms or procedures, used to perform segmentation on natural scenes

through boundary analysis. According to Prager [17], firstly, a pre-processing

method is needed to remove any noise data in the image, or to smooth the

image. Secondly, the edge representation is generated by applying an edge

detector to the image. Edges are the abrupt changes in the intensity function

found in an image. The edge detectors locate edges in the image relying on

edge detecting operators. There have been numbers of operators proposed in

earlier years and to name a few are: Sobel operator, Laplace operator, and

7

2.2 Image Segmentation

Page 13: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Prewitt operator. Thirdly, the edges produced in second stage are joined into

line segments and their features are computed. The features include length,

contrast, frequency, mean, variance and location of each line segment. Lastly,

a post-processing named Edge Relaxation is used to construct continuous

region border based on edge confidences.

It is worth noting that edge-based segmentation is capable of detecting

the borders of significant objects in an image, and generally the shapes of the

objects are usually preserved. Nevertheless, the two most common and

remains unsolved problem of edge-based segmentation are the edge’s

presence in locations where there is no border, and no edge’s presence where

a real border exists caused by either image noise or unsuitable information in

an image. Being able to retrieve accurate colour in the found regions is

another problem to be considered in the proposed vectorisation application.

2.2.1.3 Region-based Segmentation

Unlike edge-based segmentation, which uses object borders to retrieve

regions, region-based segmentation directly constructs regions over image

[12].

• Region Growing

One of the common region-based segmentations is Region Growing,

which basically take one or more pixels called seeds, and grow the regions

around them based on a uniformity predicate. A uniformity predicate is a

logical statement that is true only if pixels in the regions are sufficiently

similar in terms of a certain homogeneity criteria such as grey-level, colour,

texture, shape or some other property. According to Efford [31], one main

limitation of Region Growing is that it is not a particularly stable operation.

8

2. Background Studies

Page 14: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

For instance, the results obtained by 4-connected region growing may differ

from 8-connected region growing. In addition to that, the results obtained can

be very dependent on the choice of uniformity predicate. Furthermore, the

selection of the seeds can be problematic because the user will not know that

the seeds defined are sufficient to create a region for every pixel.

• Split and Merge Algorithm

Another common segmentation algorithm is split-and-merge algorithm. A

top-down approach is adopted in the algorithm, in which the whole image is

considered initially to be a single region. The region will be divided into many

sub-regions based on a certain criteria, and remerged to meet the uniformity

predicate. The split-and-merge algorithm is better than the region growing

because it is an unsupervised operation and it ensures a complete

segmentation [12, 31].

Cho and Meer [19] propose an image segmentation technique by using

Consensus Information applied to a Region-Adjacent-Graph (RAG) pyramid-

based segmentation. The RAG of an input image is given by the 8-connected

graph of the underlying mesh, which takes every pixel in the image as a

homogeneous region. Every vertex (initially pixels) in the graph is allocated a

random number drawn from the (0, 1) uniform distribution. To generate the

next level of the hierarchy, only a subset of the vertices is retained. Only

retained vertices are called survivors, and the rests are non-survivors. This

satisfies the condition that no two survivors can be neighbours and every

non-survivor must have at least one survivor. A vertex becomes a survivor if

its outcome is a local maximum. The algorithm merges non-survivors to their

most similar (in terms of grey-level property) survivor neighbours to generate

9

2.2 Image Segmentation

Page 15: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

an initial RAG. A probabilistic component called co-occurrence probability is

introduced, calculating from the neighbouring pixels in the same region.

Associating the co-occurrence probability with the initial RAG, a new graph

called weighted region adjacent graph is constructed. Thus, a reliable

segmentation can be performed through analysis of the co-occurrence

probability fields in the weighted RAG. When the value of a probability is high,

there is a consensus among different initial regions that two adjacent

supports can be merged. It has been observed that building RAG map is an

effective method used especially in region-based image segmentation.

However, the initial RAG pyramid produced by randomly choosing the

survivors and the non-survivors process is only a trial as different samples of

the initial survivors may cause different segmentation results.

• Data Clustering

There are works that propose to consider image segmentation problem as

one of data clustering, which to name a few are works from [10, 11, 16, 17,

40]. The following section presents techniques applied in image segmentation

based on data clustering approach.

i. Mean shift-based Segmentation

Mean shift, an iterative procedure that shifts a fixed size window

towards the average of the data points within, was first introduced by

Fukunaga and Hostetler [18], and re-proposed by Cheng [9] as a mode

seeking and clustering algorithm. It was further proposed as a

nonparametric estimator of density gradient in the joint, spatial-range

(value) domain of grey scale and colour image for discontinuity preserving

filtering and image segmentation by Comaniciu and Meer [10, 11, 17].

10

2. Background Studies

Page 16: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

According to [10, 17], the local mean, which is the average of the data

points within small window in a domain, is always shifted toward the

direction of the maximum increase in the density and is guaranteed to

converge (stop) at a nearby point where the estimate has zero-gradient.

From the previously derived theoretical observations, a simple iterative

algorithm that is mathematically proven by [10, 17] is proposed for mode

detection and discontinuity (edge) preserving smoothing. The algorithm

runs the mean shift procedure to find the local maxima of the sequences

of points, prune these points by retaining only the local maxima, or

replace these points by the local maxima for mode detection or

discontinuity-preserving-smoothing respectively.

Devised by Comaniciu and Meer [10], the major advantage of mean

shift filtering over other edge preserving smoothing algorithm is that

mean shift is run till convergence and it maintains the structure of the

data; whereas other algorithms do not have a stopping criterion. For

instance, image processed by other adaptive smoothing algorithm like

Tomasi and Manduchi [21], Saint-Marc et. al. [26], and Perona and Malik

[28], collapses to a flat surface after a sufficient number of iterations.

Extended directly from the discontinuity-preserving-smoothing, a

simple image segmentation by building a region adjacent graph (RAG) is

also proposed by Comaniciu and Meer [17]. The segmentation results are

controlled by two bandwidth, which namely are spatial and range

parameters, and one optional parameter that refers to minimum region

size. The perceptually uniform L*u*v* colour space (to be discussed in

Section 3.2) is used to represent the colour information for both spatial-

11

2.2 Image Segmentation

Page 17: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

range filtering and segmentation. By applying the mean shift filtering, the

segmentation process uses the spatial and range parameters to smooth

an image. Then it further decomposes the filtered image to clusters.

Subsequent to this, a RAG is built directly from the clusters. Eventually all

adjacent regions, which are closer than a threshold, are merged to create

an over-segmentation image. An optional phase to further merge all small

regions, which are typically smaller than the minimum region size to the

closest joint regions, are usually helpful in the aim of removing non-

critical regions. However, it is found that a static threshold is used in both

phase of filtered image decomposition and phase of adjacent regions

composition. The static threshold is used to measure the acceptable colour

difference between pixels or regions. The measure signifies that two

adjacent pixels will be separated into two different regions if the difference

of the two pixels is more than the threshold in the decomposition phase;

and two adjacent regions will be merged if the difference between them is

less than the threshold in the composition phase. Consequently, this

raises the problem that the segmentation result is influenced heavily by

the composition and decomposition sequence. More elaborated discussion

on this problem and proposed solution to it will be discussed in the next

few chapters.

Luo and Khoshgoftaar [20] further improve the work of Comaniciu and

Meer [17] for colour and texture image segmentation by combining mean-

shift clustering and minimum description length (MDL) principle. In their

opinion, the segmentation algorithm proposed by [17] is capable of

producing complete and accurate over-segmentation. Over-segmentation

means the feature palette is rich enough such that the image is

12

2. Background Studies

Page 18: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

decomposed into many small regions from which any sought information

can be assembled under knowledge control [11]. It is enhanced by

applying MDL-guided region merging to adaptively prune insignificant

boundaries in textured areas of an image while at the same time

preserving salient boundaries. The major idea behind their method is that

minimising description length, which is the sum of the coding length of the

data given the model and the coding length of the model itself, to be

equivalent to maximising a posterior probability. Hence, it could be

effectively applied to image segmentation. The region merging process is

continued until no pairs of adjacent regions can be found whose merging

will lead to a decrease in the total coding length. From the author’s

observation, the method produces an under-segmentation result since

only the most significant regions are retained. However not all the region

boundaries are accurately found and retrieving region colour could be

another problem.

Wang and Suter [23] propose another colour image segmentation

technique based on mean shift clustering. They claim that the method

takes consideration of both global information and local homogeneity and

reduces the complexity of the method proposed by Comaniciu and Meer

[17] by replacing the L*u*v* colour space to the hue and intensity

subspace only in Hue-Saturation-Value (HSV). Their major idea is that, it

computes local homogeneity value of a source image and retains the pixel

only with high homogeneity values before applying mean shift algorithm

to the image. After clustering procedure, it removes all of the so-called

repeated peaks, the peaks found by the mean shift clustering which are

very close to each other, and small peaks, the peaks has smaller value

13

2.2 Image Segmentation

Page 19: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

compared to their neighbours. Finally it assigns pixels to its nearest

clusters by calculating the cyclic property of the hue component. It has

been studied that, while validating the peaks, the process of choosing and

removing one from two peaks is not a stable operation, for instance,

choosing sample peaks from the direction of left-to-right may produce

different sets of validated peaks than the ones chosen from right-to-left

direction.

ii. JSEG technique

Deng and Manjunath [27] propose a new criterion for Good

segmentation by using class-map. Their unsupervised segmentation

method, namely JSEG, quantises colours in an image to several

representative classes that can be used to differentiate regions in the

image. Then each region will be labelled and the corresponding region

label will replace all pixels in region to create a class-map of the image. In

addition to this, a novel measure for segmentation, namely J-Value, based

on statistics of the colour classes was defined. Calculating the J-value and

applying it to a local area of the class-map can indicate whether the area

is within the region or near region boundaries. The higher the local J-value

is, the more likely that the corresponding pixel is near a region boundary.

Finally in the spatial segmentation phase, those pixels with lower J-value

are considered as region centres and used as seed pixels. A seed growing

process is then preformed from those seed pixels to create over-

segmentation image. Eventually a region merging process, which is based

on the similarity of the regions in colour histogram is performed to merge

all adjacent regions where their colour difference is less than a maximum

threshold. According to Deng and Manjunath [27], the major limitation of

14

2. Background Studies

Page 20: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

JSEG is caused by the varying shades due to the illumination. For

instance, the colour of a sunset sky can vary from red to orange to dark in

a very smooth transition. Literally, it has been observed in this research

study that the causes of its limitation is due to the region with smooth

transition are usually separated into different regions based on the

illumination. This is because of the colour quantisation method applied in

the first phase of their method. Unfortunately, there is no way to recover

the separated regions back to the one region through the following

phases.

iii. Adaptive Fuzzy C-Means (FCM) based Segmentation

Liew et. al. [16] point out that a conventional fuzzy c-means clustering

algorithm is solely based on the distribution of pixel attributes in the

feature space. Furthermore, the conventional FCM does not consider the

spatial distribution of pixels in an image, which may cause classification of

ambiguities due to overlap in intensity value between clusters or noise

corruption. Therefore, they propose a new adaptive fuzzy clustering

algorithm for both synthetic and real colour image segmentation. This

algorithm is believed to be able to take into consideration the high

correlation between neighbouring pixels, and be adaptive in smoothing

intensity variation within homogenous regions. The implementation of

their algorithm is different from the conventional FCM because it

adaptively measures the dissimilarity between a pixel and a cluster

prototype under the influence of its local neighbourhood in homogenous

regions. In this case, the adaptive measure implies the centre pixel is

smoothed by its neighbouring pixels during the computation only if the

window is in a homogeneous region. Liew et. al. [16] also find out that by

15

2.2 Image Segmentation

Page 21: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

applying only their clustering algorithm may wrongly segment a

homogenous region into multiple regions due to variation in its intensity

profile. Therefore a re-labelling procedure is incorporated in order to

retain the regions that have boundaries correspond to significant

transitions, and merge adjacent regions that do not have boundaries with

significant transitions. As a consequence, homogenous region within an

object can be segmented into one contiguous region. The re-labelling

procedure proposed generally solves the over-segmentation problem

caused by variation of intensity in a homogenous region for some cases.

Unfortunately, it has been discovered in this research study that the

shapes of objects are distorted and their boundaries are zigzagged.

iv. Adaptive Colour Image Segmentation (ACIS)

Deshmukh and Shinde [34] propose an Adaptive Colour Image

Segmentation system that uses an adaptive thresholding process to find

the number of segments in an image followed by use of neural network to

detect the number of objects automatically from the image. ACIS uses

HSV (hue, saturation, intensity) space for colour image representation.

The saturation and intensity planes are utilised for colour image

segmentation. By assuming that for a given colour object, these are the

two parameters that may vary and hue value remains the same. Hence

the histograms of given image for saturation and intensity planes are

computed independently in adaptive thresholding process to find number

of clusters without a priori knowledge on the number of objects in the

image. Once threshold and target values are calculated, the neural

network with multi-sigmoid function labels and colours the objects with

their mean colour. From their experimental results, the credibility of their

16

2. Background Studies

Page 22: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

approach is robust to noisy images. Unfortunately, this research work has

studied that the images are also distorted such that the clarity of the

objects’ shapes is lessened.

2.2.2 Reviews on Evaluation Techniques of Image Segmentation

Due to the various availabilities of image segmentation techniques, a good

image segmentation evaluation method is needed to conduct comparison on

different image segmentation techniques.

Martin et. al. [29] believe that although different human segmentations of

the same image are not identical, but they are highly consistent. Therefore

“ground truth” segmentations produced by humans are reliable to be used to

evaluate machine-produced segmentations by comparing the two.

Segmentation error measures used to evaluate segmentation algorithms in an

objective manner are developed to provide an empirical comparison between

two segmentations of an image. Basically, a segmentation error measure

takes two segmentations (usually the second is the refinement of the first) as

input, and calculates the difference of pixel sets in region by using a standard

formula defined where zero signifies no error. This local error measure

supports only one direction; for instance, the difference is zero when the

second is the refinement of the first, but not vice versa. Two different error

values are combined into an error measure for the entire image: Global

Consistency Error (GCE) forces all local refinements to be in the same

direction; Local Consistency Error (LCE) allows refinement in different parts of

the image to be in different directions. The only condition when comparing

17

2.2 Image Segmentation

Page 23: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

two segmentations for both two measures is that the two segmentations must

contain approximately equal number of segments.

Jiang et. al. [40] categorise various methods for performance evaluation

according to the following taxonomy: theoretical evaluation and experimental

evaluation. In addition to that, experimental evaluation involves feature-

based evaluation and task-based evaluation. The feature-based evaluation

can be further categorised into non-GT(Ground-Truth)-based evaluation and

GT-based evaluation. Jiang et. al. [40] adopt the GT-based evaluation

paradigm to measure the difference between the machine segmentation

result and the ground truth (expected ideal segmentation produced by

humans). They propose to consider the image segmentation problem as one

of data clusterings and, as a consequence, to use measures for comparing

clusterings developed in statistics and machine learning. Seven different

measures for comparing clusterings are introduced and classified into three

categories based on the nature of distance measures: distance of clustering

by counting pairs, distance of clustering by set matching, and information-

theoretic distance of clusterings. Jiang et. al. [40] realise that the

performance measures may be themselves biased in certain situations.

Therefore taking a collection of measures and defining an overall performance

measures, for instance, a linear combination, may achieve a better behaviour.

Zhang et. al. [30] believe that manually generating a reference image, or

ground truth, is a difficult, subjective, and time-consuming job. And for most

images, especially natural images, it is hard to guarantee that one manually

generated segmentation image is better than another. They propose a co-

18

2. Background Studies

Page 24: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

evaluation framework, which combines different effectiveness measures by

using a machine learning approach to coalesce the results from the constitute

measures. The main advantage of such method is that it improves the

evaluation accuracy when using a combiner that employs a machine learning

approach. However, it has been studied in this research work that this

method is dependent on the base evaluators, which are the existing

measures. As described in Zhang et. al. [30], the existing evaluation

measures examine different fundamental criteria of the objects, and rely

heavily on the image characteristics they are measuring. Therefore, none of

these evaluation measures work well for all cases. Furthermore, it has been

observed that selecting “effectiveness” measures as base evaluators is

relatively subjective and it involves lots of manual work, which falls short

under modern computer application category.

2.2.3 Reviews on Border Tracing Technique

Border tracing algorithm is a process used to trace the border of a region

deals with arranging all nodes of the border that is sequentially chained. This

algorithm is used to produce non-overlapping boundaries between regions

generally after segmentation process. Basically, there are three types of

borders: inner border, outer border, and extended border. An inner border is

a subset of the region and in contrast, the outer border is never a subset of

the region [12]. Both inner and outer borders cause difficulties in region

description because two adjacent regions could never have a common border.

On the other hand, extended border overcomes the problem by defining a

single common border between two adjacent regions.

19

2.2 Image Segmentation

Page 25: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

The extended boundary-tracing algorithm, which is proposed by Liow [13]

based on a look-up table, is found more sophisticated compared to

conventional methods. It uses a look-up table defining all twelve possible

situations that may happen during extended border tracing and it moves the

trace dependings on the previous detected direction of boundary until a

closed extended border is produced. In addition to extended boundary

tracing, the look-up approach provides a description of each boundary

segment in chain code form together with information about vertices.

Moreover, the complexity can be reduced because each border between two

adjacent regions could be traced once. The only problem discovered was that

the original look-up table could separate a region to different regions if for

example in a case where the region is a one pixel wide diagonal line. This is

because the look-up table applied supports four-connectivity only and the

trace simply ignores the diagonal direction pixel if there is no horizontal or

vertical pixel links to that pixel. However, the problem could be easily

overcome by applying more adaptive look-up table. A thorough discussion

and application on this research proposal of newly improved and adaptive

look-up table is elaborated in the next chapter.

Finally, based on the theoretical studies and literature reviews conducted,

it is realised that none of the proposed segmentation technique satisfy this

research work’s requirements in producing high quality images in terms of

complex and rich colour image to be used in computer graphic design. Hence,

the research concentrates on finding a new image segmentation technique

that contributes in vectoring the image into high quality and yet reliable result

in terms of both shapes and colour of objects.

20

2. Background Studies

Page 26: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

3. Methodology

The background of the field of Image Vectorisation particularly on Image

Segmentation has been discussed in previous chapter. It is understood that

the availability of numerous approaches to do raster-to-vector image

conversion are resulted from various different requirements in Image

Vectorisation. Regrettably, none of the approaches are suitable for very

complex colour image such as natural scene image.

In this research work, colour Image Vectorisation is considered as one of

the problems in Image Segmentation. Thus, an improved and higher quality

of Image Segmentation approach, which called WAR (Weighting Adjacent

Regions) Segmentation applicable for both colour and grey scale images are

produced. Unlike common segmentation techniques that generally rely on

particular pre-processing technique such as smoothing and clustering

techniques, WAR on the other hand can be used with or without any pre-

processing techniques.

This chapter includes an in-depth discussion on the flow of the Image

Vectorisation application named BATIK. In addition to that, a further

elaboration on the processes inside WAR segmentation is also described.

21

Page 27: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

3.1 Overview of BATIK

Figure 1 shows the overview of processes in BATIK application. Initially,

in step 1, a source image is converted from originally represented in a

nonlinear colour space or RGB model (referring to red, green, and blue), to a

linear colour space. Step 2 is an optional pre-processing stage where the

source image is filtered typically by removing noise and insignificant parts in

the image, and enhancing significant image features for further processing.

Step 3 concentrates on WAR segmentation where regions of interest are

segmented. Step 4 is an optional post-processing stage where reliable objects

are identified and extracted in the source image. And finally step 5 converts

significant objects to vector representation. A more detailed explanation on

each respective step will be covered in the following subsections.

22

3. Methodology

Page 28: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Figure 1. The Flow of Image Vectorisation in BATIK Application

23

3.1 Overview of BATIK

Page 29: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

3.2 Colour Space Conversion

The novel concept of proposed segmentation approach is similar to a

typical kind of region-based segmentation technique. It measures the colour

difference among all adjacent regions as follows:

Let r be a region, R be the set of regions adjacent to r , be the

default threshold of colour difference, and

( )M be a merge function,

( )⎪⎩

⎪⎨⎧ ∈∆≤−

=otherwiseFALSE

RandxxrifTRUExrM )( U (1)

The predicate specifies two adjacent regions can be merged only if the two

regions are similar in terms of colour property.

A colour space is a method, which is used to specify, create and visualise

colour [25]. In this research, a perceptually linear colour space, meaning a

change of the same amount in a colour value should produce a change of

about the same visual importance, is used to easily measure colour

difference. The most common colour space RGB, being used in visually every

computer system, is non-linear with visual perception. Consequently before

doing any further processes, it is necessary to do the conversion from RGB to

one of the linear colour spaces, for example CIE L*a*b*, CIE L*u*v*, etc.

CIE L*a*b*, a colour space introduced by the CIE in 1976, in which L* is

the luminance component, a* and b* are red/blue and yellow/blue

chrominance. CIE L*u*v* is also defined by the CIE in 1976. Likewise, L*

defines the luminance, u* and v* define chrominance. CIE L*a*b* is chosen

to linearise the perceptibility of colour differences in this research work

24

3. Methodology

Page 30: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

because it performs better visual quality than CIE L*u*v* for image

compression according to Han [24]. The simplest CIE colour difference

formula, which is known as CIE 1976 used to calculate the difference between

two measured colours is given as follows:

222 )21()21()21( bbaaLLE −+−+−=∆ (2)

where L1, a1, b1 and L2, a2, b2 are three components of two colours. For

extremely small colour differences, the two modification versions of CIE 1976

are CIE 1994 and CIE 2000. Another extremely small colour difference

formula is CMC, which is similar to the CIE versions but it includes weighting

functions for different areas. CIE 1994, CIE 2000 and CMC may give better

correlation with perceived differences. Although CIE 2000 is a recently

developed formula and through the in-depth experimentation studies

conducted in this research work, it is found that CIE 2000 produces better

result, but it’s computationally expensive and impractical in terms of

processing time.

3.3 Discontinuity-Preserving Smoothing

Traditional domain-filtering algorithms such as Mean Filter and Gaussian

Filter are generally used to smooth image through replacement of every pixel

in the image by averaging the pixel’s neighbours in a kernel. It blurs the

image and removes not only noise but also salient information. It is believed

that discontinuity (edge)-preserving smoothing used to remove noise and

insignificant information whereas salient information in an image is retained,

is better than the conventional smoothing algorithms particularly in this

vectorisation application.

25

3.3 Discontinuity-Preserving Smoothing

Page 31: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

A number of discontinuity-preserving smoothing algorithms based on

different techniques have been proposed and a brief discussion on them can

be found in [17]. Based on background studies on discontinuity-preserving

smoothing algorithms, this research work proposes to either use Mean-Shift

Filtering or Bilateral Filtering as the smoothing technique in the vectorisation

application. It is discovered that both Mean Shift Filter [17] and Bilateral Filter

[21] apply similar kernel density estimation technique working in the joint

spatial-range domain. More discussions on Bilateral Filtering and Mean-Shift

Filtering can be found in the following sections.

3.3.1 Bilateral Filtering

Bilateral Filtering, originally proposed by Tomasi and Manduchi [21], is a

discontinuity (edge)-preserving smoothing technique, which is based on

simultaneous processing of both the spatial and range domains. The

traditional domain filtering such as Gaussian Filter, weights only pixel values

of the neighbourhood samples based on computing spatial distance between

the centre and the neighbours. A given traditional domain filtering formula is

shown below:

( ) (∑ ∑−= −=

− ++=w

wx

h

hyss yxGyjxifjig ,,),(1 ) (3)

where indicates the weighted value at location ),(1 jigs− ( )ji, .

),( yjxif ++ measures the geometric closeness between the

neighbourhood centre ( )ji, and all nearby points within the small

26

3. Methodology

Page 32: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

neighbourhood that has size of ( ) ( )( )1212 +×+ hw . f is the intensity and

is the Gaussian distribution [12] in 2-dimensional (2D) space, is given by sG

2

22

2),( s

yx

s eyxG σ

+−

= (4)

where sσ is a standard deviation in the spatial domain distribution. The

geometric spread sσ in the domain is chosen based on the size of desired

neighbourhood. A large sσ needs more distant image locations and blurs

more. If the filter is shift-invariant, is radially symmetric and constant for

whole domain independent of the image as specified by Sonka, Hlavac, and

Boyle [12].

sG

Nevertheless, bilateral filtering computes pixel values in the centre of a

window based on both geometric closeness (spatial domain) and photometric

similarity (range domain) of the centre and its neighbourhood samples. The

range function is given by

( ) ( ) ( )( )

( ) ( )( )∑ ∑

∑ ∑

−= −=

−= −=

+−

+−++

=w

wx

h

hyr

w

wx

h

hyr

r

yjxifjifG

yjxfjifGyjxif

jig

,,

,,,

),(

+

+i

(5)

where ( ) ( )( )yjxifjifGr ++− ,, measures the photometric similarity

between the neighbourhood centre ( )ji, and the nearby points. Let

( ) ( )( )yjxifjif ++− ,, be R , the Gaussian function rG is given by

27

3.3 Discontinuity-Preserving Smoothing

Page 33: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

( )2

2

2 r

R

r eRG σ−

= (6)

where rσ is a standard deviation in the range distribution. Similarly, the

photometric spread rσ in the image range is set to achieve the desired

amount of combination of pixel values. Loosely speaking, the difference

between pixels in terms of intensity values less than rσ is mixed together

and the difference greater than rσ is not mixed together [21]. Unlike in the

spatial domain, the geometric closeness distribution is constant for the

whole domain whereas the photometric similarity distribution

sG

rG is variant

depending on the difference of input pixels.

The combined domain and range filtering thereby enforcing both

geometric and photometric locality is given by

( ) ( ) ( )( )

( ) ( ) ( )( )∑ ∑

∑ ∑

−= −=

−= −=

++−++

++−++++

=w

wx

h

hyrs

w

wx

h

hyrs

yjxifjifGyjxiG

yjxifjifGyjxiGyjxif

jig

,,,

,,,),(

),(

(7)

Every pixel value in a window is hence replaced by the average of similar and

nearby pixel values. In smooth regions, pixel values in a small neighbourhood

are usually similar to each other. In other words, if a pixel is very different to

others in a small neighbourhood, then that pixel either belongs to other

region or is assumed as a noise. As a consequence, the bilateral filtering

28

3. Methodology

Page 34: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

averages away the small, weakly correlated differences between pixel values

caused by noise, whereas salient information are preserved.

One point worth noting on the implementation of bilateral filtering is that

input image could be multi-band (e.g. a colour is represented by red, green

and blue bands). Tomasi and Manduchi [21] find out that the edge-preserving

smoothing can be applied to the red, green, and blue components of the

image separately. However, the intensity profiles across the edge in the three

colour bands are typically different. As a consequence, the smoothed image

not only appears blurred but also exhibits odd-looking, coloured auras around

objects. The uniform CIE L*a*b* colour space can therefore be applied to

measure Euclidean distance in the photometric similarity function rG .

Moreover, bilateral filtering can be preformed using two standard 1D

convolution; once in the horizontal direction and once in the vertical direction,

rather than a 2D convolution. This is simply because the complexity in

calculating the Gaussian kernel can be reduced from its square to its size

[12]. Thus the spatial function (3) is modified into

( ) (∑ )−=

− +=w

wxss xGxifig )(1 (8)

where the Gaussian distribution , which in 1D space is given by sG

2

2

2)( s

x

s exG σ−

= . (9)

The photometric similarity function modified from (5) is given by

29

3.3 Discontinuity-Preserving Smoothing

Page 35: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

( ) ( ) ( )( )

( ) ( )( )∑

−=

−=

+−

+−+

=w

wxr

w

wxr

r

xififG

xififGxif

ig )( . (10)

The Gaussian distribution in range domain remains unchanged. Finally the

combined domain and range filtering is given by:

( ) ( ) ( ) (( )

( ) ( ) ( )( )

)

−=

−=

+−

+−+

=w

wxrs

w

wxrs

xififGxG

xififGxGxif

ig )( . (11)

The convolution algorithm devised in this research work (as illustrated in

Algorithm 1.) using bilateral filtering in 1D space is given as follows:

Let { }nindexI K1= and { }nindexO K1= be the d-dimensional original and

filtered image points respectively in the spatial domain; h and be the

width and the height of the image respectively, so that n . Let w be

the radius of the kernel;

v

vh ×=

sσ and rσ be the standard deviation of the spatial

and the range domains respectively.

30

3. Methodology

Page 36: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Conceptually, step 4 is necessary to re-initialise the original image I by

taking data from the filtered image space O , and using original image’s width

as height and original image’s height as width. Eventually, step 5 takes all of

the re-initialised values to the step 3 and computes the final filtered image.

Algorithm 1. Bilateral Filtering

1. Calculate spatial Gaussian kernel k using (8). s

2. Assign hX = and Y v=

3. For each Yj K1=

a. Assign joi =

b. Assign Xjio ×=

c. For each Xi K1=

i. For each wwx K−=

ii. Calculate ( )iiog + using expression (11)

iii. Assign ( )iiogOoi +=

iv. Assign Yoioi +=

4. Assign , OI = vX = and Y h=

5. Repeat step 3.

3.3.2 Mean Shift Filtering

Let I be an n-dimensional Euclidean space and be a flat kernel

with a continuous random sample

nXK K1=

nXX K1 embedded in I , use kernel K to

replace the Gaussian function rG and x to replace the intensity ( )if in

expression (10) yields:

( )( )

( )∑

=

=

=n

ii

n

iii

xxK

xxKx

xm

1

1 (12)

31

3.3 Discontinuity-Preserving Smoothing

Page 37: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

where Xx ∈ . ( )xm is called sample mean. The difference ( ) xxm − is

called mean shift. The repeated movement of data points to the sample

means is called mean shift algorithm in Fukunaga and Hostetler [18].

Mean Shift is initially proposed by Cheng [9] used as a mode seeking and

clustering algorithm. Comaniciu and Meer [10, 17] further propose it to be

used as a nonparametric estimator of density gradient in the joint spatial-

range (value) domain of grey scale and colour image for discontinuity-

preserving filtering. One fact worth noting observed by Comaniciu and Meer

[10] is that Bilateral Filtering and Mean Shift Filtering are based on the same

principle, which is the simultaneous processing of both the spatial and range

domains. However, the domain filter in Bilateral Filtering is shift-invariant,

whereas the Mean Shift window is dynamic, moving the direction of the

maximum increase in the density gradient.

Let f be uni-variate density, the kernel density estimator in Wand and

Jones [35] is given by

( ) ∑=

∧⎟⎠

⎞⎜⎝

⎛ −=

n

i

ihXx

Knh

xf1

1 (13)

where kernel K has the similar assumption as in (12) and h is bandwidth.

By introducing multivariate kernel, Comaniciu and Meer [17] modify the

density estimator (13) as

( ) ∑=

⎟⎟

⎜⎜

⎛ −=

n

i

iddk

Khh

xxk

nh

cxf

1

2,

, (14)

32

3. Methodology

Page 38: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

where is the normalisation constant making kernel K integrate to one

and assumed strictly positive in d-dimensional space. They also apply the

above similar multivariate kernel estimator principle and successfully rewrite

the sample mean expression (12) into Mean Shift as

dkc ,

x

hxx

g

hxx

gx

xmn

ii

n

ii

i

Gh −

⎟⎟

⎜⎜

⎛ −

⎟⎟

⎜⎜

⎛ −

=

=

=

1

2

1

2

, )( (15)

where kernel is for weights, and G x is the centre of the kernel.

The local mean is shifted toward the region where the majority of the

points reside and stops when it gets fairly close to a local maximum, which is

the unique stationary point that has zero gradient calculated from the

estimator (14) within a small neighbourhood. The convergence of Mean Shift

procedure is guaranteed as proven in [17].

Another issue worth noting that was introduced by Sochen, Kimmel and

Malladi [33] is that an image is typically represented in the (X, I) space, in

which 2D surface embedded in the 3D (x, y, g) space for grey level images,

and 2D surface embedded in the 5D (x, y, R, G, B) space for colour images.

The similar representation is used in such that using (x, y, L*) for grey level

images and (x, y, L*, a* b*) for colour images. As explained in [17], the joint

domain employs both spatial domain, the space of the kernel, and range

domain, colour property. Euclidean metric is assumed for both respective

domains. Thus, multivariate kernel is defined as the product of two radially

33

3.3 Discontinuity-Preserving Smoothing

Page 39: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

symmetric kernels and the Euclidean metric allows a single bandwidth

parameter for each domain in [17] is given by

⎟⎟⎠

⎞⎜⎜⎝

⎛⋅⎟

⎟⎠

⎞⎜⎜⎝

⎛⋅=

r

r

s

s

rhsh hx

khx

kCxK )(,

where sx is the spatial part, rx is the range part of a feature vector, ( )xk is

the common profile used in both two domains, and sh rh are the employed

kernel bandwidths, and c is the corresponding normalisation constant. A

comprehensive explanation on the implementation of Mean Shift filtering

algorithm is best described in [17].

To sum up, the Bilateral filtering and Mean Shift filtering are somehow

similar in terms of principles adopted. In Bilateral filtering, the kernel

estimation of each pixel is computed only once. On the contrary, Mean Shift

filtering will not generally perform the computation only one time but it will

keep on computing until the convergence is achieved.

3.4 WAR (Weighting Adjacent Region) Segmentation

The novel research work in this thesis is to develop an improved and

higher quality of segmentation approach. WAR, a newly designed

segmentation approach in this study, is derived from the Split-and-Merge

technique and based on Weighting Adjacent Regions on the produced Region

Adjacent Graph (RAG). WAR segmentation incorporates a set of iterative

processes, which are Building the RAG, followed by Weighting Adjacent

Regions, and finally merging closest regions. The processes automatically end

when no further merging process can be performed. To show the applicability

and practicality of WAR segmentation, it will be implemented in the BATIK

34

3. Methodology

Page 40: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

application. The following shows elaborated sections that comprehensively

discuss the processes involve in WAR segmentation.

3.4.1 Building Region Adjacent Graph (RAG)

The Region Adjacent Graph (RAG) is a traditional image data structure, in

which regions and their adjacencies are depicted in a region map. It can be

applied in region-merging approach such that neighbouring regions assumed

to have the same interpretation are merged into one region [12]. By

introducing colour differences corresponding to Euclidean distance in

perceptually linear colour space, for instance CIE L*a*b*, the RAG map can

be easily built using the colour properties for homogeneity criterion. Initially,

the RAG map can be built by taking every pixel in the input image as a

homogenous region, followed by merging all the adjacent regions (pixels)

whose colour properties are exactly the same.

Based on this RAG map approach, a customised RAG map that conforms

to the requirements in WAR segmentation is defined and built. This

customised RAG map has an added labelling function to build initial

identification for every pixel and their adjacent regions in the neighbourhood.

A comprehensive explanation on the customised RAG map can be seen as

follows.

Let { } and niI K1= { }niL K1= be the original and labelled image with length

equals to n and 0=iL ; { }81K=jh be the neighbourhood location of i ; l be

an integer initially equals to zero; S be an empty stack.

35

3.4 WAR (Weighting Adjacent Region) Segmentation

Page 41: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Algorithm 2. Labelling pixels in image

For each i nK1=

i1. If , assign L0==iL l++= , push to S . i

2. While is not empty S

a. Pop value from S and assign it to the label t .

b. For each 8...1=j

i. If Ijhtt I +== and 0≠+ jhtL , assign ijht LL =+

ii. Push t jh+ to S .

As illustrated in algorithm 2, all pixels and their adjacent pixels in the

neighbourhood will eventually have their own labels or identities. Once all the

pixels are labelled or identified accordingly, a procedure to merge pixels with

same labels are performed. This whole procedure will finally generate a RAG

map, which contains all the inter-related regions. Thus, the follow-up

Weighting Adjacent Region process will directly manipulate this RAG map. An

example of building RAG map is best depicted in Figure 2.

36

3. Methodology

Page 42: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

3.4 WAR (Weighting Adjacent Region) Segmentation

Figure 2. An illustration of building the initial RAG map. (a) Every pixel in

the image is taken as a region connected in 8 directions with its neighbours.

(b) All connected regions that have the same property and grouped

together are individually assigned by a unique label (number). (c) Regions

with the same label are merged and connections among them are revised.

One point worth noting in the implementation of building RAG map is that

each region defined can be consider as one object, which contains four

properties: label, colour property, amount of pixels contained in the region,

and a list of references to the adjacent regions. These four properties are

comprehensive to describe a region and the relations with its adjacent

37

Page 43: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

regions. A region might be removed from RAG map if for example, the region

is successfully merged with other regions, which consequently causes a

different label to be used to identify the merged region. Alternatively, a

region with modified properties may remain in the RAG map only if the label

is unchanged in the above example. In another words, RAG map must be

revised when merging process is achieved. The algorithm to build RAG map is

given as follows.

Let { and }niI K1= { }niL K1= be the original and labelled image obtained

from Algorithm 2, { }mjR K1= be the set of region objects where m is the

maximum label found from Algorithm 2 and assign , nullRj = { }81K=jh be

the neighbourhood location of i

Algorithm 3. Building first level RAG map

For each i nK1=

For each 81K=j

1. If jhii LL +=!

a. If nullRiL == , set properties of R .

iL

b. If nullRjhiL ==

+, set properties of R .

ji hL +

+

c. Add to the neighbourhood of R . ji hLR + iL

d. Add to the neighbourhood of R . iLR

ji hL

As previously discussed, each defined region object contains four

properties, which are label, colour property, region size and neighbourhood

list. Therefore in step (a) and step (b), region properties including label,

colour property and region size can be set if the region is newly defined.

These three properties can easily be obtained from Algorithm 2. In step (c)

38

3. Methodology

Page 44: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

and step (d), it basically adds a region to the neighbourhood list of its

adjacent region respectively.

3.4.2 Weighting Adjacent Regions (WARs)

WARs is a technique which weights or averages all pixels based on

photometric similarity (range domain) of the centre region and its

neighbourhood samples (spatial domain). Similar to the concept of Bilateral

filtering, both range and spatial domains are taken into consideration when

weighting the regions in neighbourhood samples. The only difference is that

Bilateral filtering weights pixels in the centre pixel’s neighbourhood samples

and replaces the centre pixel by using the weighted value whereas WARs

weights all pixels in both the centre region and its neighbourhood samples.

Obviously in a pixel map, the connections between a centre pixel and its

neighbourhood are fixed. However in a region map, the neighbourhood of

each region needs to be identified individually from the previously built RAG

map.

Algorithm 4 illustrates the steps involved in Weighting Adjacent Regions.

Let { be the set of region objects where n is the total number of

regions found from Algorithm 3; , , and be the

label, size, colour property and neighbourhood of R ;

}

}

niR K1=

IiR , SiR , CiR , { mNRiRK1, =

i ∆ be the threshold; C

and S be two variables used to sum up colour property and size respectively

and initially are null.

39

3.4 WAR (Weighting Adjacent Region) Segmentation

Page 45: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Algorithm 4. Weighting Adjacent Regions

For each i nK1=

1. Assign , SiRS ,= CiSi RRC ,, ×= ;

2. For each R { }mNRi K1, =

a. If ( ) ∆≤− CRCi INRR ,, ,

i. Assign C SRCR ININRRC ,, ,,

×+= ;

ii. Assign SR INRSS ,,

+= .

3. Set SCR Ci ÷=, .

The threshold bounds the desired range between the centre region and its

neighbourhood samples. Therefore, only similar regions in terms of colour

property are mixed together to minimise the differences among those

regions.

Analogous to Bilateral filtering, WARs also averages away the small

weakly correlated differences between region values caused by noise, and at

the same time salient information is preserved. Furthermore, it retains

connections among regions and hence, enables the next merging process to

work with these connections.

3.4.3 Merging Adjacent Regions

Theoretically in a split-and-merge approach, the image’s region will first

be split or divided into many sub-regions based on a certain criteria, and

remerged to meet the uniformity predicate. A static threshold is defined in

this proposed merging approach. The threshold is used to measure the

acceptable colour difference between pixels or regions. The measure signifies

40

3. Methodology

Page 46: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

two adjacent regions will be merged if the difference between them is less

than the threshold in the composition phase. However, this raises the

problem that the segmentation result is influenced heavily by the composition

sequence.

3.4 WAR (Weighting Adjacent Region) Segmentation

Figure 3. Two different Regions-Merging approaches. A constant threshold

0.2 is assumed in this illustration. (A) is the original map of 4-connective

regions. (B’) and (C’) are the map produced from sequentially merging

approach. (B”) and (C”) are the map produced from closest-regions-

merging approach.

As shown in Figure 3, an assumed constant threshold is 0.2. In (B’) and

(C’), the sequence of regions are mapped from top-down and left-right.

Region 1 is initially merged with region 2, and followed by merging with

region 4. Conceptually, region 3 could possibly be merged with region 4 due

to the fact that they are also legitimately closer regions. However, since

region 4 has already merged with region 1 and the final intensity of region 1

has also changed, therefore eventually region 3 remains unmerged. In (B”),

the merging algorithm follows closest-regions-merge-first approach. The

41

Page 47: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

approach merges all joint regions with the closest intensities until no joint

regions are closer than a predefined threshold value. Therefore, region 2 is

merged with region 4 at first place. Since the intensity of the merged region 2

has been updated, this has consequently resulted the differences among

remaining regions are higher than the set threshold. As a result, the merging

algorithm ends with three regions unmerged.

Unlike the two different methods depicted in Figure 3, this research work

devises a new merging strategy that is able to maximise the merging process.

It is believed and proven that this newly developed strategy will eventually

merge all the inter-related regions. Figure 4 shows an illustration of the

proposed merging strategy.

3. Methodology

Figure 4. Proposed Regions-Merging approach. A constant threshold 0.2 is

assumed in this illustration. (A) is the original map of 4-connective regions.

(B”’), (C”’), (D”’) and (E”’) are the map produced from sequentially merging

approach.

42

Page 48: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

The newly devised merging approach begins by first discovering the

possible sets of regions to be merged in the neighbourhood. In (B”’), region 1

is taken as the start-up referenced region. When referenced region identifies

that region 2 is the possible region to merge with, then region 2 is labelled as

sets of region 1 with no intensity value updated. Hence, the referenced region

utilises the intensity of region 2 and the search continues in the

neighbourhood of region 2. Likewise in (C”’) and (D”’), the processes of

initialising the referenced region, discovering its possible merging sets in the

neighbourhood, and utilising its corresponding intensity are performed.

Eventually in (E”’), all the sets of regions found will be merged together and

based on that, a new intensity value is computed.

To conclude, regions with similar density are merged together into each

respective region, and each region’s connectivity to its adjacent neighbour are

depicted in the RAG map. For more detailed explanation on the merging

procedure, its algorithm is presented as follows.

Let { be a set of regions obtained from Algorithm 4; , ,

and be the label, size, colour property and neighbourhood

of ;

}

}

niR K1= IiR , SiR ,

CiR , { mNRiRK1, =

iR σ be a pre-selected threshold.

43

3.4 WAR (Weighting Adjacent Region) Segmentation

Page 49: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Algorithm 5. Merging Adjacent Regions

For each i nK1=

K1, =

1. If , Push to a stack , nullRi ≠ IiR , S

2. While is not empty, do S

a. Pop value from S and assign it to a label L ,

b. For each R { }mNRL

I. If σ≤− CRCL INRR ,, ,

A. If S not contains R and IN,

,

, ,

IiIN RR ,, ≠

i. Push to INR , S

II. Merge to R with revised R , LR i Ni

3. Compute R and R . Ci Si

The Step 1 evaluates the availability of the selected region since the

respective region has possibly merged to other region. The Step 2 iteratively

finds all adjacent regions that could be merged with the selected region.

Essentially, step 2 (II) revises the connections among the potential merging

sets. The revising operation is used to keep the relations among the regions

even though certain region(s) has been “removed” from the region map as

explained in Figure 2 (c). Finally Step 3 updates colour property and size of

the region.

3.5 Region Pruning

A ingenuous post-processing is used as an optional step to remove all

small regions that are usually not significant in further processing and can be

considered as segmentation noise [12]. These small regions cannot be

merged with any adjacent regions according to the homogeneity criteria

44

3. Methodology

Page 50: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

applied in the previous steps. The crude resolution can simply merge a small

region, which is smaller than a pre-selected size, to its adjacent region that is

most similar to the smaller region according to the homogeneity criteria used.

However, for image vectorisation, some small regions are significant yet

cannot be removed. For example in Figure 8 (a), the regions of the eyes and

the lips on the Ethnic-Lady’s face are smaller yet significant. Removing those

regions definitely causes the Ethnic-Lady has an odd-looking. Therefore the

pruning process needs to preserve these small yet significant regions in the

image.

As discovered, generally small yet significant regions are very different to

their adjacent regions according to the homogeneity criteria used. Hence, an

additional evaluation process can be incorporated with the crude pruning

process while suppressing small regions. It evaluates the difference between

every smaller region with its most similar adjacent region. Whenever the

difference is less than a pre-selected range, the follow-up merging process

will be executed. Otherwise, the smaller region will be retained. An extensive

conception on the region pruning is illustrated in Algorithm 6.

Let { be a set of regions obtained from Algorithm 5; , ,

and be the label, size, colour property and neighbourhood

of ; be a pre-selected minimal size;

}

}

niR K1= IiR , SiR ,

CiR , { mNRiRK1, =

iR Μ σ be a pre-selected range

property.

45

3.5 Region Pruning

Page 51: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

For each i

1. While

nK1=

MR Si <,

a. Find m

the homog

LR

b. Assign the

c. If σ>d b

d. Merge iR

Step 1 does not on

availability of the sele

other region. Customar

the formula used in ste

process performed if th

pre-selected range. La

region) to the other.

Practically up to

segmented into region

With the given region m

capturing all regions’ b

Tracing process.

3.6 Region Border Tr

As a result from th

been properly labelled)

the image, one has to

vectors (namely region

3. Methodology

Algorithm 6. Region Pruning

and R nulli ≠ , do

ost similar to R from R , according to

eneity criteria.

i { mNRi }K1, =

difference CLCi RRd ,, −= ,

reak,

and . R

L

ly search the smaller regions but also evaluates the

cted region since the region has possibly merged to

ily, step (a) involves numbers of calculations similar to

p (b). In addition to that, step (c) indicates no merging

e difference between two regions is greater than the

stly, step (d) merges one region (usually the smaller

this stage, a raster image has been successfully

s of interest and delineated as a form of region map.

ap, the follow-up work will concentrate on tracing and

order nodes, which is widely known as Region Border

acing

e previous stage, a finalised region map (regions have

of the raster image is produced. In order to vectorise

consider the needs of capturing all of the regions’

border nodes). This is achieved by implementing the

46

Page 52: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

border-tracing algorithm. In general, there are three types of borders: inner

border, outer border, and extended border. Only extended border defines a

single common border between adjacent regions, and it may be specified

using standard pixel co-ordinates [12].

The extended boundary-tracing algorithm based on look-up table as

proposed in [13] is sophisticated and efficient. Despite this, a different yet

more efficient look-up table is proposed in this research study. It is believed

that the original look-up table is not adaptable in current study as it could

inappropriately separate a region to different regions. To better illustrate the

finding, Figure 5 is taken as an illustration example based on the original

look-up table. The region shown is a one pixel wide diagonal line. When a

starting pixel is found, the first move along the traced boundary from the

starting pixel is always moving down (Figure 5a). The next move successfully

goes to right based on the original look-up table (Figure 5b). After that, the

next move along the traced boundary ignores the next diagonally linked pixel

and inappropriately goes up (Figure 5c), and finally closes the traced

boundary as it meets the starting pixel (Figure 5d). Hence, the rest of pixels

in the region could be separated from the traced boundary and be considered

as other regions.

47

3.6 Region Border Tracing

Page 53: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

The new

boundary-t

guarantees

the same e

3. Methodology

(a) (b)

(c) (d)

Figure 5: Tracing steps by using look-up table based extended border

tracing algorithm proposed in [13].

look-up table devised (as shown in Figure 6) in the extended

racing algorithm can successfully overcome the above problem and

that any regions can be closed. The anticipated tracing result from

xample (as shown in Figure 5) is best illustrated in Figure 7.

48

Page 54: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Figure 6: The look-up table defining all 12 possible situations that can

appear during extended border tracing. Note that the newly devised (a),

(c), (e), (f), (h), (i), (k), and (l) are different from the tables proposed in

[13].

Figure 7. Tracing result by using proposed look-up table.

49

3.6 Region Border Tracing

Page 55: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

The extended boundary-tracing algorithm that directly applies to the

region map, which produced from the WAR segmentation, is outlined in

Algorithm 7.

Let { be a region map of an image with index from 0 to n and

each contains the label number . Initialize

}niI K0=

iI j { }mjR K0= be a set of regions

with is the estimated total number of regions and each . m 0=jR

Algorithm 7. Extended Boundary Tracing

For each i nK0=

1. If R 0==iI

a. Assign foreground label iIL = ,

b. Assign 1−=iIR ,

c. Set the starting pixel iP = , direction 6=d (down),

corresponding to the situation (i) in Figure 6,

d. Trace the extended boundary using the look-up table in Figure

6 until a closed extended border results.

Essentially, step (a), (b), and (c) locate every starting pixel of all regions

to begin with a new boundary trace. Algorithm 7 assists the trace of each

region boundary until a closed extended border is resulted.

Each boundary’s nodes in chain-code-form with information about vertices

are produced after region border tracing procedure. Using these region border

nodes together with colour information of each region preserved during the

segmentation stage may easily reconstruct the vector image.

50

3. Methodology

Page 56: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

4. Experimentation and Evaluation

Since colour image vectorisation is considered as one of the problems in

image segmentation in this research work, the experimentation result will

concentrate on producing concise and reliable segmented objects of interest

from original colour image to be used in computer graphic design area. From

background studies and analysis, the most recent analysis on experimentation

and evaluation on segmentation is done by Jiang et. al. [40]. They adopt the

Ground Truth(GT)-based evaluation paradigm to measure the difference

between the machine segmentation result and the ground truth (expected

ideal segmentation produced by humans). However, manually generating a

reference image, or ground truth, is a difficult, subjective, and time-

consuming job [30]. Furthermore for most images, especially natural images,

it is hard to guarantee that one manually generated segmentation image is

better than another.

In the experimentation with the developed BATIK application,

performance measures are computed directly by means of desirable objects

of the segmentation results. The performance measures are identified by the

number of objects or regions defined and edges detected. The following

shows a set of distinct evaluation criterias that are adopted while comparing

segmentation results produced in this research study with others:

a. Result Resemblance

The machine-generated image should resemble the original image in

terms of preserving object’s shapes and colours.

b. Edge Preservation

51

Page 57: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Most of the critical edges found in the original image should be preserved

in the machine-generated image.

c. High accuracy of interesting regions defined

The generated image should not include insignificant regions caused by

the present of edge in location where there is no border.

4.1 Results Evaluation

Experimentation with the developed BATIK application that incorporates

WAR segmentation technique is carried out. A sample image of Ethnic-Lady is

used to be processed by the BATIK application and it shows promisingly

improved yet accurate segmented results. To show the reliability and

practicality of WAR segmentation, these results are compared with the results

generated by EDISON (applying Mean-shift based Segmentation) [10, 11,

17], CorelTrace (©Corel Draw), and BitmapTrace (©Macromedia). EDISON is

the mostly chosen colour image segmentation technique that is used in

comparison with other newly developed segmentation techniques. The others

are two of the most popular commercial graphic applications. Comparisons of

these results are done based on the defined distinct evaluation criterias. A

thorough description on the comparison results can be found as follow.

4. Experimentation and Evaluation

(a)

52

Page 58: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

4

F

s

B

h

4.1 Result Evaluation

(b) (b’)

(c) (c’) Figure 8. Ethnic-Lady. (a) Original. (b) Mean-shift Segmented with spatial

and range resolution = (7, 6.5) (b’) Mean-shift Segmented Region

Boundaries (c) WAR Segmented with range resolution = (10) (c’) WAR

Segmented Region Boundaries. For post processing, both (b) and (c) use

minimum Region = 20.

.1.1 Comparison between WAR and Mean-Shift based Segmentation

igure 8 shows the segmentation results generated by Mean-shift based

egmentation (through EDISON) and WAR segmentation techniques (through

ATIK application). From the observation based on the results generated,

ere are the findings:

53

Page 59: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

• Total segmented regions produced

WAR segmentation technique generates 596 regions whereas Mean-Shift

based segmentation produces 735 regions.

• Result Resemblance

WAR segmentation result highly resembles the original image in which

details such as the shapes of the lips and eyebrow are retained, and

regions with transition of colour due to illumination are uniformed and

segmented into only few distinct regions. On the other hand, Mean-Shift

based segmentation result resembles the original image with less

precision where no illustration of lips and eyebrow, non-uniform

illumination is segmented into many regions.

• Edge Preservation

WAR segmentation generated result shows critical edges of the image are

not only preserved, but also smoothed. In addition to that, insignificant

edges are disregarded. On the contrary, Mean-Shift based segmentation

generated result includes both significant and insignificant edges and they

are not smoothed (zigzagged). Moreover, some of the non-edges found in

the image are also taken as edges.

• Accuracy of Interesting Regions

As depicted in Figure 8 (c’), result generated from WAR segmentation

technique shows high level of accuracy in which the boundaries of

interesting regions are clearly depicted. However, Figure 8 (b’) shows a

moderate accuracy as the boundaries of interesting regions are combined

with insignificant regions, which consequently causes the boundaries to be

complexly depicted.

54

4. Experimentation and Evaluation

Page 60: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

4.1.2 Comparison among WAR, CorelTrace, and BitmapTrace

Figure 9 shows the segmentation results and Table 1 summarises the

comparisons of the findings generated from CorelTrace (©Corel Draw),

BitmapTrace (©Macromedia), and WAR segmentation techniques (through

BATIK application).

(a) (b) (c)

(a’) (b’) (c’)

Figure 9. Ethnic-Lady. (a) WAR Segmented with range resolution = (10),

(a’) WAR Segmented Region Boundaries, (b) CorelTrace Segmented with

complexity = (6), (b’) CorelTrace Segmented Region Boundaries, (c)

BitmapTrace Segmented with colour threshold = (20), and (c’)

BitmapTrace Segmented Region Boundaries. All of them apply minimum

Region = (20) for post processing

55

4.1 Result Evaluation

Page 61: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

Criteria Segmentation

Method

Results

WAR 596

CorelTrace 214

Total regions

BitmapTrace 1400

WAR Highly resembles the original image.

Regions with transition of colour due to

illumination is uniformed and segmented

into a few distinct regions; the shapes of

the lips and eyebrow are retained.

CorelTrace Low resemblance. Fewer details found in

the image, e.g. the shapes of the lips and

eyes are not shown; different regions are

incorrectly merged; regions with transition

of colour due to illumination are over-

segmented.

Result

Resemblance

BitmapTrace Moderate resemblance even though the

whole image is over-segmented. Some

details such as the shape of the lips and

eyes are incorrectly identified.

WAR Most of significant edges are preserved and

smoothed whereas insignificant edges are

ignored.

CorelTrace Not all significant edges are preserved.

Some edges used to identify regions are

missed due to erroneously merging

different regions.

Edge

Preserved

BitmapTrace Too many details of both significant and

insignificant edges and these edges are not

smoothed (zigzagged particularly on the

face, neck, and hair regions).

56

4. Experimentation and Evaluation

Page 62: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

WAR High accuracy where boundaries of

interested regions are clearly depicted.

CorelTrace Compatible accuracy in defining the

interested regions. Some interested regions

are combined with insignificant regions.

Accuracy

of Interested

Regions

BitmapTrace Very low accuracy in defining the interested

regions. Most of significant regions are

cropped into scattered countless pieces.

To

betwee

CorelTr

techniq

WAR se

is stron

comput

domain

4.1 Result Evaluation

Table 1. Comparison among WAR, CorelTrace, and BitmapTrace

summarise findings in this research work, the comparison results

n WAR and 3 different segmentation techniques (Mean-shift based,

ace, and BitmapTrace) have demonstrated that WAR segmentation

ue produces reliable yet accurate results and this also means that

gmentation technique can serve for improving Image Segmentation. It

gly believed that WAR segmentation technique is an important

ational module and can extend its use for other application in other

.

57

Page 63: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

5. Conclusion

In this thesis, an improved and higher quality of segmentation technique

based on Weighting-Adjacent-Regions strategy has been developed and

incorporates with Boundary Tracing Algorithm to perform Raster-to-Vector

conversion. The customised image vectorisation approach is integrated into

BATIK application. Then, a comparison is conducted on WAR segmentation

with several other segmentation techniques. From the experimental results

and based on the defined evaluation criteria, WAR segmentation results

significantly retain more meaningful and interesting regions where

insignificant regions are disregarded. The results also show high resemblance

to the original image and most of the critical edges are preserved properly.

The applicability of WAR segmentation works best, but is not limited, to

the domain of computer graphic design. It can also be applied to any domain

that requires region and feature extraction. Both Schek [40] and Jing et. al.

[41] propose an image similarity search system that explicitly compares the

similarity between the regions of the query image and the regions of the

indexed images. Hence, it is thought that by incorporating the improved WAR

segmentation technique to their application will result more powerful systems

with regards to retrieval quality.

Future work will concentrate on a further improved and optimised

algorithm to speed up the processing time in WAR segmentation. In the

current implementation, the Weighting-Adjacent-Regions and the Regions-

Merging procedure involve huge numbers of calculations on evaluation of

58

Page 64: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

adjacent regions. A suggestion to minimise the complexity of computation is

to avoid the redundant evaluation on the same adjacent regions set.

59

5. Conclusion

Page 65: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

6. Bibliography

[1] D. Dori and W. Liu, “Sparse pixel vectorisation: an algorithm and its

performance and evaluation”, IEEE Trans. Pattern Anal. Machine Intel,

vol. 21, pp. 202-215, Mar. 1999.

[2] P. R. van Nieuwenhuizen, O. Kiewiet, and W. F. Bronsvoort, “An

integrated line tracking and vectorisation algorithm”, Euro Assoc. vol. 13,

num. 3, 1994.

[3] J. Jimenez and J. L. Navalon, “Some experiments in image

vectorisation”, IBM J. Res. Develop, vol. 26, NO. 6, pp. 724-734, Nov.

1982.

[4] K. Tombre and S. Tabbone, “Vectorisation in graphics recognition: to thin

or not to thin”, IEEE Pattern Recon, vol. 2, pp. 91-96, 2000.

[5] J. Z. Ju and Y. Hong, “Cartoon image vectorisation based on shape

subdivision”, cgi, p. 0225, Computer Graphics International 2001

(CGI’01), 2001.

[6] J. M. Valiente, M. C. Carretero, J. M. Gomis, and F. Albert, “Image

processing tool for the purpose of textile fabric modeling”, XII ADM

International Confer, Sept. 2001.

[7] W. Liu and D. Dori, “From raster to vectors: extracting visual information

from line drawing”, Springer London, vol. 2, num. 1, pp. 10-21, Apr.

1999.

[8] K. Tombre, C. Ah-Soon, P. Dosch, G, Masini, and S. Tabbone, “Stable

and robust vectorisation: how to make the right choices”, 3rd Inter.

Workshop on Graphics Recon, pp 3-16, Sept. 1999.

[9] Y. Cheng, “Mean shift, mode seeking, and clustering”, IEEE Trans.

Pattern Anal. Machine Intel, vol. 17, no. 8, pp. 790-799, Aug. 1995.

60

Page 66: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

[10] D. Comaniciu and P. Meer, “Mean shift and applications”, IEEE Computer

Society, vol. 2, pp 1197, 1999.

[11] D. Comaniciu and P. Meer, “Robust analysis of feature space: colour

image segmentation”, IEEE Computer Society, pp. 750, 1997.

[12] M. Sonka, V. Hlavac, and R. Boyle, “Image processing, analysis, and

machine vision 2nd edition”, Brooks/Cole, 1999.

[13] Y. T. Liow, “A contour tracing algorithm that preserves common

boundaries between regions”, CVGIP – Image Understanding, 53(3):

313-321, 1991.

[14] M. Sezgin and B. Sankur, “Survey over image thresholding techniques

and quantitative performance evaluation”, Journal of Electronic Imaging

13(1), 146-165, Jan. 2004.

[15] J. M. Prager, “Extracting and labeling boundary segments in natural

scenes”, IEEE Trans. Pattern Anal. Machine Intel, vol. 2, no. 1, pp. 16-

27, 1980.

[16] W. C. Liew, H. Yan, and N. F. Law, “Image segmentation based on

adaptive cluster prototype estimation”, IEEE Trans. Fuzzy Systems. Vol.

13, no. 4, pp. 444-453, Aug. 2005.

[17] D. Comaniciu and P. Meer, “Mean shift: a robust approach toward

feature space analysis”, IEEE Trans. Pattern Anal. Machine Intel. Vol. 24,

No. 5, May 2002.

[18] K. Fukunaga and L. D. Hostetler, “The estimation of the gradient of a

density function, with applications in pattern recognition”, IEEE Trans.

Information Theory, Vol. 21, pp. 32-40, 1975.

[19] K. Cho and P. Meer, “Image segmentation from consensus information”,

Comp. Vision Image Understanding, Vol 68, No 1, pp. 72-89, 1997.

61

6. Bibliography

Page 67: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

[20] Q. Luo and T. Khoshgoftaar, “Efficient image segmentation by mean shift

clustering and MDL-guided region merging”, IEEE ICTAI’04, pp. 337-343,

2004.

[21] C. Tomasi and R. Manduchi, “Bilateral filtering for grey and colour

images”, in Proc. 6th Int. Conf. Comp. Vision, New Delhi, India, pp. 839-

846, 1998.

[22] M. Elad, “On the origin of the bilateral filter and ways to improve it”,

IEEE Trans. Image Processing, Vol. 11, No. 10, pp 1141-1151, Oct.

2002.

[23] H. Wang and D. Suter, “Color image segmentation using global

information and local homogeneity”, Proc. 7th Digit Image Computing,

pp. 89-98, Sydney, Dec. 2003.

[24] S. E. Han, B. Tao, T. Cooper, and I. Tastl, “Comparison between

different colour transformations for JPEG 2000”, PICS 2000: Image Proc.

Image Qua. Image Capt. Sys. Conference, pp. 259-263, Portland, Mar.

2000.

[25] R. C. Gonzalez and R. E. Woods, “Digital image processing”, Addison

Wesley, 1992.

[26] P. Saint-Marc, J. S. Chen, and G. Medioni, “Adaptive smoothing: a

general tool for early vision”, IEEE Trans. Pattern Anal. Machine Intel.

Vol. 13, No. 6, pp. 514-529, June 1991.

[27] Y. Deng and B. S. Manjunath, “Unsupervised segmentation of color-

texture regions in images and video”, IEEE Trans. Pattern Anal. Machine

Intel. Vol. 23, No. 8, pp 800-810, 2001.

[28] P. Perona, J. Malik, “Scale-space and edge detection using anisotropic

diffusion”, IEEE Trans. Pattern Anal. Machine Intel. Vol. 12, pp 629-639,

1990.

62

6. Bibliography

Page 68: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

[29] D. Martin, C. Fowlkes, D. Tal, and J. Malik, “A database of human

segmented natural images and its application to evaluating segmentation

algorithms and measuring ecological statistics”, Computer Vision, ICCV

2001, Proceedings. Eighth IEEE Inter. Conf., Vol. 2, pp 416-423, 2001.

[30] H. Zhang, J. E. Fritts, S. A. Goldman, “A Co-evaluation Framework for

Improving Segmentation Evaluation”, SPIE Defense and Security

Symposium – Signal Proc. Sensor Fusion, Target Recon. XIV, pp. 420-

430, Mar. 2005.

[31] N. Efford, “Digital Image Processing: a Practical Introduction using Java”,

Addison Wesley, 2000.

[32] H. C. Sox, M. A. Blatt, M. C. Higgins, and K. I. Marton. “Medical Decision

Making”, Butterworths, Boston, Massachusetts, 1988.

[33] N. Sochen, R. Kimmel, R. Malladi, “A Geometrical Framework for Low

Level Vision”, IEEE Trans. on Image Processing, Vol. 7, No. 3, 1999.

[34] K.S. Deshmukh and G.N. Shinde, “An Adaptive Color Image

Segmentation”, Electronic Letters on Computer Vision and Image

Analysis 5(4): 12-23, Computer Vision Center/Universitat Autonoma de

Barcelona, Barcelona, Spain, 2005.

[35] M. P. Wand and M. Jones, “Kernel Smoothing”, Chapman and Hall, 1995.

[36] D. Comaniciu, V. Ramesh and P. Meer, “Real-time Tracking of Non-Rigid

Objects using Mean Shift”, IEEE Comp. Vision and Pattern Recognition,

Vol. II, pp142-149, 2000.

[37] K. Fukanaga and L.D. Hostetler, “The Estimation of the Gradient of a

Density Function, with Applications in Pattern Recognition”, IEEE Trans.

Information Theory, Vol. 21, pp.32-40, 1975.

63

6. Bibliography

Page 69: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

[38] G. Hager and P. Belhumeur, “Real-time Tracking of Image Regions with

Changes in Geometry and Illumination”, in Proc. IEEE Conf. on Computer

Vision and Pattern Recognition, San Franscisco, CA, pp. 403-410, 1996.

[39] X. R. Li, F. C. Wu and Z. Y. Hu, “Convergence of a Mean Shift

Algorithm”, Journal of Software, Vol. 16, No. 3, 2005.

[40] H. -J. Schek, “Region based Image Similarity Search” Diploma Thesis,

Institute for Information Systems, 2002.

[41] F. Jing, M. J. Li, H. J. Zhang and B. Zhang, “An Efficient and Effective

Region based Image Retrieval Framework”, IEEE Trans. Image

Processing, Vol. 13, No. 5, May 2004.

64

6. Bibliography

Page 70: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

7. Appendix

To show the potential application of WAR segmentation, this chapter

presents other segmentation examples in which the original images are

segmented through WAR segmentation approach and have the regions

boundaries superposed are shown in Figure 10, 11, 12, 13, and 14.

6. Bibliography

(a) (b) (c) Figure 10. Landscape images (a) Original (b) WAR Segmented (c) Region

Boundaries

(a) (b)

65

Page 71: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

7. Appendix

(c)

Figure 11. House images (a) Original (b) WAR Segmented (c) Region

Boundaries

(a) (b)

(c)

Figure 12. Fruit images (a) Original (b) WAR Segmented (c) Region Boundaries

66

Page 72: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

(a) (b)

(c)

Figure 13. Flower images (a) Original (b) WAR Segmented (c) Region

Boundaries

67

7. Appendix

Page 73: Weighting-Adjacent-Region Segmentation and Application to … · 2011-09-30 · examples of computer graphic design may range from batik pattern design, cartoon design, and etc. Therefore

7. Appendix

(a)

(b) (c)

Figure 14. Flamingo images (a) Original (b) WAR Segmented (c) Region

Boundaries

68