Pattern Recognition Letters 31 (2010) 1997–2005
Contents lists available at ScienceDirect
Pattern Recognition Letters journal homepage: www.elsevier.com/locate/patrec
Polygonal approximation of digital planar curves through adaptive optimizations Mohammad Tanvir Parvez *, Sabri A. Mahmoud Information and Computer Science Department, King Fahd University of Petroleum & Minerals (KFUPM), Dhahran 31261, Saudi Arabia
a r t i c l e
i n f o
Article history: Received 24 November 2009 Available online 12 June 2010 Communicated by G. Borgefors Keywords: Dominant points Polygonal approximation Planar curves Contour processing
a b s t r a c t In this paper, we present a novel non-parametric polygonal approximation algorithm for digital planar curves. The proposed algorithm first selects a set of points (called cut-points) on the contour which are of very ‘high’ curvature. An optimization procedure is then applied to find adaptively the best fitting polygonal approximations for the different segments of the contour as defined by the cut-points. The optimization procedure uses one of the efficiency measures for polygonal approximation algorithms as the objective function. Our algorithm adaptively locates segments of the contour with different levels of details. The proposed algorithm follows the contour more closely where the level of details on the curve is high, while addressing noise by using suppression techniques. This makes the algorithm very robust for noisy, real-life contours having different levels of details. The proposed algorithm performs favorably when compared with other polygonal approximation algorithms using the popular shapes. In addition, the effectiveness of the algorithm is shown by measuring its performance over a large set of handwritten Arabic characters and MPEG7 CE Shape-1 Part B database. Experimental results demonstrate that the proposed algorithm is very stable and robust compared with other algorithms. Ó 2010 Elsevier B.V. All rights reserved.
1. Introduction Extracting meaningful information and features from the contour of digital planar curves has been widely used in shape analysis and recognition (Carmona-Poyato et al., 2010). For this purpose, a number of contour representations have been proposed in the literature. These include: contour representations based on a coordinate system, chain code, signature representation, arc height function (AHF), polygonal approximations, etc. (Zhang and Lu, 2004). Polygonal approximation schemes, also called dominant/corner points schemes, for contour representation are useful in shape analysis and recognition for several reasons. Information on the curve is concentrated at the corner points (Attneave, 1954). Outline of a shape captured by polygonal approximations can be utilized for feature extraction for shape recognition. Polygonal approximations can avoid small spurious lines/noise in the contour, making the feature extraction phase more reliable. This in turn can improve the performance of the shape analysis system. Among the many algorithms proposed for dominant points detection, two general approaches can be identified: (1) algorithms that try to fit the curve with minimum number edges/vertices which satisfy some error criteria (Hosur and Kai-Kuang, 1999; Perez and Vidal, 1994) and (2) algorithms that find a subset of the * Corresponding author. Tel.: +966 38602175; fax: +966 38602174. E-mail addresses:
[email protected],
[email protected] (M.T. Parvez),
[email protected] (S.A. Mahmoud). 0167-8655/$ - see front matter Ó 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.patrec.2010.06.007
curve points as dominant points (Arcelli and Ramella, 1993; Carmona-Poyato et al., 2005; Carmona-Poyato et al., 2010; Marji and Siy, 2003, 2004; Masood and Haq, 2007; Masood, 2008; Teh and Chin, 1989; Wu, 2003). Some researchers have divided the algorithms utilizing the second approach into three categories (Masood, 2008): (a) sequential (Marji and Siy, 2004; Teh and Chin, 1989), (b) split-and-merge (Guru et al., 2004) and (c) heuristicsearch (Huang and Sun, 1999). A large number of algorithms for dominant points detection first find the region of support for each point Pi on the curve contour C. Region of support of Pi consists of the points {Pik, . . . , Pi, . . . , Pi+k’} 0 on C for some k and k . A significance measure is calculated for Pi using some mathematical operations which involve the support region of Pi. Dominant points are expected to have high significance values and are selected by suppressing unimportant points. The algorithm by Arcelli and Ramella (1993) extracts an initial set of points from the chain-coded representation of the contour. An iterative procedure is used to remove some points and insert new ones until the selection process converges towards an expected perceptually significant set of points. Marji and Siy (2004) proposed an algorithm for polygonal approximation of digital planar curves. The algorithm calculates the left and right-support region for each point. The end points of the support region are called nodes. The algorithm extracts the best subset from the set of nodes that covers the entire shape boundary by suppressing unimportant dominant points. Carmona-Poyato et al. (2005) gave a non-parametric algorithm for dominant point detection. An adaptive bending value is used to
1998
M.T. Parvez, S.A. Mahmoud / Pattern Recognition Letters 31 (2010) 1997–2005
calculate the estimated curvature at each point. Once the initial set of dominant points is obtained, points with minimal effects on the global contour are removed. The algorithm uses collinear-points suppression similar to Marji and Siy (2004). An optimization procedure is used to obtain the threshold value for collinear-points suppression. The algorithm by Carmona-Poyato et al. (2010) iteratively suppresses an initial set of dominant points until some final condition is satisfied. Performance of this algorithm can vary significantly based on the choice of the final condition. Masood (2008) proposed a method for polygonal approximation by dominant point (DP) deletion. All the break-points (points where the boundary takes a turn) are selected in the initial set of DP. The algorithm iteratively deletes DPs with least associated error value. Then an optimization procedure is used to optimize the squared error of the resulting polygonal approximation. No clear stopping criterion is mentioned in this scheme. Existing algorithms for polygonal approximations are not well suited for real-life contours for several reasons. The methods which employ significant-measures (like Arcelli and Ramella, 1993) are largely affected by the noise on the contour. The significance of a point P is measured considering the properties of the contour in the locality of P. Algorithms in this class consider the different levels of details present in the contour. However, the defined significance measure may not be reliable if the contour is noisy. Other algorithms (Carmona-Poyato et al., 2010; Marji and Siy, 2004) suppress redundant points based on measures other than significant-measures. These methods have several drawbacks. These algorithms remove redundant points based on some measures involving the entire curve. This can reduce the efficiency of the algorithm. Also, these algorithms do not consider the various levels of details present in the different segments of the curve. It is expected that there should be less (more) dominant points where the curve is ‘‘straight” (‘‘curved”). In this paper, we propose a novel approach for adaptive polygonal approximation that captures the benefits of both significance measure and suppression technique, while avoiding the drawbacks. Our method does not directly define a significance measure for a point. Rather, the contour is adaptively divided into segments. Dominant points are found in the locality of a segment by measuring the quality of the polygonal approximation for that particular segment. This novel approach enables us to handle the different levels of details present in the contour. Thus, our algorithm employs less number of dominant points where the contour is relatively ‘straight’ and more dominant points are kept where the curve has higher level of details. Moreover, we propose constrained collinear-points suppression (CCS) technique to remove redundant dominant points. CCS effectively removes the noise on the curve, while the optimization algorithm ensures that significant points are retained by the algorithm. CCS is very robust for removing redundant dominant points while preserving the ‘width’ and ‘length’ of the shape. This is very important in many shape understanding and recognition systems, like handwritten text recognition. The rest of the paper is organized as follows. Section 2 outlines some basic concepts. Section 3 describes the proposed algorithm. Experimental results are given in Section 4. Finally, Section 5 is the conclusions.
Freeman chain code of C consists of the n vectors ~ ci ¼ Pi1 P i , each of which can be represented by an integer f = 0, 1, . . . , 7. Here, 1/ 4pf is the angle between the x-axis and the vector. Researchers have proposed different measures to evaluate the quality of polygonal approximations (Carmona-Poyato et al., 2010; Marji and Siy, 2004; Masood, 2008). We briefly describe these measures below. Number of dominant points (nd). Compression ratio, CR = nd/n, where n is the number of points in the contour. P Integral sum of square error, ISE ¼ ni¼1 e2i , where ei is the distance from Pi to the approximated line-segment. Weighted sum of square error, WE = ISE/CR. Rosin (1997) shows that the two terms in WE are not balanced causing the measure to be biased towards approximations with lower ISE (which can be easily attained by increasing the number of detected dominant points) and hence is not the best measure for comparing contours with different numbers of dominant points. Marji and Siy (2004) used a modified version of WE measure defined as WEx = ISE/CRx, where x is used to control the contribution of the denominator to the overall result in order to reduce the imbalance between the two terms. They used x = 1, 2 and 3. In some applications, like modeling handwritten characters by polygonal approximations, the length of the polygonal approximation should be close to the length of the contour. For this purpose, we define length ratio, LR = Ld/L, where L is the length of the contour and Ld is the length of the polygonal approximation. It is desirable that any algorithm for polygonal approximation maintains similar LR for different images of different resolutions. 3. Proposed algorithm In this section, we describe our novel scheme for polygonal approximations of digital planar curves. The algorithm FindPolygonalApproximation shows the major steps of our method. The image is first converted into a smoothed binary image and then the contour is extracted. All the break-points on the contour are then detected. A small set of points (called cut-points) is obtained from the break-points. The original contour is divided into a number of curve segments using the cut-points. A polygonal approximation is adaptively found for each of these segments. Finally, the polygonal approximation of the original contour consists of the polygonal approximations of the individual segments. Algorithm. FindPolygonalApproximation
S1. Smooth the binary image and extract the contour. S2. Find all the break-points in the contour. S3. Find the set of cut-points by iterative suppression of redundant break-points using CCS. S4. Obtain a polygonal approximation for each contour segment defined by the cut-points through adaptive optimization procedure. We now describe each of these steps in detail.
2. Background 3.1. Binarization and smoothing In this section, we present some basic concepts related to polygonal approximation of digital planar curves. The contour of a digital planar image is a closed discrete curve C described by a sequence of n integer-coordinate points: C = {Pi = (xi, yi), i = 1, 2, . . . , n}, where Pi+1 is a neighbor of Pi (modulo n). The
The grayscale image is binarized using the algorithm by Otsu (1979) and then smoothed using statistical average based smoothing (Mahmoud, 1994). Contour of the smoothed image is extracted using the algorithm in (Pavlidis, 1982).
M.T. Parvez, S.A. Mahmoud / Pattern Recognition Letters 31 (2010) 1997–2005
1999
3.2. Selection of break-points Let ci, i = 1, 2, . . . , n be the chain code for n points on the contour C = Pi (xi, yi). A point Pi is called a break-point if ci and ci+1 are different. Here, cn+1 is same as c1. The polygonal approximation defined by the break-points approximates the contour closely with zero ISE. However, this polygonal approximation is affected by the noise on the contour and may not be able to model the general outline of the planar curve well. Therefore, further processing is required to remove the redundant points from this set of break-points.
Fig. 2. Illustration of undesirable behavior of collinear-point suppression: (a) Arabic character Hamza, (b, c) approximation by Marji and Siy (2004) algorithm (dcol = 1 and 2, respectively) where (c) misses important part of the character and has crossing edges.
3.3. Set of cut-points Cut-points are obtained by iterative suppression of points from the set of break-points. In Section 3.3.1, we describe our point-suppression technique. In Section 3.3.2, we give the procedure for obtaining the cut-points. 3.3.1. Collinear-points suppression Collinear-points suppression (Carmona-Poyato et al., 2010; Marji and Siy, 2004) can be utilized to remove redundant points from the set of break-points. This is illustrated in Fig. 1 and described below. We say that a set of dominant points (or break-points) {Pi, Pi+1, . . . , Pi+k} are consecutive, if no other points on the contour segment between Pi+j and Pi+j+1 are selected as dominant points, j e {0, 1, 2, . . . , k 1}. Let Pi, Pj and Pk be three consecutive dominant points on C. In collinear-points suppression, Pj is suppressed if the perpendicular distance dper from Pj to the line joining Pi and Pk is less than some predefined threshold dcol. Marji and Siy (2004) used a fixed value of 1 for dcol which may not be suitable for all images. Carmona-Poyato et al. (2005) adaptively determined the value for dcol that optimizes some WEx (x = 1, 2 or 3) measures. However, this idea of collinear-points suppression sometimes can produce undesirable results (see Fig. 2c). As shown in Fig. 2c, the approximation has missed significant portions of the contour and resulted in self-crossing polygon. The reason behind this is explained below. Let Pi, Pj and Pk be three consecutive dominant points on C. As shown in Fig. 3, Pj will be suppressed since the perpendicular distance dper from Pj to the line joining Pi and Pk is less than the threshold dcol. However, the minimum distance from Pj to the linesegment joining Pi and Pk may be far higher than dcol. In this case, it is undesirable to remove Pj. To avoid this situation and the situation where suppression of points may result in self-crossing polygons, we propose constrained collinear-points suppression (CCS). In CCS, the following two constraints on Pi, Pj and Pk must be satisfied: Constraint 1: The triangle formed by Pi, Pj and Pk is an acute triangle, and Constraint 2: For each unsuppressed point Pl other than Pi, Pj and Pk, the minimum distance from Pl to the line-segment joining Pi and Pk is greater than dcol. Constraint 1 effectively removes the possibility of suppressing Pj, when the minimum distance from Pj to the line-segment joining
Fig. 1. Illustration of collinear-points suppression (Marji and Siy, 2004).
Fig. 3. Illustration of the reason behind undesirable behavior of collinear-points suppression.
Pi and Pk is higher than the threshold dcol. Constraint 2 preserves the width of the writing strokes and avoids the case where suppression of points may result in self-crossing polygons. Fig. 4 illustrates Constraint 2. The three consecutive dominant points Pi, Pj and Pk satisfy Constraint 1 and the minimum distance from Pj to the line-segment joining Pi and Pk is less than dcol. However, the minimum distance from Pl to the line-segment joining Pi and Pk is also less than dcol. Therefore, Constraint 2 is violated and Pj cannot be suppressed. Let {Pi, Pj, Pk} be three consecutive dominant points on contour C. Let dper be the perpendicular distance of Pj to the line joining Pi and Pk. The left-support region of Pj consists of the points {Pi, Pi+1, . . . , Pj1}. Similarly, the right-support region of Pj consists of the points {Pj+1, Pj+2, . . . , Pk}. The total number of points in the left and right-support regions of Pj is called the strength of Pj. Let dcol be some predefined threshold. Now, in our algorithm, removal of redundant dominant points is done using the following procedure: Procedure ReduceDominantPoints Iterate until no dominant points can be removed – Sort the dominant points based on strength first, then based on distance from the centroid of C. – For each dominant point Pj from the sorted list (weakest point first): o Suppress Pj if all three conditions are satisfied: dper < dcol. The triangle formed by Pi, Pj and Pk is an acute triangle. For each unsuppressed dominant point Pl other than Pi, Pj and Pk, the minimum distance from Pl to the line-segment joining Pi and Pk is greater than dcol. o Update the strength of the other candidate dominant points and sort them.
Fig. 4. Illustration of Constraint 2 for constrained collinear-points suppression.
2000
M.T. Parvez, S.A. Mahmoud / Pattern Recognition Letters 31 (2010) 1997–2005
Fig. 5 illustrates the operation of ReduceDominantPoints procedure for the Arabic ligature Laam-Aleef ( ). Fig. 5c shows the approximation after the break-points have been suppressed with dcol = 1. Similarly, Fig. 5d–f illustrate the approximations after the redundant points have been suppressed with dcol = 1.5, 2 and 2.5, respectively. Note that, the number of dominant points is reduced gradually as the value of the threshold dcol is increased.
RCSdmin can be selected by optimizing any appropriate efficiency measures for polygonal approximation. Discussion on the proper selection of efficiency measures for optimization is given in Section 4. The polygonal approximation of the original contour C is formed by concatenating the polygonal approximations of all the segments Si.
3.3.2. Finding the set of cut-points We now describe the procedure for obtaining cut-points by iterative suppression of break-points. Break-points are selected by Step S2 of our algorithm. This set of break-points is gradually reduced by applying ReduceDominantPoints procedure (3.3.1). This reduction starts with the threshold dcol = 0.5, since the minimum possible vap lue for dcol is 1/ 5 = 0.447 (Carmona-Poyato et al., 2010). The value of dcol is gradually increased and more break-points are suppressed. The following procedure captures this process: Procedure FindCutPoints
4. Experimentations
– The Candidate Set (CS) consists of all the break-points in contour C. – Initial value for dcol = 0.5. – Repeat: o Suppress redundant points from CS by ReduceDominantPoints procedure. Resulting set of points is called Reduced Candidate Set (RCS) and denoted by RCSdcol . o CS ! RCSdcol . o Increase the value for dcol. – Until a terminating condition is satisfied. The terminating condition is defined as follows. Let V(k) be the set of points retained at iteration k of FindCutPoints. We terminate FindCutPoints whenever V(k) = V(k+1), for some k P 1. The final reduced set is the set of cut-points. 3.4. Adaptive optimizations Let D1, D2, . . . , Dk be the sequence of cut-points obtained from FindCutPoints. Each pair of cut-points Di, Di+1, where i = 1, 2, . . . , k and ik+1 = i1, defines a segment Si of the original contour C. The segment Si consists of the points Pj ¼ Di ; Pjþ1 ; . . . ; Pj0 ¼ Diþ1 of C. Let the maximum threshold for dcol used in FindCutPoints be denoted by dlimit. Now, the following procedure is used to obtain the polygonal approximation of the segment Si. Procedure LocalOptimization – The Candidate Set (CS) consists of all the break-points in Si. – Initial value for dcol = 0.5. – Repeat until dcol > dlimit o Suppress redundant points from CS using the procedure ReduceDominantPoints. Resulting set of points is called Reduced Candidate Set (RCS) and denoted by RCSdcol . o CS RCSdcol . o Increase the value for dcol. – Select RCSdmin as the set of domain points for Si, where RCSdmin optimizes some efficiency measures among all RCSdcol .
The proposed algorithm is applied to the four popular shapes: chromosome, leaf, semicircles and infinity. The results obtained by our algorithm for these four shapes are shown in Figs. 6–9. A comparative result for the proposed method with other existing algorithms is presented in Table 1. In LocalOptimization procedure, dcol is varied between 1 and dlimit, with a 0.5 step. It is worth noting that, for each of the four shapes, our algorithm produces the same polygonal approximation when either of the WE, WE2 and WE3 measures is used as the objective function. Carmona-Poyato et al. (2005) discarded WE3 measure as an objective function, since their method produced very high ISE for this case. This can be seen in Table 1. However, the proposed algorithm does not suffer from this limitation. A possible reason for this stable behavior of our algorithm is that the optimal value for the threshold is searched adaptively in the local segments of the curve, rather than the entire contour. Thus the proposed algorithm is more robust in terms of the selection of objective function. The comparative results presented in Table 1 can be summarized as follows: For the chromosome shape, the proposed method uses the least number of dominant points, similar to Marji and Siy algorithm (2004). However, their algorithm produces lower ISE. In terms of WE3 measure, Marji-Siy’s algorithm performed the best. For the leaf shape, the presented algorithm uses less number of dominant points, except for Marji and Siy (2004) and Carmona-Poyato et al. (2005) algorithms (with WE3 as measure). However, both of these methods produce very high ISE. Also, they perform worse in terms of WE2 and WE3 measures. In terms of WE3 measure, Carmona-Poyato et al. algorithm (2010) performs the best, then our algorithm. For semicircle shape, again, our algorithm uses less number of dominant points, except for Marji and Siy (2004) and Carmona-Poyato et al. (2005) algorithms (with WE3 as measure). However, both of these methods produce very high ISE. Masood’s algorithm (Masood, 2008) obtains the lowest WE3 measure, however, it uses a larger number of dominant points. For the infinity shape, our method and Carmona-Poyato’s algorithm (Carmona-Poyato et al., 2005) use the least number of dominant points. Masood’s algorithm (Masood, 2008) obtains the lowest WE3, using slightly more points. We believe that these four popular shapes are too simple to be used as benchmark for comparing different dominant-points algorithms. A better evaluation could be based on specific applications
Fig. 5. Illustration of the procedure ReduceDominantPoints: (a) Arabic ligature Laam-Aleef ( ), (b) contour after smoothing, (c–f) polygonal approximations of (b) using ReduceDominantPoints (dcol = 1, 1.5, 2, 2.5).
M.T. Parvez, S.A. Mahmoud / Pattern Recognition Letters 31 (2010) 1997–2005
2001
Fig. 6. Dominant points of the chromosome contour: (a) original contour, (b) selection of break-points, (c, d) approximation with threshold dcol = 0.5, 1.0, (e) approximation defined by the set of cut-points, (f) approximation after optimizations.
Fig. 7. Dominant points of the leaf contour: (a) original contour, (b) selection of break-points, (c) approximation defined by the set of cut-points (dlimit = 4.0), (d) approximation after optimizations.
Fig. 8. Dominant points of the semicircle contour: (a) original contour, (b) selection of break-points, (c) approximation defined by the set of cut-points (dlimit = 2.5), (d) approximation after optimizations.
Fig. 9. Dominant points of the infinity contour: (a) original contour, (b) selection of break-points, (c) approximation defined by the set of cut-points (dlimit = 2.5), (d) approximation after optimizations.
of the algorithms. In addition, the performance of the algorithms should be measured statistically for large sets of real-life contours. In terms of approach, our method is closer to the algorithms in (Carmona-Poyato et al., 2005, 2010; Marji and Siy, 2004). The algorithm of Marji and Siy (2004) is limited by the fixed value for dcol. Carmona-Poyato et al. (2005) proposed a way to alleviate this limitation by selecting the value for dcol by optimizing WEx measures. However, performance of their method can vary widely based on the selection of the objective function. Moreover, all these algo-
rithms utilize collinear-points suppression which can give undesirable results as explained in Section 3.3. The proposed algorithm overcomes these limitations and is therefore more robust compared to the existing algorithms as explained below. The presented technique uses constrained collinear-points suppression (CCS), rather than collinear-points suppression (CS) proposed in the literature. To demonstrate the effectiveness of CCS, we run our algorithm on 1948 samples of isolated handwritten Arabic characters written by four writers (Abuhaiba et al., 1994).
2002
M.T. Parvez, S.A. Mahmoud / Pattern Recognition Letters 31 (2010) 1997–2005
Table 1 Comparative results for the chromosome, leaf, semicircle and infinity shapes.
a b c
Contour
Method
nd
CR
ISE
WE
WE2
WE3
Chromosome (n = 60)
Teh and Chin (1989) Wu (2003) Marji and Siy (2004) Carmona-Poyato et al. (2005)a Carmona-Poyato et al. (2005)b Masood (2008) Carmona-Poyato et al. (2010) Our methodc
15 16 10 14 11 15 15 10
4.00 3.75 6.00 4.21 5.36 4.00 4.00 6.00
7.20 4.70 10.01 4.93 9.60 3.88 4.27 14.34
1.88 1.65 1.66 1.17 1.79 0.97 1.07 2.39
0.470 0.440 0.277 0.278 0.334 0.243 0.267 0.398
0.118 0.117 0.046 0.066 0.062 0.061 0.067 0.066
Leaf (n = 120)
Teh and Chin (1989) Wu (2003) Marji and Siy (2004) Carmona-Poyato et al. (2005)a Carmona-Poyato et al. (2005)b Masood (2008) Carmona-Poyato et al. (2010) Our methodc
29 24 17 23 17 23 23 21
4.14 5.00 7.06 5.17 7.00 5.22 5.22 5.71
14.96 15.93 28.67 15.63 37.36 9.46 10.68 13.82
3.62 3.19 4.06 3.02 5.33 1.81 2.05 2.42
0.874 0.638 0.575 0.584 0.761 0.347 0.391 0.423
0.211 0.128 0.081 0.113 0.109 0.067 0.075 0.074
Semicircles (n = 102)
Teh and Chin (1989) Wu (2003) Marji and Siy (2004) Carmona-Poyato et al. (2005)a Carmona-Poyato et al. (2005)b Masood (2008) Carmona-Poyato et al. (2010) Our methodc
22 26 15 24 11 26 26 17
4.64 3.92 6.80 4.21 9.18 3.92 3.92 6.00
20.61 9.04 22.70 9.88 59.06 4.05 4.91 19.02
4.45 2.31 3.34 2.35 6.03 1.03 1.25 3.17
0.959 0.589 0.491 0.558 0.700 0.263 0.319 0.528
0.207 0.150 0.072 0.133 0.076 0.067 0.082 0.088
Infinity (n = 45)
Teh and Chin (1989) Wu (2003) Carmona-Poyato et al. (2005)a Carmona-Poyato et al. (2005)b Masood (2008) Carmona-Poyato et al. (2010) Our methodc
13 13 10 9 11 10 9
3.46 3.36 4.40 4.89 4.09 4.50 5.00
5.93 5.78 5.56 7.34 2.90 5.29 7.35
1.71 1.67 1.26 1.50 0.71 1.18 1.47
0.494 0.497 0.287 0.306 0.173 0.261 0.294
0.143 0.148 0.065 0.063 0.042 0.058 0.059
Using WE2 as objective function. Using WE3 as objective function. The measures are calculated from the polygonal approximation of the entire curve.
Fig. 10 illustrates some samples presented in their original size. As can be seen, the contours are not smooth and there are variations in thickness even in the same character. Also, different shapes of the characters give different kinds of contours. For all the characters, the average length ratio (ALR) is computed for each value dcol in the range [1, 6] with 0.5 steps. ALR is computed by restricting FindCutPoints procedure to iterate until dcol reaches some limit. We also compute ALR for the algorithm in (Marji and Siy, 2004) for the same values of dcol. Fig. 11 illustrates ALR against the threshold dcol for the proposed method and the algorithm in Marji and Siy, 2004. Clearly, CCS shows more stable behavior over the whole range of values for dcol with only 5% variations in ALR. However, Fig. 11 shows that CS performance is inferior for larger values of dcol with more than 20% variations in ALR. This stable behavior of is due to the nature of CCS which ensures that significant portion
the contour is not discarded when the value for dcol becomes high. To demonstrate the stability of the proposed method for different objective functions, we run our algorithm on the same Arabic characters separately with WE2 and WE3 as objective functions. The WE2 and WE3 measures for all the characters are obtained each of these runs. Difference in WE2 (WE3) measures from both runs for each character is computed and cumulative number of characters for which the difference in WE2 (WE3) measures is from 0.0 to 0.05 is calculated. As can be seen from Fig. 12, difference in WE3 measure per sample varies by less than 5% for more than 95% of the samples. On the other hand, difference in WE2 measure per sample varies by less than 5% for around 72% of character samples. These very low variations in different measures over a large portion of the samples demonstrate the robustness of our algorithm with regard to the choice of objective functions.
Fig. 10. Illustrations of sample from the Arabic handwritten character database.
2003
M.T. Parvez, S.A. Mahmoud / Pattern Recognition Letters 31 (2010) 1997–2005
Table 2 Statistics of number of characters that use distinct threshold values for different segments for optimizations. Total number characters is 1948.
Percentage of total characters
Fig. 11. Plot of average length ratio of polygonal approximations for handwritten Arabic characters.
1 0.9 0.8 0.7 0.6 WE3 difference WE2 difference
0.5 0.4 0
0.005
0.01
0.015
0.02
0.025
0.03
0.035
0.04
0.045
0.05
Difference in WE2 and WE3 measures Fig. 12. Plot of differences in WE2 and WE3 measures against normalized cumulative number of characters (WE2 and WE3 as objective functions).
A common characteristic of the algorithms in (Carmona-Poyato et al., 2005, 2010; Marji and Siy, 2004) is that they all use a single value for dcol to suppress the dominant points of the entire curve. The algorithm in (Carmona-Poyato et al., 2010) iteratively increases the value for dcol. However, a single value for dcol is used to suppress points at each iteration. Using a single value for the threshold for the entire contour C effectively treats all the portions of C at the same resolution. However, the details can vary from one segment to another in C. There should be more dominant points where the contour has more details, effectively using lower value for dcol. For the segment of C, where the contour is more or less ‘‘straight”, less number of dominant points are required. For this reason, our method uses different values for dcol based on the different levels of details of C. Table 2 shows the total number of character samples that use distinct threshold values for different segments of the character contours. Results are shown where WE, WE2 and WE3 are used as objective functions. As Rosin (1997) showed, WE measure is biased
Number of distinct threshold values used per character
# of Characters Minimize WE3
Minimize WE2
Minimize WE
1 2 3 4
460 1018 411 59
797 1037 109 5
1353 588 7 0
towards approximations with lower ISE. This implies that, when WE is used as the objective function, the approximations result in larger number of dominant points. This in turn implies that lower values for dcol are used to obtain the approximations with larger number of dominant points. This is evident from Table 2, as most of the characters employ only one threshold value for all the segments, when WE is used as the objective function. However, when WE2 and WE3 are used as objective functions, more and more character samples use more than one distinct threshold values for the contour segments. Therefore, we suggest using either WE2 or WE3 as the objective function in the LocalOptimization procedure. In addition, Table 2 shows that at least 60% of the characters utilize more than one distinct threshold values for optimizing either WE2 or WE3 for different segments of the character contour. This demonstrates the desirability of using different threshold values for different segments of the character contour for suppression of dominant points, when either WE2 or WE3 is used as objective function. Figs. 13 and 14 illustrate the results of the proposed algorithm for two handwritten Arabic characters: Taa ( ) and Meem ( ). The benefits for using different thresholds for different parts of the contour are evident in these figures. For example, Fig. 13c shows the cut-points obtained by our algorithm for Taa. These cut-points define seven segments on the contour as labeled by numbers in Fig. 13c. The approximations in Fig. 13d and e are obtained by using only one threshold value for all the seven segments in Fig. 13c, with dcol = 1.0 and 1.5 for Fig. 13d and e, respectively. Fig. 13f illustrates the approximation of Taa ( ) when our algorithm adaptively selects the threshold value for each segment by optimizing WE3 measure. It can be seen from Fig. 13f that the presented algorithm utilizes more dominant points where the contour is curvier while keeping less number of dominant points for segments which are straight. For example, for the segments labeled 1 and 2 in Fig. 13c, the proposed algorithm uses more dominant points in the final approximation in Fig. 13f. However, for the segments labeled 3 and 4 in Fig. 13c, our algorithm uses higher value for dcol to keep less number of dominant points. However, when only one value is used for threshold dcol, the approximations can either miss important part of the contour (like the approximation for segment 1 and 2 in Fig. 13e) or is affected by noise (like the approximation for segments 3 and 4 in Fig. 13d).
Fig. 13. Illustration of polygonal approximations of the Arabic character Taa ( ): (a) original image, (b) contour of (a) after smoothing, (c) approximation defined by the cutpoints (dlimit = 6.0, total segments = 7), (d, e) final approximations utilizing only one value of dcol for all segments (dcol = 1.0 and 1.5) and (f) approximation obtained by optimizing WE3, thresholds = [1.0, 1.0, 1.5, 1.5, 1.0, 1.5, 1.0] for the seven segments, respectively.
2004
M.T. Parvez, S.A. Mahmoud / Pattern Recognition Letters 31 (2010) 1997–2005
Fig. 14. Illustration of polygonal approximations of the Arabic character Meem ( ): (a) original image, (b) contour of (a) after smoothing, (c) approximation defined by the cutpoints (dlimit = 5.0, total segments = 7), (d, e) final approximations utilizing only one value of dcol for all segments (dcol = 1.0 and 1.5) and (f) approximation obtained by optimizing WE3, thresholds = [1.0, 1.0, 1.5, 1.0, 1.5, 1.0, 1.0] for the seven segments, respectively.
Fig. 15. Dominant points for different shapes in MPEG7 CE Shape-1 database: (a, b) butterfly-15, 1122 contour pixels, (c, d) bone-13, 910 contour pixels, (e–g) chicken-8, 359 contour pixels and (h–j) chicken-13, 350 contour pixels.
M.T. Parvez, S.A. Mahmoud / Pattern Recognition Letters 31 (2010) 1997–2005
2005
and an optimization procedure for obtaining dominant points for each segment. Thus, our algorithm takes into account the different levels of details present within the same contour and adaptively finds the best approximation. In addition, we have shown that constrained collinear-points suppression (CCS) is more suitable for suppressing redundant points compared to popular collinearpoints suppression. The proposed algorithm can be very effective in shape analysis systems where the polygonal approximation must maintain the relative levels of details present in the contour while capturing the outline of the shape. Acknowledgements We thank King Fahd University of Petroleum & Minerals (KFUPM), Dhahran, Saudi Arabia, for partially supporting this research work. We also thank anonymous reviewers for their reviews and feedback on the paper. References
Fig. 16. Dominant points for different shapes in MPEG7 CE Shape-1 database: (a, b) tree-2, 759 contour pixels, (c, d) personal_car-13, 770 contour pixels, and (e, f) spoon-7, 519 contour pixels.
Figs. 15 and 16 show some examples for different shapes from the database MPEG7 CE Shape-1 Part B (Jeannin and Bober, 1999) which has been widely used by researchers in shape analysis. These shapes are of different sizes and topology. Fig. 15g–f and i–j illustrates the cases where the images are rotated before digitization. As can be seen, the number/location of the selected dominant points may partially change under image rotation. However, the general outlines of the shapes are preserved. In addition, our method does not depend on the initial point. The reason behind this is that the points are sorted according to their strength before passing them to the ReduceDominantPoints. The running time of the proposed algorithm can be analyzed as follows. Selecting all the break-points and computing their strength can be done in H(n) time. An initial sorting of the dominant points can be done in H(nlg n) time. In ReduceDominantPoints procedure, each iteration can take O(n2) in the worst case. The actual overall running time of the proposed method will vary depending upon the contour topology. 5. Conclusions The main strength of the proposed algorithm is its ability to work in the locality of the contour, while minimizing the affects of noise. This is achieved by adaptive segmentation of the contour
Abuhaiba, I.S.I., Mahmoud, S.A., Green, R.J., 1994. Recognition of handwritten cursive Arabic characters. IEEE Trans. Pattern Anal. Machine Intell. 16, 664–672. Arcelli, C., Ramella, G., 1993. Finding contour-based abstractions of planar patterns. Pattern Recognition 26 (10), 1563–1577. Attneave, F., 1954. Some informational aspects of visual perception. Psychol. Rev. 61, 189–193. Carmona-Poyato, A., Fernandez-Garcia, N.L., Medina-Carnicer, R., Madrid-Cuevas, F.J., 2005. Dominant point detection: A new proposal. Image Vision Comput. 23, 1226–1236. Carmona-Poyato, A., Madrid-Cuevas, F.J., Medina-Carnicer, R., Muñoz-Salinas, R., 2010. Polygonal approximation of digital planar curves through break point suppression. Pattern Recognition 43 (1), 14–25. Guru, D.S., Dinesh, R., Nagabhushan, P., 2004. Boundary based corner detection and localization using new ‘cornerity’ index: A robust approach. In: First Canadian Conference on Computer and Robot Vision, pp. 417–423. Hosur, P.I., Kai-Kuang M., 1999. A novel scheme for progressive polygon approximation of shape contours. In: IEEE 3rd Workshop on Multimedia Signal Processing, 1999, pp. 309–314. Huang, S.C., Sun, Y.N., 1999. Polygonal approximation using genetic algorithms. Pattern Recognition 32, 1409–1420. Jeannin, S., Bober, M., 1999. Description of core experiments for MPEG-7 motion/ shape. MPEG-7, ISO/IEC/JTC1/SC29/WG11/MPEG99/N2690, Seoul, March 1999. Mahmoud, S.A., 1994. Arabic character recognition using Fourier descriptors and character contour encoding. Pattern Recognition 27, 815–824. Marji, M., Siy, P., 2003. A new algorithm for dominant point detection and polygonization of digital curves. Pattern Recognition 36, 2239–2251. Marji, M., Siy, P., 2004. Polygonal representation of digital planar curves through dominant point detection – a nonparametric algorithm. Pattern Recognition 37, 2113–2130. Masood, A., Haq, S.A., 2007. A novel approach to polygonal approximation of digital curves. J. Vision Commun. Image Represent. 18, 264–274. Masood, A., 2008. Optimized polygonal approximation by dominant point deletion. Pattern Recognition 41, 227–239. Otsu, N., 1979. A threshold selection method from gray-level histograms. IEEE Trans. Systems Man Cybernet. SMC-9 (1), 62–66. Pavlidis, T., 1982. Algorithms for Graphics and Image Processing. Computer Science Press, Rockville, MD. Perez, J.C., Vidal, E., 1994. Optimum polygonal approximation of digitized curves. Pattern Recognition Lett. 15, 743–750. Rosin, P.L., 1997. Techniques for assessing polygonal approximation of curves. IEEE Trans. Pattern Anal. Machine Intell. 19 (6), 659–666. Teh, C.H., Chin, R.T., 1989. On the detection of dominant points on digital curves. IEEE Trans. Pattern Anal. Machine Intell. 11, 859–872. Wu, W.Y., 2003. An adaptive method for detecting dominant points. Pattern Recognition 36, 2231–2237. Zhang, D., Lu, G., 2004. Review of shape representation and description techniques. Pattern Recognition 37, 1–19.