Вы находитесь на странице: 1из 6

A Split/Merge Method with Ranking Selection

for Polygonal Approximation of Digital Curve

Chaojian Shi1,2 and Bin Wang2,


1
Merchant Marine College, Shanghai Maritime University,
Shanghai, 200135, P. R. China
2
Department of Computer Science and Engineering, Fudan University,
Shanghai, 200433, P. R. China
cjshi@shmtu.edu.cn, wangbin.cs@fudan.edu.cn

Abstract. Polygonal approximation of digital curve is an important


problem in image processing and pattern recognition. In traditional split-
and-merge method (SM), there exists the problem of dependence on the
given initial solution. For solving this problem, a novel split-and-merge
method (RSM), which applies the ranking selection scheme of genetic
algorithm to the split and merge process, is proposed. Experiments of
using two benchmark curves to test RSM are conducted and show its
good performance.

1 Introduction
Polygonal approximation of digital curve is a hot topic in pattern recognition
and image processing and has won wide practical applications such as vector-
ization, map service, CAD and GIS applications. The polygonal approximation
problem can be stated as follow: given a digital curve with N points, approxi-
mate it by a polygon with a given total number of segments M so that the total
approximation error is minimized. The polygonal approximation problem is a
NP-hard problem and the size of the search space is C(N, M ) [1].
In the past decades, many approaches have been proposed to solve the polyg-
onal approximation problem. Some of them are based on local search strat-
egy such as sequential tracing[2], split-and-merge method [3] and dominant
points detection [4]. Others are based on global search technique such as ge-
netic algorithm[5,1]and ant colony methods[6]. The local-search-based methods
work very fast. However as the results depend on the selection of starting point
or the given arbitrary initial solution, they usually lack of optimality. The ap-
proaches based on genetic algorithm, tabu search and ant colony methods can
obtain better results, but require more computation time. So they are hardly fit
for real applications.
In this paper, we propose a novel split-and-merge method (RSM). Different
from SM, RSM applies the ranking selection scheme of genetic algorithm to the
split and merge process and effectively solves the problem of final solution’s

Corresponding author.

D.-S. Huang, K. Li, and G.W. Irwin (Eds.): ICIC 2006, LNCIS 345, pp. 651–656, 2006.

c Springer-Verlag Berlin Heidelberg 2006
652 C. Shi and B. Wang

dependence on the initial solution. Experiments of using two benchmarks to test


RSM are conducted and show good performance.

2 Problem Statement
A closed digital curve C can be represented by a clockwise ordered sequence of
points C = {p1 , p2 , . . . , pN }, where N is the number of points of on the curve
and pi+N = pi . We define arc p i pj as the consecutive points pi , pi+1 , . . . , pj , and
chord pi pj as the line segment connecting points pi and pj . The approximation
error between p i pj and pi pj is defined as

e(pi pj , pi pj ) = d2 (pk , pi pj ) (1)
pk ∈pi pj

where d(pk , pi pj ) is the perpendicular distance from point pk to the line segment
pi pj . The polygon V approximating the digital curve C is defined as a set of
ordered line segments V = {pt1 pt2 , pt2 pt3 , . . . , ptM −1 ptM , ptM pt1 }, such that t1 <
t2 < . . . < tM and {pt1 , pt2 , . . . , ptM } ⊆ {p1 , p2 , . . . , pN }, where M is the number
of vertices of the polygon V . The approximation error between the curve C and
its approximating polygon V is defined as follows:


M
E(V, C) = e(pti
pti+1 , pti pti+1 ) (2)
i=1

Then the polygonal approximation problem is formulated as follows: Given a


closed digital curve C = {p1 , p2 , . . . , pN } and an integer number 3 ≤ M ≤ N .
Let SP be the set of all the polygons which approximate the curve C. Let
SSP = {V | V ∈ SP ∧ |V | = M }, where |V | denotes the cardinality of V . Find
a polygon P ∈ SSP such that

E(P, C) = min E(V, C) (3)


V ∈SSP

3 The Traditional Split-and-Merge Method


The traditional split-and-merge method (SM) is a recursive method starting with
a initial polygon V = {pt1 pt2 , pt2 pt3 , . . . , ptM −1 ptM , ptM pt1 }, which approximates
the curve. At each iteration, firstly, a split process is performed. Among all the
curve’s points, select the point pk with the farthest distance from its correspond-
ing edge pti pti+1 , and then remove the edge pti pti+1 and add two new edges pk pti
and pk pti+1 to the polygon. We consider the process as splitting the edge pti ptj
at point pk and term the point pk splitting point. Secondly, the merge process is
performed. Among all the vertices of the polygon, select the vertex ptj which has
the minimum distance from the line segment connecting two adjacent vertices
ptj−1 and ptj+1 , and then remove the edges ptj−1 ptj and ptj ptj+1 and add edge
A Split/Merge Method with Ranking Selection 653

