Toward Polygonalisation of Thick Discrete Arcs

8
Toward Polygonalisation of Thick Discrete Arcs Firas Alhalabi and Laure Tougne Laboratoire LIRIS, Universit´ e Lyon 2, France [email protected] http://liris.cnrs.fr Abstract. All the polygonalisation algorithms we can find in the litera- ture proceed on 4-connected or 8-connected discrete arcs. In this article, we aim to polygonalise “thick arcs”. A first step consists in giving a definition of such arcs based on morphological properties. In a second step, we propose two methods in order to polygonalise such arcs. The first one is based on a squelettisation of the arc and uses the fuzzy arc polygonalisation. The second one is based on a grouping of the cells in order to obtain heterogeneous pixels and then, the polygonalisation of heterogeneous arcs is applied. 1 Introduction Within the framework of image analysis, one step consists in representing and describing the shapes. Hence, on the basis of the objects identified during the segmentation, the goal of this step is to extract characteristics, also called de- scriptors. These are informations that can be computed on the shape. These characteristics can be the perimeter, the area, the compactness, the curvature, the inertia center, the orientation for examples. The computation of such char- acteristics can be done directly on the frontier of the object such as the inertia center or the principal axis. Others, on the contrary, need before the extraction of primitives. A primitive is an elementary component such as straight lines or circular arcs. This article deals with the second ones and more precisely its goal is to give an approximation of the contour. Many approaches are available in the literature in order the approximate the contour of an object. We can cite for example methods based on Minimum Length Polygon [SZ96, KKY99, KB00] or on Euclidean path [Via96]. However, a basic approach that consists in decomposing the contour of the object into polygonal arc offers a good approximation of if [CDRT01] and allows efficient computation of global estimators. This is the reason why we are interested in the polygonalisation of discrete curves or arcs. We can find in the literature many articles dealing with polygonalisation of discrete arcs or recognition of segments. As a matter of fact, many equivalent or quasi-equivalent characterizations of a discrete segment have been proposed [Fre74, This work is supported by the french ACI GeomDiGIT (http://liris.cnrs.fr/ geodigit/) A. Gagalowicz and W. Philips (Eds.): CAIP 2005, LNCS 3691, pp. 197–204, 2005. c Springer-Verlag Berlin Heidelberg 2005

Transcript of Toward Polygonalisation of Thick Discrete Arcs

Toward Polygonalisation of Thick Discrete Arcs�

Firas Alhalabi and Laure Tougne

Laboratoire LIRIS, Universite Lyon 2, [email protected]://liris.cnrs.fr

Abstract. All the polygonalisation algorithms we can find in the litera-ture proceed on 4-connected or 8-connected discrete arcs. In this article,we aim to polygonalise “thick arcs”. A first step consists in giving adefinition of such arcs based on morphological properties. In a secondstep, we propose two methods in order to polygonalise such arcs. Thefirst one is based on a squelettisation of the arc and uses the fuzzy arcpolygonalisation. The second one is based on a grouping of the cells inorder to obtain heterogeneous pixels and then, the polygonalisation ofheterogeneous arcs is applied.

1 Introduction

Within the framework of image analysis, one step consists in representing anddescribing the shapes. Hence, on the basis of the objects identified during thesegmentation, the goal of this step is to extract characteristics, also called de-scriptors. These are informations that can be computed on the shape. Thesecharacteristics can be the perimeter, the area, the compactness, the curvature,the inertia center, the orientation for examples. The computation of such char-acteristics can be done directly on the frontier of the object such as the inertiacenter or the principal axis. Others, on the contrary, need before the extractionof primitives. A primitive is an elementary component such as straight lines orcircular arcs. This article deals with the second ones and more precisely its goalis to give an approximation of the contour.

Many approaches are available in the literature in order the approximatethe contour of an object. We can cite for example methods based on MinimumLength Polygon [SZ96, KKY99, KB00] or on Euclidean path [Via96]. However,a basic approach that consists in decomposing the contour of the object intopolygonal arc offers a good approximation of if [CDRT01] and allows efficientcomputation of global estimators. This is the reason why we are interested inthe polygonalisation of discrete curves or arcs.

