**3.1 Problem formulation**

The problem formulation is as follows: let *Cd* = {*p1*, *p2*, … *pn*} where *pi* = (*xi*,*yi*) is a digital curve consisting of *n* points in clockwise direction in the discrete twodimensional space. Such curves are the ones extracted from the boundaries of the digital images using contour detection or edge detection methods. The coordinates of these *n* points are integers since these points are extracted from the digital boundary. The objective of polygonal approximation of *Cd* is to derive a subset *D* = {*p1*, *p2*, … , *pm*} from the super set of *Cd*, subject to the condition the polygon formed by the elements of *D* should represent the shape of the original curve. The technique starts with any three consecutive points *pi*, *pj* and *pk* on the curve *Cd*, to detect the collinearity of these points (*pi*, *pj*, *pk*), the distance measured from a point *pj* to the line segment connecting *pi* and *pk*. The method shall conclude the three points are collinear, provided the measured distance is very minimal. On the other side, the method shall conclude non-collinearity, provided the measured distance is not very minimal and thus *pj* becomes an element of *D*. Thereby, the polygonal approximation technique finds all the elements of *D*. With this problem formulation, our chapter focuses on the choice of the significant measure metric. Conventionally, the distance metric is the length of the line dropped from the point *pj* on the line segment *pipk*. This is being referred to as the perpendicular distance. This metric is generally good for smooth curves, but in some cases (explained later), it may miss significant points and reject sharp turn, which are essential in shape representation applications. Dunham [27] makes initial approximation using distance to a line segment. Ramaiah [28] uses distance to a line segment as a measure to make polygonal approximation, but the metric used in the technique to compute deviation is capable of preserving sharp turnings but fails to preserve the original

shape of digital curve. Apart from the criterion measure proposed in any technique, the methodology is also an important factor to produce the output polygon without compromising its actual shape. This implies that the used metric in [28] is unsuitable for iterative smoothing. The framework proposed in this chapter automatically chooses the suitable significant measure metric based on the candidate point projection, as explained next.

#### **3.2 Proposed technique**

In this section, we present our proposed method to make polygonal approximation of *Cd*. The initial segmentation points are obtained using Freeman chain code [28], such as given in Algorithm 1. These initially segmented points are referred as initial set of dominant points. Example of initial segmentation for the snowflake curve is shown in **Figure 1(a)** and **(b)** where the dominant points are highlighted in bold markers and the final approximated curve is given in **Figure 1(c)**.

To compute the significant measure of every initial dominant point *sk*, the proposed method uses the following steps: consider the scenario in **Figure 2(a)** where, namely *sk-1*, *sk* and *sk*+1 are three dominant points on the curve with the following traversing sequence: s*k*-1- > s*k*- > s*k*+1. It may be interpreted as these three points are collinear by assuming the projections of a point *sk* that lies on the line segment, which connects (*sk*-1*sk*+1). As a consequence, the approximation technique [9–12, 14, 15, 20, 23, 29, 30] may decide to drop *sk*. In this scenario, the projection of a point (*sk*) lies between its candidate line segment (*sk*-1*sk*+1). **Figure 3** shows the various anticipated position for possible projection of a dominant point (*sk*) on the x-y plane. The proposed metric detects the position of projection. In order to predict the position of a projection, the proposed technique uses the following steps: translate the line segment connecting *sk*-1 and *sk*+1 so that the point Si coincides with the origin of the x-y coordinate system and measures the amount of angle produced by the translated line segment with the x axis. In order to align the translated line segment with the x axis, rotate the line segment with a computed amount angle. The actual x-y coordinate system and new transformed coordinate systems are displayed in **Figure 2(a)** and **(b)**. In the next step, by checking transformed x coordinate of *sk*', the method chooses metric to compute the significant measure. If the x coordinate of *sk*' is less than 0, then the significant measure sig(s*k*) is computed using Eq. (1) (see **Figure 3(a)**). If x*k*' of *sk'* lies between 0 and the x coordinate of *si*, then the significant measure is computed using Eq. (2) (see **Figure 3(b)**.

#### **Figure 2.**

*Demonstration of the coordinate transform performed for the proposed self-adaptive significant measure computing metric for dominant point detection. (a) An example curve in the original x-y coordinate system is shown. (b) The transformed x'-y' coordinate system is shown in addition to the original x-y system.*

**Figure 3.** *Demonstration of computation of significant measure of the point sk from the line segment* sk*-1*sk*+1.*

If the x*<sup>k</sup> '* value is greater than x*<sup>j</sup>* ' of *sk*+1, then the significant measure of *sk* is computed using Eq. (3) (see **Figure 3(c)**).

$$\text{sig}(\mathfrak{s}\_k) = \sum\_{k=\mathfrak{s}\_{k-1}}^{\mathfrak{s}\_{k+1}} \sqrt{\left(\mathfrak{s}\_{\mathfrak{x}\_k} - \mathfrak{s}\_{\mathfrak{x}\_{k-1}}\right)^2 + \left(\mathfrak{s}\_{\mathfrak{y}\_k} - \mathfrak{s}\_{\mathfrak{y}\_{k-1}}\right)^2} \tag{1}$$

$$\text{sig}(s\_k) = \sum\_{k=s\_{k-1}}^{s\_{k+1}} |\mathbb{S}\_{\mathbb{V}\_k'}| \tag{2}$$

$$\text{sig}(\mathbf{s}\_k) = \sum\_{k=s\_{k-1}}^{s\_{k+1}} \sqrt{\left(\mathbf{s}\_{\mathbf{x}\_k} - \mathbf{s}\_{\mathbf{x}\_{k+1}}\right)^2 + \left(\mathbf{s}\_{\mathbf{y}\_k} - \mathbf{s}\_{\mathbf{y}\_{k+1}}\right)^2} \tag{3}$$

In all the three equations (Eqs. (1)–(3)), *k* range is *k-*1 < =*k* < =*k +* 1*.* (Note: the accent sign indicates the coordinates in the transformed coordinate system). While computing the significant measure associated with a dominant point, let us say *sk*, the significant measure of every non-dominant point/boundary point lies between its candidate line segment and is accumulated to define the significance measure of *sk*. These steps are repeated for each dominant point in the initial set, before making the decision to remove redundant dominant points in the next step. After measuring the significant measure of all initial dominant points, the proposed method removes the dominant point with minimal significant measure. If more than one dominant point has the same minimal significant measure, the dominant point appearing first in the order of sequence is removed. The steps to remove the dominant point and produce the final output polygon are given in Algorithm 2.