Fig. 1. Split-and-merge process

ptj−1 ptj+1 to the polygon. We consider the process as merging the edges ptj−1 ptj
and ptj ptj+1 at vertex ptj and term the vertex ptj merging point. Fig. 1 give an
example to illustrate the split and merge processes. Repeat the above processes
until the number of iteration is equal to a pre-specified number. The disadvantage
of this method is that, if a bad initial polygon is given, the obtained final solution
may be far away from the optimal one. Therefore, SM is not stable and depends
on the given initial solution.

4 The Proposed Method

In this section, a novel split-and-merge method (RSM), which applies rank-


ing selection scheme of genetic algorithms to the split-and-merge process, is
proposed.

4.1 Splitting Strength and Merging Strength


Let C = {p1 , p2 , . . . , pN } be a digital curve and V = {pt1 pt2 . . . , ptM −1 ptM , ptM pt1 }
be its approximating polygon. In the following, we give the definitions of the
splitting strength at the point of the curve C and merging strength at the vertex
of the polygon V .

Definition 1. Suppose pi ∈ ptk


ptk+1 and ptk ptk+1 ∈ V , the splitting strength at
the point pi is defined as

S(pi ) = d(pi , ptk ptk+1 )/(1 + d(pi , ptk ptk+1 )). (4)

Definition 2. Assume that ptk be a vertex of the polygon V , ptk−1 and ptk+1 be
its two adjacent vertices. The merging strength of the vertex ptk is defined as

M (ptk ) = 1/(1 + d(ptk , ptk−1 ptk+1 )). (5)


654 C. Shi and B. Wang

4.2 Ranking Selection Strategy

Selection is an important phase of genetic algorithms (GA). A wide variety


of selection strategies have been proposed. Most of them are based on fitness-
proportionate selection and may lead to premature convergence. To avoid pre-
mature convergence, Baker proposed a ranking selection scheme in [9]. The idea
of this strategy is that: at each generation, all the individuals in the population
are sorted according to their fitness value, and each individual is assigned a rank
in the sorted population. For N individual in the population, the best individual
gets rank 1, whereas the worst receives rank N. The selection probabilities of the
individuals are given by some function of their rank. Let P = {x1 , x2 , . . . , xN }
denote the sorted population and f (x1 ) ≥ f (x2 ) ≥ . . . ≥ f (xN ), where f (·)
is the fitness function of the individual. Then the selection probability p(xi )
must satisfies the following conditions: (1) p(x1 ) ≥ p(x2 ) . . . ≥ p(xN ) and (2)
N
p(xi ) = 1.
i=1
Inspired by the above selection strategy, we apply it to the traditional split-
and-merge method for the selection of splitting and merging points. A func-
tion for calculating the selection probabilities is developed here. Assume that
C = {x1 , x2 , . . . , xM } be an ordered set of points. Here, we let the ordered set
C corresponds to a sorted population and each point of C corresponds to an
individual. Then we can use the above ranking selection strategy to perform the
selection of points in C. For each point xi , we assign a selection probability p(xi )
to it and calcaulate the p(xi ) via the following equations:


⎨ p(xi ) = p(xi−1 ) · e−t/(i−1) , i = 2, . . . , M

M (6)
⎩ p(xi ) = 1
i=1

where t is a parameter which is used to adjust the probability distribution. In


general, we empirically set the parameter t in [1.4, 2.4].

4.3 Algorithm Flow

The proposed algorithm has two parameters, one is the parameter t for adjusting
the probability distribution, the other is the number G of iterations.

input. The digital curve C and the number of polygon’s sides M .


output. The polygon B with M edges which approximates C.
step 1. Generate an initial polygon V with M edges by randomly selecting M
points from C as the vertices of the polygon. Set B = V and k = 0 .
step 2. For those points of C which are not the vertices of the polygon, calculate
their splitting strength using Eq. 4.
step 3. Sort these points by their splitting strength value in descending order
and select a point by the ranking selection strategy. Then, perform splitting
process at the selected point.
A Split/Merge Method with Ranking Selection 655

step 4. For each vertex of V , calculate its merging strength value using Eq. 5.
step 5. Sort these vertices by their merging strength in descending order and
select a vertex using the ranking selection strategy. Then, perform merging
process at the selected vertex.
step 6. Compute the approximation error of the polygon V using Eq. 2. If it is
smaller than the approximation error of polygon B, then replace B with V .
step 7. Set k + 1 to k, if k <= G then go to step 2.
step 8. Output B.

5 Experimental Results and Discussions


In literature [5], Yin proposed a genetic-algorithm (YinGA) to solve the polyg-
onal approximation and it has been shown to outperform those based on local
search techniques including the traditional split-and-merge method. The disad-
vantage of YinGA is that its computational load is relatively high. Chen and Ho
[1] proposed another genetic algorithm (EEA) for the polygonal approximation
and it was empirically shown that EEA outperforms YinGA on the quality of
solutions and the convergence speed. So, we only compare the proposed RSM
with EEA.