We can find in the literature many articles dealing with polygonalisation ofdiscrete arcs or recognition of segments. As a matter of fact, many equivalent orquasi-equivalent characterizationsof adiscrete segmenthavebeenproposed [Fre74,

� This work is supported by the french ACI GeomDiGIT (http://liris.cnrs.fr/geodigit/)

A. Gagalowicz and W. Philips (Eds.): CAIP 2005, LNCS 3691, pp. 197–204, 2005.c© Springer-Verlag Berlin Heidelberg 2005

198 F. Alhalabi and L. Tougne

Ros74, LDW82, DS84, Kov90, Rev91] for example, and have been at the origin ofrecognition algorithms more or less powerful [Kov90, DR95, Buz02]. But all theseworks deal with 4−connected or 8−connected arcs in which we have an intrin-sic way to traverse the pixels. But, such arcs are restrictive. I. Debled introducedin [DRRD03] the notion of fuzzy segment in order to be more tolerant with thenoise but her algorithm also took in entry 4−connected or 8−connected arcs. Inthis article, we present two methods that take in entry thick arcs.

In the section 2, we remember existing definitions and existing algorithmsthat allow to polygonalise 4−connected or 8−connected arcs [DRR95, DRRD03]and heterogeneous arcs [CT04]. All these elements are then used in the sections 3and 4 in which we respectively propose a definition of thick arcs and describetwo methods to polygonalise them.

2 Existing Definitions and Algorithms

In this paragraph, we recall the definitions of an arithmetical discrete line, of afuzzy segment with order d and of an heterogeneous digital straight line that alllead to polygonalisation algorithms.

First, let us remember the definition of arithmetical discrete line [Rev91].

Definition 1 (Arithmetical discrete line). A k−arc A belongs to the arith-metical line of slope a

b , of inferior bound µ and of thickness ω (with a, b, µ,ω integers, b �= 0 and pgcd(a, b) = 1), if and only if all the pixels (xi, yi) of A

satisfy : µ ≤ axi − byi < µ + ω.

Associated to this definition, I. Debled and J.P. Reveilles have proposed analgorithm that allows to recognize arithmetical 4− or 8−connected segments inlinear time [DRR95]. An optimal time algorithm that give the polygonalisationof a 4- or 8-arc has also been proposed by the same authors. Just remark thatthis definition is not tolerant with the noise. As a matter of fact, if only onepixel is not exactly between the real lines ax − by = µ and ax − by = µ + ω − 1,named leaning lines, the recognition stops. Hence, in order to be more tolerantwith the noise, I. Debled introduced the notion of fuzzy segment [DRRD03].

Definition 2 (Fuzzy segment with order d). A k−arc A is a fuzzy segmentwith order d if and only if there is an arithmetical discrete line D(a, b, µ, ω) suchthat all the points of A belong to D and ω

max(|a|,|b|) ≤ d. The line D is saidbounding for A.

Associated to this definition, a segmentation algorithm of 8-connected arcs intofuzzy segments has been proposed. Let us called it Polygonalisation Algorithmbased on Fuzzy Segments in the following. Such an algorithm takes in entries a8-arc and a real number d. Each point of the 8-arc is sequentially added andtested to the current segment and the characteristics a, b, µ and ω of a strictlybounded line of this new segment are computed. More precisely, at each step,the value ω

b is evaluated and if it is greater than d, the recognition stops : wedon’t have a fuzzy segment. Otherwise, we proceed with the next point of the

Toward Polygonalisation of Thick Discrete Arcs 199

8-arc. For more details, the reader can refer to [DRRD03].Such an algorithmallows to decompose a 8-arc or a 4-arc into segments, in fact “fuzzy segments”,which length depends on the order d fixed a priori.

On other side, works have been done on heterogeneous grid [CT04]. In thiscontext, a polygonalisation algorithm based on heterogeneous segments has beenproposed. In this context, a discretisation process is considered. For example, anextension of the Closed Discrete Naive Model [And00, CA02] denoted by N(F )for the object F R

2. Using this discretisation process, the notion of heterogeneousdigital straight line can be defined as follows.

Definition 3 (Heterogeneous digital straight line). Let S be a set of pixelsin H, S is called a piece of heterogeneous digital straight line (HDSL for short)iff there exists an Euclidean straight line l such that: S ⊆ N(l).

Using a conversion in the dual space, we can propose an algorithm that segmenta ve-arc into heterogeneous segment. Such an algorithm is relatively simple. Itconsists on one hand to verify that the current piece of ve-arc is monotonic andin other hand, that the two associated pre-images are not empty. If they areempty or if the monotonic constraint is not satisfied, a new segment begins.

Just remark that in all the previous works, the starting arc is either ve−or e−connected (8−connected or 4−connected). In order to be more tolerant,we propose in this article to study “thick arcs” such that the one presented infigure 1. In other words, we want to decompose such arcs into “thick segments”,segments we can easily see on the example and which are marked by rectangles.

Fig. 1. Example of decomposition we would have of a “thick arc”

Just remark that the notion of “thick segment”, we want here, is differentfrom the notion of “arithmetical thick segment” proposed by J.P. Reveilles [Rev91]where the parameter ω > a+b. Indeed, in the “arithmetical thick segment” case,if one pixel is missing or if one pixel is adding, it is not an “arithmetical thicksegment”. In this article, we want to be more flexible. This is the reason why,in the following section, we introduce the notion of “thick arcs”. Let’s noticethat polygonalising such arcs will be more difficult than polygonalising ve− ore−arcs in the way where we don’t have, in this case, an intrinsic circuit to scanthe pixels.

200 F. Alhalabi and L. Tougne

Just before introducing such “thick arcs”, let us remember the problem ofpolygonalisation.

Problem 1. Let E= {P1, ..., Pn} be a k-arc. What is the polygonalisation of E

from P1? In other words, what are the segments Sj of the polygonalisation of E

from P1, denoted P E

P1, such that P E

P1= {Sj , j ∈ [1, k]}, with

1. π1(S1) = P1,2. ∀j ∈ [1, k], Sj is a segment,3. ∀j ∈ [1, k − 1], Sj ∩ Sj+1 = π2(Sj) = π1(Sj+1),4. in the k-curve case, Sk ∩ S1 = π2(Sk) = π1(S1).

where π1(S) and π2(S) denote respectively the left and the right extremities ofthe segment S.

In theory, the polygonalisation which we want is the one the segments of whichhave maximal length even if in the arc case, the last segment is seldom maximal.

3 Definition of Thick Discrete Arcs

The definition of thick discrete arcs (thick arcs in short) we propose, and byextension of thick discrete arc (thick arc in short) is a morphological definitionbased on the dilation operation using a circular structuring element.

Definition 4 (Thick discrete arc). Let l be an Euclidean arc in R2 and Bx

a circular structuring element centered on x. Let L be the set of points of R2

defined by : L= l⊕Bx = {x ∈ R2, Bx ∩L �= 0}. The thick arc L(l, Bx) associated

to the Euclidean arc l and the structuring element Bx is defined by Bx = D(L)where D is a discretisation process.

As the object “thick arc” is now mathematically well-defined, we are going todescribe two methods to decompose such an arc into “thick segments”. Justremark that the definition of “thick segment” will be algorithmic.

4 Polygonalisation of Thick Discrete Arcs

As polygonalising such arc is not easy due to the fact that we don’t have anintrinsic way to scan the pixels, we will propose two different methods to trans-form the thick arc in order to obtain a simple way to go through the pixels. Thefirst one is very intuitive and is based on a squelettisation of the arc. It thenuses the polygonalisation based on fuzzy segments. This basic method presentssome advantages, as we will see in the following and in particular, it is easy toimplement and very rapid. But, it takes in entry a parameter, the order d usedin the polygonalisation based on fuzzy segments. Such a parameter is not easyto fix and it is very dependent of the arc we work on. This is the reason why wepropose a second method which transforms the thick arc into an heterogeneousarc, grouping the pixels, and which then uses the polygonalisation based on het-erogeneous segments. The figure 2 resume the two methods and their differentsteps.

Let us now detail more precisely these two methods.

Toward Polygonalisation of Thick Discrete Arcs 201

Fig. 2. Diagram which recapitulates the two proposed methods

4.1 Squelettisation Based Method

This first method is very basic as it is founded on the squelettisation of the thickarc. This squelettisation is obtained by intersection of wave frontiers initializedon the borders of the thick arc. The so obtained skeleton is then “clean up”: itis transformed into a 8−arc and the simple points are suppressed.

The second step of this method consists in polygonalising the so obtained8−arc using the polygonalisation algorithm based on fuzzy segments previouslydescribed. The extremity pixels of the thick segments are then marked usingthe extremity fuzzy segments. In order to observable, we mark them with largesquares as we can see on the figure 3.

Fig. 3. Examples of obtained polygonalisation for the arc of the figure 1: (right) d=2,5and (left) d=9. The large squares mark the segment extremities.

As it is based on the fuzzy polygonalisation, the number of obtained thicksegments depends on the fixed parameter d. On a given arc, it is possible, byblind searching, to find the value of d that extracts the segments that seems

202 F. Alhalabi and L. Tougne

correct that is to say visible to the naked eye. Meanwhile this value would notbe necessarily available for another arc. This is the main drawback of the fuzzypolygonalisation that is transmitted here. Then, even if this method is easyto implement and is efficient, because the fuzzy polygonalisation as a linearcomplexity, the parameter d is a problem.

This is the reason why we have look for an other method that not requiresto fix a parameter. Such a method is based on the grouping of cells. This is thepurpose of the next subsection.

4.2 Grouping Based Method

In order to relieve the previous problem, we propose a second method which, ina first step, extracts from the thick arc an heterogeneous arc and in a secondstep, proceeds to the polygonalisation of the heterogeneous arc.

The extraction of the heterogeneous arc is based on the previous skeleton anduses the distance transform, based on the distance d8, associated to the image thatcontains the thick arc. Indeed, it allows to extract successively the largest hetero-geneous pixels contained in the thick arc. More precisely, we first browse all thepixels of the skeleton and keep the maximal distance associated, by the distancetransform, to each pixel. Let us denote this distance dmax. Then, we extract assoon as possible heterogeneous pixels of length dmax from the thick arc taking intoaccount that two pixels may not overlap. When we can extract no more pixels oflength dmax, we try with (dmax-1) and so on until pixels of length 1.

The previous heterogeneous polygonalisation algorithm is then applied tomark the extremity of heterogeneous segment which coincide here with the ex-tremity of thick segments.

The figure 4 shows the heterogeneous arc extracted from the thick arc of thefigure 1 and the obtained segment extremities. These ones are the grey pixels onthe figure.

Fig. 4. Heterogeneous arc extracted from the thick arc of the figure 1 and its polygo-nalisation

Toward Polygonalisation of Thick Discrete Arcs 203

4.3 Discussion

The first proposed algorithm based on a skeletisation of the arc and that uses thefuzzy polygonalisation algorithm has some advantages such as its complexity, itssimplicity to implement. In the meantime, it takes in entry a parameter d whichis not easy to fix and which is very dependent on the arc we study.

The second method is a little more complex to implement particularly con-cerning the extraction of heterogeneous pixels. But, it does not need such param-eter. We can remark that, on the presented example, the obtained result withthe second method is better than the ones obtained with the first one. One cansay that for a given arc, we could adjust the parameter d in order to obtain abetter result. But, even if we manage it, such parameter would not be availablefor another arc. So, it seems that the second method is better than the first,even if it is not perfect. In fact, we can see some extremities that are not wellsituated and some of them that are not expected.

In the following section, we conclude about this work and give some possibleextensions in order to improve the second method that seems to be a sound idea.

5 Conclusion and Future Works

In this article, on the one hand we have proposed a definition of thick arc andon the other hand we have presented two algorithms that allow to polygonalisesuch thick arcs. All the works that exist in the literature until now focus on e−or ve−arcs. The notion of thick arc is then new and the proposed algorithmsuse recent works in the domain, combining them in order to obtain interestingresults.

Obviously these are first results on a new problem and many extensions arepossible to improve the results. In particular, we could try other methods toextract heterogeneous pixels in order to limit the small ones for example ortry to work with non square pixels [Coe05] which could also reduce small ones.Another direct extension should be the study of curves instead of arcs. Someresults exist in the literature about minimal number of segments extracted bypolygonalisation of the 4− or 8−arc [FT03].

Finally, such a work is included in a more general project that consists inobtaining algorithms more tolerant with the noise in discrete geometry.

References

[And00] E. Andres. Modelisation analytique discrete d’objets geometriques. Mas-ter’s thesis, Laboratoire IRCOM-SIC, Universite de Poitiers, 2000.

[Buz02] L. Buzer. An incremental linear algorithm for digital line and plane recog-nition using a linear incremental feasibility problem. In 10th InternationalConference on Discrete Geometry for Computer Imagery, number 2301 inLNCS, pages 372–381. Springer, 2002.

204 F. Alhalabi and L. Tougne

[CA02] Philippe Carre and Eric Andres. Ridgelet transform based on reveillesdiscrete lines. In 10th International Conference on Discrete Geometry forComputer Imagery, number 2301 in LNCS, pages 313–325, 2002.

[CDRT01] D. Coeurjolly, I. Debled-Rennesson, and O. Teytaud. Segmentation andlength estimation of 3d discrete curves. Digital and Image Geometry, pages295–313, 2001.

[Coe05] David Coeurjolly. Supercover model and digital straight line recognitionon irregular isothetic grids. In Berlin Springer-Verlag, editor, LNCS 3429.Discrete Geometry for Computer Imagery, 2005. To appear.

[CT04] D. Coeurjolly and L. Tougne. Digital straight line recognition on hetero-geneous grids. In Vision Geometry, pages 283–294. SPIE, 2004.

[DR95] I Debled-Rennesson. Etude et reconnaissance des droites et plans discrets.PhD thesis, Universite Louis Pasteur, Strasbourg, 1995.

[DRR95] I Debled-Renesson and J P Reveilles. A linear algorithm for segmention ofdigital curves. International Journal of Pattern Recognition and ArtificialIntelligence, 9:635–662, december 1995.

[DRRD03] I. Debled, J.L. Remy, and J. Rouyer-Degli. Segmentation of discrete curvesinto fuzzy segments. International Workshop on Combinatorial ImageAnalysis (IWCIA’03), 2003.

[DS84] L Dorst and A W M Smeulders. Discrete representation of straight lines.IEEE Transaction on Pattern Analysis and Machine Intelligence, 6:450–463, 1984.

[Fre74] H. Freeman. Computer processing of line-drawing images. ACM Comput-ing Surveys, 6(1):57–497, 1974.

[FT03] F. Feschet and L. Tougne. On the min dss problem of the closed dis-crete curves. International Workshop on Combinatorial Image Analysis(IWCIA’03), 2003.

[KB00] R. Klette and T. Bulow. Minimum-length polygons in simple cube-curves.In Springer-Verlag, editor, Discrete Geometry for Computer Imagery, Lec-ture Notes in Computer Science, Vol. 1953, pages 467–478, 2000.

[KKY99] R. Klette, V.A. Kovalevsky, and B. YIP. Length estimation of digitalcurves. pages 117–129. SPIE, 1999.

[Kov90] V.A. Kovalevsky. New definition and fast recognition of digital straightsegments and arcs. In Proceedings of the tenth international conference onPattern Analysis and Machine Intelligence, 1990.

[LDW82] Li-De-Wu. On the chain code of a line. IEEE Transaction on PatternAnalysis and Machine Intelligence, 4:347–353, 1982.

[Rev91] J.-P. Reveilles. Geometrie discrete, calcul en nombres entiers et algorith-mique. These d’etat, Universite Louis Pasteur, Strasbourg, 1991.

[Ros74] A. Rosenfeld. Digital straight line segments. IEEE Transaction on Com-puters, 23(12):1264–1269, 1974.

[SZ96] F. Slobada and B. Zatko. On one-dimensional grid continua in R2. Tech-

nical report, Institute of Control Theory and Robotics, Bratislava, 1996.[Via96] A. Vialard. Geometrical parameters extraction from discrete paths. In

Discrete Geometry and Computer Imagery, Lecture Notes in ComputerScience 1176, pages 24–35. Springer Verlag, 1996.