Available online at www.sciencedirect.com
Image and Vision Computing 26 (2008) 702–715 www.elsevier.com/locate/imavis
Dominant point detection by reverse polygonization of digital curves Asif Masood
*
Department of Computer Science and Engineering, University of Engineering and Technology, Lahore, Pakistan Received 22 May 2006; received in revised form 7 August 2007; accepted 8 August 2007
Abstract A polygonal approximation technique using reverse polygonization is presented in this paper. The reverse polygonization starts from an initial set of dominant points i.e. break points. In that, dominant points are deleted (one in each iteration) such that the maximal perpendicular distance of approximating straight line from original curve is minimal. A comparative study with some commonly referred algorithms is also presented, which shows that this technique can produce better approximation results. The algorithm has additional advantages like simplicity, polygonal approximation with any number of dominant points and up to any error value, and computational efficiency. 2007 Elsevier B.V. All rights reserved. Keywords: Reverse polygonization; Dominant points; Break points; Polygonal approximation
1. Introduction Polygonal approximation captures the essence of boundary shapes with fewest possible straight line segments. The term dominant point (DP) is assigned to the endpoints of these segments. This is one of the popular approaches which can provide good representation of 2D shapes at different resolutions. One obvious advantage of using this approach is high data reduction and its immediate impact on efficiency of subsequent feature extraction and/or shape matching algorithms. This representation gained popularity due to its simplicity, locality, generality and compactness [20]. This representation simplifies the analysis of images [21] by providing a set of feature points containing almost complete information of a contour. It also causes high data reduction and efficiency of subsequent procedures. Such dominant points are used in shape understanding [4], matching [12,33,39] and pattern recognition algorithms [36]. The development of this approach has its roots back to the research carried out in shape perception and shape understanding. In an experiment, Attneave [4] created the *
Tel.: +92 3009437695. E-mail address:
[email protected]
0262-8856/$ - see front matter 2007 Elsevier B.V. All rights reserved. doi:10.1016/j.imavis.2007.08.006
picture of a cat by identifying high curvature points in an ordinary snapshot, and linking them by straight line segments. A human observer easily recognized the resulting sketch. The conclusion was that high curvature points are rich in information content, and they are able and sufficient to characterize a contour. These points are considered as representative features for object contours. This idea has been the starting point for most of the subsequent efforts in this direction. Following Attneave’s observation, there are many approaches developed for detection of dominant points. Such algorithms can be classified into three main groups namely, sequential approach, split-and-merge approach and heuristic-search approach. For sequential approaches, Sklansky and Gonzales [34] proposed a scan-along procedure which starts from a point and tries to find the longest line segments sequentially. Ray and Ray [27] proposed a method which determines the longest possible line segments with minimum possible error. Teh and Chin [35] determined region of support for each point based on its local properties and computed its relative significance (curvature) and finally detected dominant points by a process of nonmaxima suppression. Kurozumi and Davis [14] proposed a minimax method which derives the approximating segments by minimizing the maximum distance between a
A. Masood / Image and Vision Computing 26 (2008) 702–715
given set of points and the corresponding segment. Marji and Siy [19] determined region of support using integral square error (ISE) and selected endpoints of support arm (as dominant points) depending upon the frequency of their selection. For split-and-merge approaches, Held et al. [11] proposed a split-and-merge technique in which difference of slope was used to split segments and these were merged on the criteria of perceptual significance. Guru et al. [10] smoothed the boundary curve and found difference at each curve point called as ‘‘cornerity index’’. The larger values of cornerity index were taken as dominant points. Sarfraz et al. [30] proposed recursive algorithm in which longest line segments within specified threshold were determined. Common points were marked as dominant points and curve segment was split into sub-segments from each dominant point and processed recursively. The approximation results of the split-and-merge approaches may be far from optimal one if a poor initial segmentation is used. For heuristic-search approach, an exhaustive search for vertices of optimal polygon will result in an exponential complexity. Dunham [7] and Sato [32] used dynamic programming to find the optimal approximating polygon. However, when the starting point is not specified, these methods require a worst-case complexity of O(n4) where n is the number of data points. Some authors [9,13,22,38] have used genetic algorithm for polygonal approximation of digital curves. Tabu search [38] has been proposed to solve the polygonal approximation problem and to obtain better results. Yin [38] has proposed polygonal approximation technique using ant colony search algorithm. Heuristic-search algorithms are computationally expensive and are not guaranteed to be optimal. Among the above three groups of algorithms, sequential approaches are simple and fast, but quality of their results dependent upon the selection of start point. Proposed polygonal approximation technique does not fall in any of the above groups. However, it is closely related to first group except it processes in reverse order and does not require the start point. In this approach, approximation starts from break point extraction. Then redundant break points, among them, are deleted iteratively. This is very simple and efficient technique as it involves calculation of maximum error once for each break point at the start and after elimination of each break point. With this approach, polygonal approximation may be obtained for any number of dominant points and at any error limit. A similar approach was presented by Latecki and Laka¨mper [15–17] as discrete curve evolution (DCE). It removed vertex with minimal relevance measure. Relevance measure was based on difference in length of neighboring vertices and their turn angle. Main objective of DCE algorithm was simplification of shape complexity with no dislocation of relevant features. Zhu and Chirlian [40] used the similar approach for polygonal approximation. They obtained pseudocritical points as a preprocessing step. A critical level was assigned to these points,
703
which was based on triangular area confined by its two neighboring pseudocritical points. The points with least critical level were deleted iteratively till required level of approximation was obtained. The results of these algorithms [15,40] are discussed/compared in detail in this paper. Rest of the paper is organized as follow. Section 2 presents a simple method for detection of break points, which becomes the initial set of dominant points. Reverse polygonization i.e. elimination of redundant dominant points is given in Section 3. The evaluation criteria and analysis/ comparison of results is provided in Section 4. Some discussion on results is given in Section 5. Finally, Section 6 concludes this presentation. 2. Break point detection Break points are detected using Freeman’s chain-coding [8]. These break points become the initial set of dominant points in this algorithm. Calculation of error associated with each dominant point is also given in this section. Given curve can be defined as set C such that: C ¼ fpi ðxi ; y i Þji ¼ 1; 2; . . . ; ng;
ð1Þ
where n is the number of points and pi is the ith point with coordinate (xi, yi). Initial list of dominant points should be selected such that it does not produce any deviation from original curve. For that, break points are detected i.e. points from where boundary takes a turn. These points are very simple and efficient to compute and produce absolutely zero error (no deviation from original curve), which is the basic requirement of this algorithm. Fig. 1 shows a polygon of break points for the popular shape of chromosome. We can determine these break points easily by assigning Freeman’s chain codes [8] to the curve. For that, an integer value ci varying from 0 to 7 is assigned to each curve point (pi) according the position/direction of next point. Fig. 2 shows value of Freeman’s chain code for all possible directions, where 14 pci is the angle between x-axis and the vector. Any point (pi) is
Fig. 1. Break points (in bold) for Chromosome shape connected by straight line.
704
A. Masood / Image and Vision Computing 26 (2008) 702–715 Table 2 Snapshot of DP table at 17
2 1
3 4
0 5
7 6
Fig. 2. Freeman’s chain codes.
a break point if its chain code (ci) is not equal to the chain code of previous point (pi1). That is if
ci 6¼ ci1
Break points are taken as initial set of dominant points, these are called as dominant points from here on. To calculate error associated with each dominant point (DPj), two neighboring dominant points (DPj1 and DPj+1) are joined with a straight line. Maximum perpendicular (squared) distance of all boundary points between DPj1 and DPj+1 from the straight line is called as associated error value (AEV) of dominant points DPj. We may need to make a table to keep record of curve index (CI) and AEV for each dominant point. Curve index is the serial numbers of boundary points. For example, CI = 1 is the point indicated with arrow in Fig. 1. A sample of table for the chromosome shape is given in Table 1, it is called as DP table. Perpendicular squared distance of any point pk ” (xk, yk) from the straight line connecting point pi ” (xi, yi) and pj ” (xj, yj), can be calculated as: 2
ðxi xj Þ þ ðy i y j Þ
2
CI
AEV
: : 5 6 7 8 9 10 11 12 :
: : 12 16 18 22 31 33 37 39 :
: : 0.40 4.0 3.56 .259 3.94 4.65 0.80 4.0 :
DP with least AEV (CI = 22) is marked in bold.
ð2Þ
then pointpi is a break point:
ððxk xi Þðy j y i Þ ðy k y i Þðxj xi ÞÞ
DP
2
:
ð3Þ
3. Reverse polygonization Reverse polygonization method, iteratively, removes the dominant points from the DP table until a polygonal approximation is up to required level. One dominant point, Table 1 Sample DP table of chromosome including break points or dominant points (DP), their curve index (CI), and associated error (AEV) DP
CI
AEV
1 2 3 4 5 6 7 8 9 : :
1 3 5 6 7 9 10 12 13 : :
.8 2 .4 .2 .3077 .3077 .8 .4 .2 : :
with minimum AEV, is eliminated in each iteration. If more than one dominant point with least AEV exists, any one of them may be removed. In proposed algorithm, first such point (with least CI) is eliminated. One may think that selecting dominant point blindly, for removal, may influence the overall results. In fact, leftover dominant point (with same AEV) automatically becomes the point with least AEV in next iteration. Thus, if more than one dominant point with least AEV exists, the algorithm would select them all (one by one in each iteration). Therefore, selection of dominant point in this way does not produce any significant change in overall results. After removing a dominant point (DPj), AEV of two neighboring dominant points (DPj1 and DPj+1) are recalculated and updated in DP table. The process of dominant point elimination is demonstrated with illustrations in Tables 2–4 and Fig. 5. Table 2 shows the snapshot of DP table (for the shape of chromosome) at 17 dominant points and dominant point with least AEV (CI = 22) is marked in bold. The shape of chromosome at 17 dominant points is shown in Fig. 6(d) and the dominant point with least AEV is marked with arrow. Table 3 shows DP table after deletion of dominant point (CI = 22). The AEV of neighboring dominant points (CI = 18 and CI = 31) are required to be updated. These are shown in bold. Table 4 shows the snapshot of DP table after updation of these AEVs. Table 5 shows the final shape of DP table at 16 dominant points. Note that the serial numbers of dominant points (DP) are updated in the final table (Table 5). Fig. 6(c) shows the shape of chromosome after elimination of dominant point (CI = 22). Procedure for single iteration of proposed algorithm is shown in above paragraph. Elimination of dominant points continues in this way till required level of approximation is obtained. Termination condition of proposed algorithm depends upon the requirements of end user. The algorithm can produce polygonal approximation with any number of dominant points and up to any value of integral square error (ISE) or maximum error (MaxErr) or at any other measurement of approximation like FOM. The default parameter for termination of program
A. Masood / Image and Vision Computing 26 (2008) 702–715
705
Table 3 DP table after removal of DP (CI = 22) DP
CI
AEV
: : 5 6 7 9 10 11 12 :
: : 12 16 18 31 33 37 39 :
: : 0.40 4.0 3.56 3.94 4.65 0.80 4.0 :
AEV of neighboring DPs (in bold) are required to be updated.
Table 4 DP table after updating the AEVs
Fig. 3. Polygonal approximation at default parameter (MaxErr = 0.9). (a) Chromosome (nDP = 11), (b) Leaf (nDP = 20), and (c) Semicircle (nDP = 21).
1. Find break points from given boundary points. 2. Mark detected break points as initial set of dominant points (DP).
DP
CI
AEV
: : 5 6 7 9 10 11 12 :
: : 12 16 18 31 33 37 39 :
: : 0.40 4.0 4.25 3.96 4.65 0.80 4.0 :
3. Calculate AEV for all DPs. 4. Do a. Find dominant point (DPj), having least AEV. b. Remove DPj from the list of dominant points. c. Recalculate the AEV of neighboring dominant points (DPj-1 & DPj+1). d. Calculate MaxErr. While (MaxErr < 0.9) 5. Leftover points make final set of dominant points.
Fig. 4. Reverse polygonization algorithm.
Table 5 Final shape of DP table at 16 DPs DP
CI
AEV
: : 5 6 7 8 9 10 11 : :
: : 12 16 18 31 33 37 39 : :
: : 0.40 4.0 4.25 3.96 4.65 0.80 4.0 : :
is fixed at MaxErr = 0.9. The parameter is finalized after extensive testing of proposed algorithm on various shapes. Fig. 3 shows the polygonal approximation for the shape of chromosome, leaf, and semicircle at default parameters. The default parameter provides good balance between the approximation error and compression ratio for mostly experimented shapes. However, the best value of stopping parameter will depend upon the resolution and size of shape under consideration. In addition to default parameters, one may add some optional parameters like ISE (integral square error) or nDP (number of dominant points) which can provide an additional control over the termination of program at any level. The algorithm for reverse polygonization is given in Fig. 4. Fig. 5 shows the polygo-
nal approximation, for the shape of chromosome, at various stages of polygonal approximation.
4. Experimental results Evaluation of polygonal approximation results may be based on various parameters like visual observation, amount of compression, approximation error, and computational efficiency. The two most common measures that are sometimes provided [31] are the compression ratio (CR) and the integral square error (ISE). CR is the ratio between number of curve points (n) and number of detected dominant points (nDP). ISE is the sum of squared (perpendicular) distance of all curve points from approximating polygon. However, there is a tradeoff between the two measures [29] since high compression ratio leads to excessive distortion (i;e. high ISE). Similarly, maintaining low ISE can lead to lower compression ratio. Sarkar [31] combined these two measures as a ratio, producing a normalized figure of merit (FOM). Unfortunately, Sarkar’s FOM is not suitable for comparing approximations with different number of dominant points [29]. Rosin [29] proposed another evaluation criterion which can compare results of polygonal approximation with different number of dominant points. He proposed measure
706
A. Masood / Image and Vision Computing 26 (2008) 702–715
Fig. 5. Polygonal approximation of chromosome shape. (a) with 8 dominant points, (b) with 11 dominant points, (c) with 13 dominant points, and (d) with 19 dominant points.
Table 6 Comparison of Rosin’s top ten algorithms in [29] with proposed method, when applied to Teh and Chin curve [35] Method
Rosin’s [29] rating
Lowe [17] Banerjee et al [5] Proposed (default parameter) Ramer [24] Sarkar [31] 2 point method Chung et al. [9] Sarkar [31] 1 point method Arcelli and Ramella [3] Banerjee et al. [5] Anderson and Bezdek [2] Rattarangsi and Chin [25]
1 2 – 3 4 5 6 7 8 9 10
nDP 13 6 21 26 20 22 19 10 13 29 9
of Merit based on Fidelity and Efficiency. These are as follow. Eopt 100; Eappr N opt Efficiency ¼ 100; N appr
Fidelity ¼
pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi Merit ¼ Fidelity Efficiency ¼
ð4Þ ð5Þ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi Eopt N opt 100; ð6Þ Eappr N appr
where Eappr and Nappr is the error and number of dominant points of suboptimal algorithm, respectively. Eopt is the error incurred by optimal algorithm with same number of dominant points and Nopt represents number of dominant points that optimal algorithm would require to produce the same error as evaluated method does. The error can have various measures, such as integral square error, area between curves, and maximum deviation from original curve. Rosin [29] took 31 algorithms and applied to the shape of semicircle, presented by Teh and Chin [35]. He computed their fidelity, efficiency and merit based on optimal solution by Perez and Vidal [23]. Appropriate ranking, depending upon the merit, was given to these tested algorithms. Here, results of proposed algorithm are compared with top ten rated algorithms [29]. These are shown in Table 6. Results of proposed algorithm stand between 2nd and 3rd position in this table. Proposed algorithm maintains good balance between compression ratio and error (ISE). On the other hand, algorithms at 1st and 2nd position produce very high error (ISE), which is not very useful for most applications. Rosin’s evaluation method also suffers few
ISE
Fidelity
Efficiency
Merit
21.66 150.53 9.82 5.27 13.65 12.36 17.38 75.10 39.36 6.43 130.13
95.7 93.3 81.7 76.9 66.0 56.7 57.8 51.8 52.6 46.7 48.1
98.6 98.7 95.8 92.6 78.9 76.7 73.7 80.3 76.8 78.2 69.1
97.1 96.0 88.5 84.4 72.2 66.0 65.3 64.5 63.6 60.4 57.7
weaknesses. The polygon that consist of just break points will produce Fidelity = 100, Efficiency = 100 and Merit = 100. It means that the set of break points taken as dominant points will produce perfect approximation, whereas this type of approximation is of no practical use since its compression ratio is very low. Another disadvantage of these measurements (Fidelity, Efficiency and Merit) is that it needs optimal solution which is computationally very expensive. The only advantage of Rosin’s [29] evaluation criteria over Sarkar’s [31] method is that it can compare results of different algorithms with different number of dominant points. Therefore, comparison with Sarkar’s FOM is equally good if the number of dominant points, for both approximations, is same. In addition to that it is simple to calculate and plot for visual analysis. Results of proposed algorithm are compared using Sarkar’s evaluation criteria also, since the algorithm can produce approximation with any number of dominant points. The evaluation criteria consist of below measures: • Number of dominant points (nDP): These are the end points of approximating segments of polygon. • Compression ratio (CR): One of the objectives of polygon approximation is the amount of data reduction. Larger compression ratio means high data reduction. The calculation of CR is given by: n CR ¼ ; ð7Þ nDP where n is the total number of curve points.
A. Masood / Image and Vision Computing 26 (2008) 702–715
707
Table 7 Comparative results of chromosome, leaf and semicircle shapes Shape
Method
nDP
CR
MaxErr
ISE
FOM
Chromosome
Sarkar [31] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
19
3.16
0.56 0.51 1.99 0.56
3.86 2.64 22.26 2.87
0.82 1.20 0.14 1.10
Ray and Ray [26] Ray and Ray [28] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
18
3.33
0.71 0.65 0.71 1.99 0.52
5.57 4.81 3.44 27.06 2.88
0.60 0.69 0.97 0.12 1.16
Cronin [6] Wu [37] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
17
3.53
0.63 0.64 0.71 1.98 0.60
3.18 5.01 4.00 30.06 3.44
1.11 0.70 0.88 0.12 1.03
Ansari and Huang [1] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
16
3.75
2.00 0.71 1.98 0.52
20.25 4.68 32.02 3.84
0.19 0.80 0.12 0.98
Teh and Chin [35] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
15
4.00
0.74 0.74 1.98 0.63
7.20 5.56 38.58 4.14
0.56 0.72 0.10 0.97
Marji and Siy [19] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
12
5.00
0.90 0.89 2.16 0.88
8.03 8.92 45.61 7.76
0.62 0.56 0.11 0.65
Ray and Ray [26] Ray and Ray [28] Latecki and Lakamper [15] Proposed
32
3.75
1.00 0.99 2.83 0.59
14.72 14.18 44.15 4.97
0.26 0.26 0.09 0.75
Ansari and Huang [1] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
30
4.00
2.13 0.73 2.83 0.63
25.57 6.38 53.15 5.77
0.16 0.62 0.07 0.69
Teh and Chin [35] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
29
4.14
0.99 0.73 2.83 0.63
14.96 6.68 53.89 6.27
0.28 0.61 0.08 0.66
Cronin [6] Latecki and Lakamper [15] Proposed
28
4.29
0.74 2.83 0.66
7.30 54.05 6.91
0.59 0.08 0.62
Sarkar [31] Wu [37] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
23
5.22
0.78 1.00 0.89 2.83 0.74
13.17 20.34 11.56 60.40 10.61
0.40 0.26 0.44 0.09 0.49
Marji and Siy [19] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
22
5.45
0.78 0.89 2.83 0.74
13.21 13.71 60.55 11.16
0.41 0.39 0.09 0.49
Leaf
(continued on next page)
708
A. Masood / Image and Vision Computing 26 (2008) 702–715
Table 7 (continued) Shape
Method
nDP
CR
MaxErr
ISE
FOM
Semicircle
Cronin [6] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
30
3.40
0.49 0.63 1.00 0.49
2.91 4.30 4.54 2.91
1.17 0.79 0.75 1.17
Ray and Ray [26] Latecki and Lakamper [15] Proposed
29
3.52
0.83 1.00 0.63
11.82 7.03 3.41
0.30 0.05 1.03
Ansari and Huang [1] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
28
3.64
1.26 0.63 1.00 0.63
17.83 4.91 9.52 3.91
0.20 0.74 0.38 0.93
Ray and Ray [28] Wu [37] Latecki and Lakamper [15] Proposed
27
3.78
0.88 0.83 1.00 0.63
11.50 9.01 12.00 4.40
0.33 0.42 0.32 0.86
Marji and Siy [19] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
26
3.92
0.74 0.63 1.21 0.63
9.01 4.91 13.04 4.91
0.44 0.80 0.30 0.80
Teh and Chin [35] Zhu and Chirlian [40] Latecki and Lakamper [15] Proposed
22
4.64
1.00 1.21 1.21 0.72
20.61 13.67 16.88 8.61
0.23 0.34 0.28 0.54
Sarkar [31] Latecki and Lakamper [15] Proposed
19
5.37
1.47 1.21 1.00
17.37 19.60 23.90
0.31 0.27 0.23
Fig. 6. Polygonal approximation of chromosome shape at different dominant points (DPs) (a) 12 DPs, (b) 15 DPs, (c) 16 DPs, (d) 17 DPs, (e) 18 DPs, and (f) 19 DPs.
A. Masood / Image and Vision Computing 26 (2008) 702–715
709
Fig. 7. Polygonal approximation of leaf shape at different dominant points (DPs). (a) 22 DPs, (b) 23 DPs, (c) 28 DPs, (d) 29 DPs, (e) 30 DPs, and (f) 32 DPs.
Fig. 8. Polygonal approximation of semicircle shape at different dominant points (DPs). (a) 22 DPs, (b) 26 DPs, (c) 27 DPs, (d) 28 DPs, (e) 29 DPs, and (f) 30 DPs.
Fig. 9. Some polygonal approximation results for ‘figure 8 curve’’ (a) nDP = 11, MaxErr = 0.63, ISE = 3.48, (b) nDP = 12, MaxErr = 0.59, ISE = 2.98, (c) nDP = 13, MaxErr = 0.54, ISE = 2.6, (d) nDP = 14, MaxErr = 0.51, ISE = 2.14.
• Integral squared error (ISE): This shows the total distortion (error) caused by approximating polygon. Higher value of ISE does not always means more distortion since the total distortion would be more for bigger objects even when the approximation is better. Lowe [18] suggested that the long approximation lines should be permitted to have more deviation from the original curve. ISE can be good measure of error comparison for fixed number of curve points (as in our case). It can be given as: ISE ¼
n X
ei ;
• Maximum error (MaxErr): Maximum error is the maximum deviation of approximating polygon from original curve, measured as squared distance. In ISE measurement, low errors in most part of approximating polygon may suppress high deviations on some other part of curve. Therefore maximum error is also important to represent the overall approximation error accurately. n
MaxErr ¼ maxfei g: i¼1
ð9Þ
ð8Þ
i¼1
where ei is the squared distance of ith curve point from approximating polygon.
• Figure of merit (FOM): FOM makes the tradeoff between the compression ratio (CR) and the total distortion (ISE) caused. It can be measured as:
710
A. Masood / Image and Vision Computing 26 (2008) 702–715
Fig. 10. Snapshots of polygonal approximation by Letecki’s algorithm [15] at different DPs. (a) 19 DPs, (b) 17 DPs, (c) 15 DPs, (d) 32 DPs, (e) 28 DPs, (f) 23 DPs (g) 30 DPs, (h) 27 DPs, (i) 22 DPs.
FOM ¼
CR : ISE
ð10Þ
Quantitative comparison of results with some commonly referred algorithms [1,6,15,19,26,29,31,35,37,40] is performed on the basis of above criteria. For a meaningful comparison with any other algorithm, polygonal approximation was performed such that the number of detected dominant points equalizes with the dominant points of target algorithm. Comparative results for the popular shapes of chromosome, leaf and semicircle are listed in Table 7. For the shape of chromosome, results of proposed algorithm are listed (in Table 7) with 12, 15, 16, 17, 18, and 19 dominant points to enable comparison with all target algorithms. Polygonal approximation for these possibilities of dominant points is given in Fig. 6. From Table 7, maximum error (MaxErr) of proposed algorithm is less than or equal to all algorithms except for Zhu and Chirlian [40] with 19 DPs. Integral square error (ISE) and figure of merit (FOM) of proposed algorithm is better than all algorithms except for Cronin [6] with 17 DPs and Zhu and Chirlian [40] with 19 DPs. Cronin algorithm was slightly better in ISE and FOM but it could not beat in measurement of MaxErr
value. Similarly results of proposed algorithm were better than Zhu and Chirlian [40] when compared with 12, 15, 16, 17 and 18 DPs. Readers must note that proposed algorithm outperforms all other algorithms, in ISE and FOM, with a big margin especially for 15, 16, and 18 dominant points. Difference in MaxErr value is also worth noting. For the shape of leaf, results are listed for 22, 23, 28, 29, 30, and 32 to cover all possibilities for comparison of results. Polygonal approximation for these possibilities of dominant points is given in Fig. 7. Results by proposed algorithm were absolutely outstanding for this shape. It’s MaxErr, ISE and FOM was better than all algorithms. Results of proposed algorithm at 29, 30 and 32 dominant points are worth highlighting. At 32 dominant points, it produced approximation with almost half value of MaxErr than Ray and Ray [26] and Ray and Ray [28], and also with one third values of ISE and FOM. At 30 dominant points, Ansari and Huang [1] approximated with more than three times MaxErr as compared to proposed algorithm, more than 4 times ISE and with about 4.5 times lesser FOM. At 29 dominant points, MaxErr and ISE of Teh and Chin [35] were almost double and FOM was about three times lesser.
A. Masood / Image and Vision Computing 26 (2008) 702–715
711
Fig. 11. Graphs showing change in ISE with changing number of dominant points and its comparison with other algorithms. (a) Chromosome, (b) Leaf, and (c) Semicircle.
For the shape of semicircle, results are listed for 19, 22, 26, 27, 28, 29, 30, and 32 to cover all possibilities for comparison of results. Polygonal approximation for these possibilities of dominant points is given in Fig. 8. Overall results of proposed algorithm were outstanding again. ISE and FOM of Sarkar [31] at 19 dominant points were better than proposed algorithm but its MaxErr value was about 50% higher. Results of Cronin [6] at 30 dominant points were equal to proposed algorithm. At 27 dominant points, ISE of Ray and Ray [28] and Wu [37] was almost double and their FOM were less than half FOM by proposed algorithm. At 28 dominant points, MaxErr value of Ansari and Huang [1] was almost double and its ISE was about 4 times higher. Similarly its FOM was 4 times lower than proposed algorithm. For 29 dominant points, ISE and FOM value of proposed algorithm was about 3 times better than Ray and Ray [26]. Results for ‘Fig. 8 curve’ were not available for most algorithms. However the results by proposed algorithm are shown in Fig. 9. 5. Discussion The results of proposed algorithm were compared with 10 different algorithms in Section 4. Among them, domi-
nant point detection approach of two algorithms (Latecki and Lakamper [15] and Zhu and Chirlian [40]) was similar to proposed method i.e. by dominant point deletion. These algorithms [15,40] are analyzed in detail in this section. The proposed algorithm monitors the AEV value for deletion of dominant points whereas Letecki and Lakamper [15] used relevance measure K. The relevance measure K(v) depends on vertex v and its neighboring vertices u and w. It is given by the formula KðvÞ ¼ Kðb; l1 ; l2 Þ ¼
bl1 l2 l1 þ l2
ð11Þ
where b is the turn angle at vertex v, l1 is the length of uv, and l2 is the length of vw. Both lengths are normalized with respect to the total length of polygon. Latecki and Lakamper [15] demonstrated the results of their algorithm on different shapes and never showed any quantitative measurements like compression ratio, approximation error, or figure of merit. Their algorithm is analyzed, in detail, on the basis of such measurements in proposed study. A comparison of their results on different number of dominant points and on different shapes is shown in Table 7. The results of proposed algorithm are found superior than their algorithm [15]
712
A. Masood / Image and Vision Computing 26 (2008) 702–715
Fig. 12. Graphs showing change in FOM with changing number of dominant points and its comparison with other algorithms. (a) Chromosome, (b) Leaf, and (c) Semicircle.
Fig. 13. Polygonal approximation for the shape of ‘‘Fish’’. (a) Original shape (630 boundary points), (b) nDP = 22, (c) nDP = 16, and (d) nDP = 9.
in all the readings. Polygonal approximation of their algorithm [15] for some of the readings is shown in Fig. 10. The ISE and FOM of Latecki and Lakamper [15] are plotted in graphs (in Figs. 11, 12) for easy comparison of results. These are plotted as continuous lines for better analysis of quality throughout the approximation process. Results of most algorithms look better than Latecki and
Lakamper algorithm [15] in demonstrated graphs. The basic reason for low standard of polygonal approximation results was the use of unsuitable relevance measure (K) for deletion of vertices. The relevance measure (K) only depends on the turn angle (b) and length of neighboring vertices (l1 and l2) and do not take care of overall distortion (e.g. ISE) from the actual shape. In the process of vertex deletion, the algorithm [15] looses the actual shape and
A. Masood / Image and Vision Computing 26 (2008) 702–715
713
Fig. 14. Polygonal approximation for the shape of ‘‘Africa’s Map’’. (a) Original shape (483 boundary points), (b) nDP = 40, (c) nDP = 16, and (d) nDP = 10.
Fig. 15. Polygonal approximation for the shape of ‘‘Maple Leaf’’. (a) Original shape (1053 boundary points), (b) nDP = 35, and (c) nDP = 20.
tries to compute the relevance measure (K) from the current state of (approximated) polygon. On the other hand, deletion of vertex (or dominant point) in proposed algorithm is based on difference (ISE) from original shape. Zhu and Chirlian [40] algorithm also uses similar approach for polygonal approximation. They transferred the contour to polar coordinates and used the centroid to construct 1D plot of outline. Initially, they found the list of pseudocritical points and these points correspond to the break points of proposed algorithm. Then critical level was assigned to each pseudocritical point. The algorithm then started eliminating the least critical points iteratively till required level of approximation was obtained. Assigned critical level was the area of a triangle confined by the two neighbor points. Some of the results by Zhu and Chirlian [40] algorithm were shown in Table 7. Generally, their
results look better than most algorithms. For better analysis of Zhu and Chirlian [40] algorithm, ISE and FOM of their algorithm are also plotted in Figs. 11, 12. Some of their results were observed quite competitive when compared with proposed algorithm. Overall results produced by proposed algorithm were better than Zhu and Chirlian [40] algorithm. However, the ISE and FOM curve by Zhu and Chirlian [40] algorithm gets better at some places, indicated with different arrows in Fig. 11, 12. It would be interesting to investigate the significance of critical level used by Zhu and Chirlian [40]. Latecki and Lakamper [15] show with some illustrations (on page 448) that triangular area is not the true representation of significance of contribution to shape of the contour. However, weakness of critical level used by Zhu and Chirlian [40] algorithm is very similar to relevance
714
A. Masood / Image and Vision Computing 26 (2008) 702–715
measure used by Latecki and Lakamper [15]. Calculation of the critical level [40] was based on position of three consecutive dominant points without considering the position of different boundary points in between. Same problem was observed with Latecki and Lakamper’s relevance measure. On the other hand, associated error value (AEV) in proposed algorithm, was computed using all in-between boundary points. In addition to the high quality of quantitative results by proposed algorithm, it has many other benefits. Being a very simple algorithm it is very easy to implement. This is flexible, stable, and robust algorithm which can produce polygonal approximation with any number of dominant points maintaining high quality of results at any level of approximation. Computational efficiency is another big plus for this algorithm. Initially it needs to find break points using chain codes and error (AEV) for each break point. During program execution, each iteration needs calculation of AEV for two dominant points. Nature of algorithm and number of calculations involved makes this algorithm highly efficient. The proposed algorithm was tested on variety of shapes which include real images as well. The results for some standard shapes are demonstrated in Figs. 3, 5–9. The polygonal approximation for some real images like fish, Africa’s map and maple leaf are shown in Figs. 13–15, respectively. 6. Conclusion A simple approach to polygonal approximation is presented in this paper. Initially it selects all break points and start eliminating one break point, with least associated error value (AEV), in each iteration. Similar algorithms were proposed in past as well which are also discussed and compared with proposed algorithm. The presented algorithm has the ability to produce high quality of approximation with any number of dominant points and at any error limitation. Results of proposed algorithm were compared with 10 commonly referred algorithm on the bases on maximum error (MaxErr), integral square error (ISE) and figure of merit (FOM), and it outperformed in all test shapes. It is very simple and computationally efficient algorithm. Acknowledgements Mr. Asif Masood acknowledges the Higher Education Commission (HEC) of Pakistan for providing funds and University of Engineering and Technology (UET) Lahore for facilitating this research work. References [1] N. Ansari, K.W. Huang, Non-parametric dominant points detection, Pattern Recognition 24 (1991) 849–862. [2] I.M. Anderson, J.C. Bezdek, Curvature and tangential deflection of discrete arcs, Transactions on Pattern Analysis and Machine Intelligence 6 (1984) 27–40.
[3] C. Arcelli, G. Ramella, Finding contour-based abstractions of planar patterns, Pattern Recognition 26 (1993) 563–577. [4] F. Attneave, Some informational aspects of visual perception, Psychological Review 61 (1954) 183–193. [5] S. Banerjee, W. Niblack, M. Flickner, A minimum description length polygonal approximation method, Technical Report no. RJ 10007, IBM Research Division, 1996. [6] T.M. Cronin, A boundary concavity code to support dominant points detection, Pattern Recognition Letters 20 (1999) 617–634. [7] J.G. Dunham, Optimum uniform piecewise linear approximation of planar curves, IEEE Transactions on Pattern Analysis Machinery Intelligence 8 (1986) 67–75. [8] H. Freeman, On the encoding of arbitrary geometric configurations, IEEE Transactions on Electronic Computer 10 (1961) 260–268. [9] D.E. Goldberg, Genetic Algorithms in Search Optimization and Machine Learning. Addison Reading, MA, 1989. [10] D.S. Guru, R. Dinesh, P. Nagabhushan, Boundary based corner detection and localization using new ‘cornerity’ index: a robust approach, Proceedings of the 1st Canadian Conference on Computer and Robot Vision (2004) 417–423. [11] A. Held, K. Abe, C. Arcelli, Towards a hierarchical contour description via dominant point detection, IEEE Transactions on Systems, Man and Cybernetics 24 (6) (1994) 942–949. [12] X. Hu, N. Ahuja, Matching point features with ordered geometric, rigidity, and disparity constraints, IEEE Transactions on Pattern Analysis Machinery Intelligence 16 (1994) 1041–1049. [13] S.C. Huang, Y.N. Sun, Polygonal approximation using genetic algorithms, Pattern Recognition 32 (1999) 1409–1420. [14] Y. Kurozumi, W.A. Davis, Polygonal approximation by the minimax method, Computer Graphics and Image Processing 19 (1982) 248–264. [15] L.J. Latecki and R. Laka¨mper, Polygon evolution by vertex deletion, in: Proceedings of the 2nd International Conference on Scale-Space Theories in Computer Vision, Springer-Verlag, (1999) pp. 398–409. [16] L.J. Latecki, R. Laka¨mper, Convexity rule for shape decomposition based on discrete contour evolution, Computer Vision and Image Understanding 73 (3) (1999) 441–454. [17] L.J. Latecki, R.-R. Ghadially, R. Laka¨mper, U. Eckhardt, Continuity of the discrete curve evolution, Journal of Electronic Imaging 9 (3) (2000) 317–326. [18] D.G. Lowe, Three-dimensional object recognition from single two dimensional images, AI. 31 (1987) 355–395. [19] M. Marji, P. Siy, A new algorithm for dominant points detection and polygonization of digital curves, Pattern Recognition 36 (2003) 2239– 2251. [20] A. Melkman, J.O. Rourke, On polygonal chain approximationProceedings of Computational Morphology, North-Holland, Amsterdam, 1988, pp. 87–95. [21] R. Neumann, G. Teisseron, Extraction of dominant points by estimation of the contour fluctuations, Pattern Recognition 35 (2002) 1447–1462. [22] N.R. Pal, S. Nandi, M.K. Kundu, Self crossover: a new genetic operator and its application to feature selection, International Journal of Systems Science 2 (2) (1998) 207–212. [23] Perez, E. Vidal, Optimum polygonal approximation of digitized curves, Pattern Recognition 15 (1994) 743–750. [24] U. Ramer, An iterative procedure for the polygonal approximation of plane curves, Computer Graphics in Image Processing 1 (1972) 244– 256. [25] A. Rattarangsi, R.T. Chin, Scale-based detection of corners of planar curves, Transactions Pattern Analysis on Machinery Intelligence 14 (1992) 430–449. [26] B.K. Ray, K.S. Ray, Detection of significant points and polygonal approximation of digital curves, Pattern Recognition Letters 13 (1992) 443–452. [27] B.K. Ray, K.S. Ray, Determination of optimal polygon from digital curve using L1 norm, Pattern Recognition 26 (1993) 505– 509.
A. Masood / Image and Vision Computing 26 (2008) 702–715 [28] B.K. Ray, K.S. Ray, An algorithm for detecting dominant points and polygonal approximation of digitized curves, Pattern Recognition Letters 13 (1992) 849–856. [29] P.L. Rosin, Techniques for assessing polygonal approximations of curves, IEEE Transactions on PAMI. 19 (6) (1997) 659–666. [30] M. Sarfraz, M.R. Asim, A. Masood, Piecewise polygonal approximation of digital curves, in: Proceedings of the 8th IEEE International Conference on Information Visualisation, UK, IEEE Computer Society Press, USA, (2004) pp. 991–996. [31] D. Sarkar, A simple algorithm for detection of significant vertices for polygonal approximation of chain-coded curves, Pattern Recognition Letters 14 (1993) 959–964. [32] Y. Sato, Piecewise linear approximation of plane curves by perimeter optimization, Pattern Recognition 25 (1992) 1535–1543. [33] I.K. Sethi, R. Jain, Finding trajectories of feature points in a monocular image sequence, IEEE Transactions on Pattern Analysis Machinery Intelligence 9 (1987) 56–73.
715
[34] J. Sklansky, V. Gonzalez, Fast polygonal approximation of digitized curves, Pattern Recognition vol. 12 (1980) 327–331. [35] C. Teh, R. Chin, On the detection of dominant points on digital curves, IEEE Transactions on PAMI. 8 (1989) 859–873. [36] W.H. Tsai, Attributed string matching with merging for shape recognition, IEEE Transactions on Pattern Analysis Machinery Intelligence 7 (1985) 453–462. [37] W.Y. Wu, An adaptive method for detecting dominant points, Pattern Recognition 36 (2003) 2231–2237. [38] P.Y. Yin, Genetic algorithms for polygonal approximation of digital curves, International Journal of Pattern Recognition on Artificial Intelligence 13 (1999) 1–22. [39] P.C. Yuen, Dominant point matching algorithm, Electronic Letters 29 (1993) 2023–2024. [40] P. Zhu, P.M. Chirlian, On critical point detection of digital shapes, IEEE Transactions on Pattern Analysis Machinery Intelligence 17 (8) (1995) 737–748.