(a) Chromosome (b) Semicircle

Fig. 2. Two digital curves

Table 1. Experimental results for EEA and RSM

Result of Fig. 3(a) Result of Fig. 3(b)


WORST AVERAGE VARIANCE WORST AVERAGE VARIANCE
K EEA RSM EEA RSM EEA RSM K EEA RSM EEA RSM EEA RSM
8 17.8 16.4 15.5 14.4 2.3 1.4 10 61.6 52.7 44.1 47.6 76.5 12.6
9 15.9 14.0 13.5 12.7 1.6 0.3 12 33.2 31.4 29.5 28.5 5.1 1.6
12 7.8 6.7 6.8 5.9 0.9 0.1 14 24.3 18.5 20.1 17.9 4.7 0.7
14 6.2 4.8 5.1 4.5 0.6 0.0 17 17.7 13.9 14.6 13.4 2.2 0.1
15 5.4 4.1 4.3 4.1 0.3 0.0 18 15.6 12.8 12.9 12.1 1.6 0.1
17 4.0 3.2 3.6 3.2 0.2 0.0 19 13.2 11.7 11.5 11.0 0.9 0.1
18 3.4 2.9 3.0 2.9 0.1 0.0 22 9.9 7.9 8.5 7.6 0.6 0.0
27 6.1 4.0 5.0 4.0 0.5 0.0
30 4.4 2.8 3.6 2.7 0.3 0.0
Total 45.3 52.7 51.8 58.7 5.9 24.4 186.0 155.7 149.8 144.8 92.4 15.2
RSM/EEA 86.1% 92.1% 30.5% 83.7% 96.7% 16.5%
656 C. Shi and B. Wang

Two benchmarks, a chromosome curve with 60 points and a semicircle curve


with 102 points which are shown in Fig. 2(a) and (b), respectively, are used to
test the performance of RSM. The parameter of RSM are set as follows: t=1.8
and G=1500. The platform of conducting all the experiments is a PC with CPU
Pentium III 400 under Windows 2000.
The simulation conducts ten independent runs for RSM and EEA. The worst
solution, average solution and variance of solutions of ten independent runs are
listed in Table 1. The average computation time of RSM and EEA for Fig. 2(a)
and (b) are about 0.09 and 0.27 seconds for chromosome curve, and 0.41 and
0.87 seconds for semicircle curve, respectively. We can see that RSM outperforms
EEA in the quality of the worst solution, average solution, variance of solutions
and the convergence speed.

6 Conclusions
A split-and-merge method with ranking selection (RSM) has been proposed for
the polygonal approximation of digital curve. With this method, the problem
of dependence on the initial solution of the traditional split-and-merge method
has been successfully solved. The experimental results demonstrate the good
performance of RSM.

Acknowledgement
The research work in this paper is partially sponsored by Shanghai Leading
Academic Discipline Project, T0603.

References
1. Ho, S. Y., Chen, Y. C.: An Efficient Evolutionary Algorithm for Accurate Polygonal
Approximation. Pattern Recognition, 34 (2001) 2305–2317
2. Kurozumi, Y., Davis, W. A.: Polygonal Approximation by The Minimax Method.
Comput. Graphics Image Processing, 19 (1982) 248–264
3. Wu, J.S., Leou, J.J.: New Polygonal Approximation Schemes for Object Shape Rep-
resentation. Pattern Recognition, 26 (1993) 471–484
4. Teh, H.C., Chin, R.T.: On Detection of Dominant Points on Digital Curves. IEEE
Trans Pattern Anal Mach Intelligent, 11(8) (1989) 859–872
5. Yin, P.Y.: Genetic Algorithms for Polygonal Approximation of Digital Curves. Int.
J. Pattern Recognition Artif. Intelligent, 13 (1999) 1–22
6. U. Vallone: Bidimensional Shapes Polygonalization by ACO. Proceedings of The
3rd International Workshop on Ants Algorithms, Brussels, Belgium (2002) 296–297
7. Ray, B. K., Ray, K. S.: Determination of Optimal Polygon from Digital Curve Using
L1 Norm. Pattern Recognition, 26 (1993) 505–509
8. Phillips, T. Y., Rosenfeld, A.: An ISODATA Algorithm for Straight Line Fitting.
Pattern Recognition letters, 7 (1988) 291–297
9. Baker, J. F: Adaptive Selection Methods for Genetic Algorithms. Grefenstette J.
J. (Ed.) Proc. of the 1st Int’1. Conf. on Genetic Algorithms, Lawrence Earlbaum
Associates, Hilladale, NJ(1985) 101–111

Вам также может понравиться