represent - pdfs.semanticscholar.org€¦ · represent a tion of region segmented ima ges with...

22

Upload: others

Post on 15-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

REPRESENTATION OF REGION SEGMENTED IMAGES WITH DISCRETE MAPSJean-Pierre BRAQUELAIRE and Jean-Philippe DOMENGERLaBRIy, Universit�e Bordeaux I351, cours de la Lib�eration33405, Talence Cedex | FrancefJean-Pierre.Braquelaire|[email protected]. Most of models of representation of region of a segmented image have been designed to performspeci�c processings on images and are in general ill-adapted to the other ones. Moreover usual modelsdescribe separately the geometry and the topology of the regions of the image. Generally, this dichotomymakes di�cult or costly the design and the implementation of operations involving both topological andgeometrical features. In this paper we give a complete description of a model encoding both geometry andtopology of a region of a segmented image. This model, based on inter-pixel boundaries associated withtopological planar maps, is not devoted to some speci�c operations and allows an e�cient implementation ofall the operations usually de�ned on segmented images.1. INTRODUCTIONThe region segmentation of an image is the partition of this image into subsets of pixels calledregions. The regions considered here are restricted to 4-connected sets of pixels. Many di�erentmodels have been developed to represent the regions of a segmented image. The interest of a modeldepends on the memory cost of the data storage, on the e�ciency of the data structure for purposeof image processing. Memory cost considerations are decreasingly important on account of theprogress of the technology. On the other hand the e�ciency remains a question of major interest,for instance for non-trivial real time segmentation. Finally the interest of a model must also beconsidered according to its capability to express complex and diversi�ed processings. Usual modelsare many times very e�cient to perform some families of processings but does not �t with the otherones. The restrictions inherent to a model of representation lead to restrictions in the conceptionof complex processing algorithms or to overhead involved by conversions between several models.The purpose of this work is to design a model allowing all the usual families of operations with acomplexity in time at most linear.Let us recall the main family of processings usually performed on segmented images.1. The reconstruction of the domain of a region[RK82], also called restoration, consists in travers-ing the region and to process once each of its points in order either to draw the region or toperform measures on it.2. The point inclusion problem [Loo65] (or point membership property [CL90]) consists in deter-mining if a point is located inside or outside a given region. A generalization of this problemis the region localization which consists in �nding the region containing a given point.3. The splitting is the decomposition of a region into sub-regions and the merging is the fusionof two or more adjacent regions. Many methods of image segmentation are based on splittingof regions into sub-regions [Lee86, BP87], on merging of regions [BF70, BHA81, BGR+89],or on combinations of the both ones [HP76, PR82, CLC91]. Remark that the deletion of aregion r can be considered as the merging of the region r with an adjacent one.4. The union of regions can be used in image analysis or in image editing to build complex objectsby aggregating non-connected regions. Remark that it allows us to have 8-connected objectsby unions of 4-connected regions. The intersection of regions is useful in image compositing.5. The parameter extraction is the computation of local geometric features of a region, suchas area, perimeter, centers, moments, orientation, eccentricity, best �tting ellipse, etc., forinstance for purpose of analysis of medical images [Ros79, CL90, RSB93].1

Page 2: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

6. Finally more general features are sometimes considered, most of them involving topologicalconsiderations: the surroundness property [Ros79], the �nding of all the regions located insideor outside a given region, the counting of holes [Mor69, Ros79], etc.As stressed above the e�ciency of the methods used to solve these problems highly depends onthe representation of regions. The simplest representation model consists in associating each pixelwith a label identifying its region. Region labeling is easy to implement with an array having thesame size as the image and storing the label of each pixel [RK82]. The main advantage of thisdescription is the simplicity of the implementation and the e�ciency of the region localization ofa point. The reconstruction of the domain of a region can be done by using a boundary seed �llalgorithm [FB85] from any point of the region. On the other hand region labeling is not convenientfor operations like splitting and merging. For instance, the splitting of a region r into two sub-regions r1 and r2 requires to change the label of each of point of r into the label of r1 or r2. Thereconstruction of the domain of a union of region r1 : : : rn requires to perform a seed �ll from apoint of each region ri. Finally the implementation of global geometric operations requires a pixellevel analysis and the topology of the segmented image is not explicit.Several hierarchical models of implicit representation of regions have been proposed such asquadtrees [Sam80, DRS80] or pyramids [Bro82]. These approaches are based on a recursive decom-position of a square image domain into square sub-domains. The splitting of a region can be doneby re�nement of the decomposition. It may involves the partitioning of the region into a big numberof small and useless regions. Also merging are restricted to sub-regions resulting from a splitting.Implicit representation of regions are most and most based on the description of the boundariesof the regions. A region boundary is de�ned by one ore more closed discrete curves, each discretecurve being a sequence of adjacent points. In many works boundaries have been de�ned in theimage domain [Fre61, Mer73, Fre74, Pav82, RK82, CL90].An important drawback of this approach is that two adjacent objects do not share the sameboundary element. Moreover such discrete curves do not necessarily satisfy Jordan's theorem.An alternative to pixel boundaries is inter-pixel boundaries. An empirical presentation of inter-pixel boundary have been �rst given in 1970 by Brice and Fennema [BF70] when introducing mergingsegmentation. A more theoretical approach have been developed since 1980 introducing discretetopology. The solution generally adopted is to extend the concept of pixel [RK82, KR89, Kov89,Bie90, AAF95, KKM90b, KKM90a, KKM91] to allow a consistent de�nition of open and closedsets in 6Z2. In the Euclidean plane the boundaries of a subdivision of the plane into regions form agraph which arcs are open Jordan curves. The inter-pixel representation makes possible to de�nean analogous discrete boundary graph for a segmented image[Dom92].In this paper, we give a complete description of a model of representation of segmented imagesbased on inter-pixel boundaries and mixing a discrete geometry with the Euclidean topology. Thediscrete boundaries of the regions can be seen as the embedding in the discrete plane of a Euclideangraph encoding the topology of the segmented image. The motivation of mixing discrete geometrywith Euclidean topology is the simplicity and the e�ciency of the Euclidean topology in comparisonwith the discrete one. Moreover the model of representation is neither geometry oriented nor topologyoriented as usual representations are. Thus the model provides natural and e�cient solutions formany segmented image operations: localization, reconstruction, unrestricted splitting, unrestrictedmerging of adjacent regions, parameter extraction and computation of topological features. It hasbeen implemented in a graphic kernel used in an environment of image editing [Dom92] and iscurrently used in an environment of image segmentation [?].This paper is organized as follows. Section 2 recalls some basic de�nitions related to topologicaland combinatorial maps and describes the whole topological data structure. Section 3 describes aninter-pixel model of boundaries of segmented images which is the embedding in the discrete planeof a set of topological maps. Section 4 describes the full implementation of the geometrical datastructure. In Section 5 is given the main algorithm performing the construction of both geometricaland topological data structure in linear time. Finally Section 6 is devoted to the reconstruction of2

Page 3: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

the domain of the regions from their boundaries.2. BOUNDARY MAPS OF A SEGMENTED IMAGELet us �rst give the terminology in use in this paper. A pixel is a coloured point of the discreteplane 6Z2. An image is a set of pixels. In general we consider rectangular images without hole.Nevertheless our model may easily be used with any kind of images, including disconnected set ofpoints. A segmented image is an image I decomposed into a set of regions fr1; : : : ; rng such that:1. The regions ri are 4-connected.2. Sni=1 ri = I .3. i 6= j ) ri \ rj = ;.An example of segmented image with �ve regions which is used all along this paper is given inFigure 1.Figure 1: This image is segmented into �ve regions: two black regions, two grey regions, and onewhite region.It is very natural and intuitive to describe the topology of a segmented image by embedding itinto the Euclidean plane and drawing a Jordan's curve between each pair of adjacent regions. Theset of all these curves forms a connected planar graph called a topological map [Tut63]. Thereare several examples of the use of planar maps in 2D graphics [BG88, BG89, Dom92, GHPV89].Let us brie y recall from Cori [Cor75] the following de�nition:De�nition 1 A planar map is a decomposition of the Euclidean plane into a �nite set V of points,a �nite set E of disconnected open Jordan curves, each one having its extremities in V , and a �niteset of simply connected regions whose boundaries are unions of elements of V and E.The set V is the set of vertices of the map and the set E is its set of edges. All the faces but oneare surrounded by a closed contour made of a sequence of alternatively edges and vertices. Thesefaces are called �nite faces. The in�nite face is the complement of the union of all the �nite faces. Aplanar map can only describe the topology of a partition of the plane into a set of simply connectedregions. In other terms the boundary must be a connected graph and thus regions cannot be holed.Thus in order to allow the topological representation of more general partitions it is necessary toconsider a set of planar maps, one map being associated with each connected component of theboundary.The topological maps associated with the segmented image of Figure 1 are displayed in Figure 2.The Euclidean boundary has two connected components and thus there are two boundary maps.3

Page 4: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

The boundary of the small black region, say r, is disconnected from the boundary of the otherregions. The region r is included into the big grey one, say r0. Thus region r makes a hole into theregion r0 and the region r0 is not simply connected. v7 v1v3v4 v5v2 v6Figure 2: Two topological maps are associated with the segmented image of Figure 1. One of them,the single loop, is included in a �nite face of the other one. These maps are the boundary maps ofthe segmented image.A face is de�ned by its boundary traversed with respect to an orientation convention. Theconvention adopted in this paper is to traverse clockwise the �nite faces and counterclockwise thein�nite ones. Consider for instance the map corresponding to the boundary of the region r. Thismap is made of a unique vertex labeled by v7 in Figure 2 and a looping edge starting from and goingto v7. The �nite face of this map is associated with the loop clockwise traversed and its in�nite facewith the loop counterclockwise traversed.A topological map can be e�ciently encoded by pair of permutations called combinatorialmap [Cor75]. A combinatorial map is a pair (�; �) of permutations de�ned on a set of labelscalled darts where the permutation � is an involution without �xed point. Each dart represents anhalf-edge of the topological map. Each cycle (d; �(d)) of the permutation � encodes an edge of themap by linking two darts. Each cycle of the permutation � is the counterclockwise sequence of dartsreaching a vertex { the orientation of darts around a vertex is the opposite one of the orientation ofedges around a faces. Thus the cycles of � represents the vertices of the permutation. It is conve-nient to encode the darts by positive and negative integers such that �(d) = -d [BG91]. For instanceboth topological maps of the running example can be encoded by the following combinatorial maps:�1 = (1 -7 -2)( -1 2 3)( -3 4 8)( -4 5 9)( -5 6 -9)( -6 7 -8)�1 = (1 -1)(2 -2)(3 -3)(4 -4)(5 -5)(6 -6)(7 -7)(8 -8)(9 -9)�2 = (10 -10)�2 = (10 -10)A representation of these combinatorial maps is given in Figure 3. The cycle of a dart d in thepermutation � is denoted by ��(d). For instance the cycle of the dart 1 in �, is denoted by ��(1).This cycle encodes the vertex v1 of the topological map. Of course this vertex is also denoted by��( -7) or by ��( -2).The faces of a combinatorial map are the cycles of the permutation ' = � ��. Each dart d of acycle of ' represents the edge traversed from the one of its end labeled by d to the one labeled by4

Page 5: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

-5 6 -68 -10 10-3 -77-9 -843 -4 95-12 -2 1Figure 3: This Figure shows a representation of both combinatorial maps encoding the topologicalmaps of Figure 2. The integers labeling each end of edge are the darts on which the permutationsare de�ned.�d. Remark that each edge is associated with two faces but each dart is associated with only one.It can be veri�ed that this de�nition satis�es the conventions of orientation taken above and thata �nite (resp. in�nite) face is associated with a clockwise (resp. counterclockwise) path. The facesof the maps of the running example are given by:'1 = (1 2)(3 4 5 6 7 -2)(8 -6 -9 -4)(9 -5)( -1 -7 -8 -3)'2 = (10)( -10)The faces (1 2) and (10) both are in�nite faces. The maps (�; �) and ('; �) are dual maps. Thuseach one can be indi�erently used to encode a planar map.Combinatorial maps are a very simple and elegant formalism to describe both maps and op-erations de�ned on them. Remark that neither vertices nor edges need to be explicitly encoded.Moreover by taking �(d) = -d the permutation � have not to be stored. So a combinatorial map,and thus a topological map can be, implemented with only an array of integers. It is noticeablethat the same construction provides both a mathematical tool for formal proof and an e�cient datastructure for implementation purpose.In order to be addressed each face is associated with a label. Therefore each dart of thecombinatorial maps is labeled by a labeling function � such that two darts have the same label by� if and only if they belongs to the same cycle of '. Conversely a function � associates each facelabel with a dart of the corresponding face. Thus the face of label l is the cycle '�(�(l)).It is also necessary to described the topological relation between the connected components ofboundary. A solution consists in de�ning an inclusion tree which nodes are all the regions of thesegmented image[Mor69, GVT91]. Nevertheless it is enough to encode only the inclusion for thein�nite faces. By using a virtual map made of a single loop surrounding all the other maps itis possible to consider that the in�nite face of each boundary map is included into a �nite face ofanother map, which may be the �nite face of the virtual map. For the running example the inclusionrelation is the following:� the in�nite face (10) is included in the �nite face ( -1 -7 -8 -3)� the in�nite face (1 2) is included in the �nite face of the virtual map.Suppose that an in�nite face f is included into a �nite face f 0. The face f 0 is called the motherof f and denoted by moth(f). The face f is called a daughter of f 0. The set of daughters of f 0 isdenoted by daug(f 0). Both functions moth and daug are de�ned on the face labels.To sum up the topology of the boundary is represented by a permutation � encoding the verticesof the boundary maps, by a function � labeling their faces, by a pair of functions moth and daug5

Page 6: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

encoding the inclusion relation between maps, and by a function � associating each face label witha canonical dart. For the running example these functions are given in Figure 4. The face labelsare encoded by positive integers. The �nite face of the virtual map is labeled by 1. The integer 0is used to encode empty entries of both arrays moth and daug.Dart � �-10 10 8-9 -5 4-8 -6 6-7 -2 6-6 7 4-5 6 5-4 5 4-3 4 6-2 1 3-1 2 6Dart � �1 -7 22 3 23 -1 34 8 35 9 36 -9 37 -8 38 -3 49 -4 510 -10 7

Label moth daug �1 0 0 02 1 0 13 0 0 34 0 0 85 0 0 96 0 8 -17 0 0 108 6 0 -10Figure 4: Combinatorial representation of the topology of the boundary maps of Figure 3.3. DISCRETE MAPSIn the previous section the correspondence between a segmented image and a set of topologicalmaps called its boundary maps has been intuitively described. In order to make this constructionmore rigorous we de�ned in this section discrete boundaries having topological properties similarto those induced by a set of Euclidean curves. This allows us to introduce the concept of discreteplanar map which is a geometrical embedding of a topological map into the discrete plane.The construction of a discrete map requires the decomposition of a segmented image into discretecorrespondents of vertices, edges and faces. It is natural to take regions as discrete faces. Thus thediscrete correspondent of an edge must be a boundary element separating two regions. The usualway to de�ne boundaries is to consider pixel boundaries which are discrete curves de�ned in thespace of the image. Pixel boundaries may be inside pixel boundaries or outside pixel boundaries. Theinside pixel boundary of a region r is the subset of its points having at least one 8-neighbor thatdoes not belong to r. The outside pixel boundary of a region is the set of point not belongingto the region but having a 4-neighbor in the region. Unfortunately the internal pixel boundariesof two adjacent regions may be disconnected. Moreover the internal pixel boundary of a region isnot necessarily a simple curve and may be self-intersecting. Finally such a curve may not satisfyJordan's theorem. External pixel boundaries have the advantage to not disconnect the region theybound and thus to provide a correct boundary seed �ll of this region. Nevertheless external pixelboundaries of two adjacent regions are also not necessarily connected. Therefore it is clearly notpossible to use pixel boundaries as discrete edges since they belong either to a region or to itscomplement.An alternative consists in drawing boundaries between the pixels of the image[BD91] (see Fig-ure 6). Such boundaries are called inter-pixel boundaries [AAF95]. We consider inter-pixel bound-aries laying on an alternative discrete plane called half-integer plane and obtained by translating6Z2 by (�12 ;�12) [Dom92, BD91]. The half-integer plane will be also called the boundary planeand the usual discrete plane the image plane. In the following of this paper the term of boundarywill be used for inter-pixel boundary.The following de�nitions introduce basic elements on which discrete maps are based.De�nition 2 Let p = (xp; yp) be a point of the image plane 6Z2 and let p0 = (x0p; y0p) be a point ofthe boundary plane. The points p and p0 are half-neighbors if jxp � x0pj = jyp � y0pj = 12 .6

Page 7: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

Figure 5: Each path visualizes an inside pixel boundary of an elementary region of the segmentedimage.

Figure 6: Inter-pixel boundaries of a the segmented image of �gure 5.7

Page 8: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

Each point of the image plane has four half-neighbors points in the boundary plane and con-versely. Two adjacent points of the boundary plane share exactly two half-neighbors in the imageplane.De�nition 3 Each point of the boundary plane having two or more half-neighboring points belongingto di�erent regions of a segmented image is a boundary point. Two adjacent boundary points arelinked if their common half-neighbors belong to di�erent regions. The rank of a boundary point isthe number of boundary points linked to it.In Figure 6 boundary points are displayed with disks, and links with short straight lines joiningadjacent boundary points,Lemma 1 The rank of a boundary point is at least two.Proof. Consider two adjacent pixels p1 and p2 belonging to two di�erent regions and let b1 andb2 be the two boundary points separating p1 and p2. Let p3 and p4 be the two other half-neighborsof b2, for instance with p3 adjacent to p1 and p4 to p2. Suppose now that b2 is linked to no otherboundary point than b1. It follows that p1 belongs to the same region than p3, p3 than p4, and p4than p2. Hence the points p1 and p2 belong to a same region, which is in contradiction with thehypothesis. Thus b2 is linked to at least one other boundary point. 2De�nition 4 A contour is a sequence of boundary points b1; b2; : : : ; bn with n > 1 and such that:1. bi is linked to bi + 1, 8i with 1 � i < n.2. bi 6= bj, 8i; j with i 6= j.A closed contour is a sequence of boundary points b1; b2; : : : ; bn; b1, such that1. b1; b2; : : : ; bn is a contour.2. bn is linked to b1.Two boundary points b and b0 are connected if there is a contour linking them.Just as the boundary of a partition of the Euclidean plane is decomposed into vertices and edges,the boundary of a segmented image is decomposed into a set of points and a set of open contoursjoining these points, respectively called nodes and segments. Any boundary point of rank greaterthan two is a node called natural node. It follows from this de�nition and from lemma 1 thatthe rank of a boundary point which is not a node is two. Consider a maximal set B of connectedboundary points without node. Since each element of B is linked to exactly two other ones, theymake a chain b1; b2; : : : ; bn in which each bi excepted b1 and bn is linked to bi�1 and bi+1. Thus Bis a contour. There are two possible con�gurations for b1 and bn.1. If b1 and bn are not linked together. Hence B is an open contour joining two nodes n and n0.Remark that the node n0 may be the node n. The sequence b1; : : : ; bn is a segment.2. If b1 and bn are linked. Hence b1; : : : ; bn; b1 is a closed contour without natural node. Thereis such a contour in Figure 6 which is the boundary of the small black region. In order to �twith the de�nition of usual topological maps a boundary point is selected on such a boundaryto be an arbitrary node. Let bj with 1 � j � n be the boundary point selected to be thearbitrary node (in Figure 6 this point is displayed with a white large disk). Therefore the setB0 = B � fbjg is a chain bj+1; : : : ; bn; b1; : : : ; bj�1 which is a segment.Hence the set of nodes of a segmented image is the set of its natural nodes extended according tocase 2. More formally we have the following de�nitions:De�nition 5 A node set of a segmented image is a set N of boundary points such that:1. Each boundary point of rank greater than two belongs to N .2. Each closed contour containing only points of rank two contains at least a point of N .8

Page 9: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

The node set is minimal if for each node n of rank two there is no others nodes connected to n.The set of segments is wholly de�ned by the set of nodes. For this reason a segmented imageprovided with a set of nodes is called a structured segmented image.De�nition 6 A segment s of a structured segmented image is a maximal contour without node.The rank of a point b of a segment s is two. We denote by nbg(b) the pair of boundary pointslinked to b. The two points b0 and b00 of s linked to a node are the extremities of s. The nodes n0and n00 respectively linked to b0 and b00 are the linked nodes of s. The linked nodes of a segmentmay be a same node. The segment s augmented with its linked nodes is denoted by s.De�nition 7 If s is a segment and b1 and b2 two linked points of s�s, the point following b2 whencoming from b1, denoted by folw(b1; b2), is the point nbg(b2)� fb1g.A segment s can be traversed from one of its extremity to the other one by iterating thefunction folw. Let b0 be an extremity of s and n0 the node linked to b0. The sequence of points of sis b0 = b0; b1 = folw(n0; b0); b2 = folw(b1; b0); : : : ; bi = folw(bi�1; bi�2); : : : ; folw(bn�1; bn�2) = b00.Two segments are said to be adjacent if they have a common linked node. Each simply connectedregion of the segmented image is bounded by a closed contour made of a sequence of nodes andadjacent segments. A region with n holes is bounded by n+1 closed contours. Conversely, a closedcontour de�ned in the boundary plane encloses a connected region, i.e. a 4-connected set of pixels.In other terms, contours de�ned in the boundary plane are discrete Jordan's curves.This property can be veri�ed by embedding both boundary and image planes into the Khal-imsky's plane [KKM90b, KKM90a, KKM91]. This plane is the set of points having integer orhalf-integer coordinates. The points which both coordinates are integers are open points. Thepoints which both coordinates are half-integers are closed points. The other ones are mixed points.The embedding of the structured segmented image displayed in Figure 6 into the Khalimsky's planeis shown in Figure 7.Figure 7: This Figure shows the embedding of both the segmented image of Figure 1 and of itscontours into the Khalimsky's plane.The boundary points are closed points of the Khalimsky's plane and the pixels are open points.Each segment can be easily associated with a curve of the Khalimsky's plane by adding a mixed9

Page 10: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

point between each pair of linked boundary points. These points are displayed with the symbol in Figure 7. By construction, each other mixed point is adjacent to two open points (pixelsin our terminology) belonging to a same region of the segmented image and is associated withthis region. Finally each closed point which is not a boundary point is half-neighbor of four pixelbelonging to a same region and is also associated with this region. Each connected componentof boundary of an embedded region is a sequence of alternatively closed and mixed points suchthat mixed points are connected to exactly two closed points with no turn. Thus boundaries areJordan's curves and each closed single boundary separated the plane into exactly two connectedcomponents [KKM90b, KKM90a].A structured segmented image without hole embedded into the Khalimsky's plane can be par-titioned in the same way that a topological planar map: a set of nodes which all are closed points,a set of boundary elements joining two nodes being Jordan's curves, and a set of simply connectedregions. This decomposition is called a discrete map. When regions are not simply connected, theembedded structured segmented image induces several discrete maps and an inclusion relation.Just as topological maps, discrete maps can be described by permutations. The analogous of adart of combinatorial map is a pair (n; b) where b is an extremity of segment and n its linked node.We call such a pair a head. By this way a discrete map induces a combinatorial map de�ned asfollows:1. Each head of the discrete map is associated with a dart of the combinatorial map.2. Each pair of dart associated with the two heads of a same segment forms a cycle of thepermutation �.3. Each set of darts associated with a set of heads sharing a same node forms a cycle of thepermutation �, according to the order of the heads around the node.The correspondences between edges and segment and between vertices and nodes are obvious. A�nite face f being a sequence of darts, the corresponding sequence of heads is the contour associatedwith f . If the face f has daughter maps the contours associated with the in�nite faces of thesemaps are also considered. The set of all these contours forms the boundary of the region associatedwith f . The contour associated with f is called the external contour of the region. If there aredaughter maps, the other contours are called internal contours. The label of a region is the labelof its associated �nite face which is the face associated with its external contour.To sum up, a structured segmented image is a segmented image with an extended set of nodessuch that there is no closed single boundary without node. A structured segmented image inducesa set of discrete maps and an inclusion relation. Each discrete map is an embedding of a topologicalmap into the boundary plane. Thus for each discrete map there is an underlying topological map.4. DATA STRUCTUREA basic operation is the reconstruction of the domain of a region. As developed in section 6 it isdone by using both topological and geometrical features, the �rst ones to �nd the list of nodes andsegments making the boundary of the region and the second ones to convert this boundary into thelist of points of the region. In that case topological and geometrical are used independently. Thusthe geometry of segments would be encoded simply by using a Friemman code. Nevertheless thisencoding is not convenient for more complex operations such as deciding if a point of the boundaryplane is or not a boundary point. This is for instance necessary when adding a new boundary intoa structured segmented image. Moreover some other operations may imply a simultaneous use ofboth geometry and topology such as the region localization of a pixel p. In that case it is necessaryto �nd a point b of the inner boundary among the boundaries surrounding p and then to determineto which segment the point b belongs if b is not a node.The e�ciency of this model of structuring of segmented images is highly dependent of thee�ciency of these basic operations. The solution adopted here is to encode explicitly the boundaryplane by a using a data structure that we call boundary image. The boundary plane and the10

Page 11: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

image plane are isomorphic. Thus for a given image of size N � M pixel, the boundary imagewill have N �M elements (or (N + 1) � (M + 1) in order to encode the border of the image).The boundary image encodes both boundary points and links. A boundary point may have fromtwo to four links. An element of the boundary image without links cannot be a boundary pointand conversely an element of the boundary image with links is a boundary point. Thus it is onlynecessary to explicitly encode links.A link can be encoded by a ag associated with each of the four possible directions of theboundary plane. In the following we call north, east, south, and west these directions. Thelinking relation is a symmetrical relation. Thus it is only necessary to encode links along two ofthe four possible directions, say east and north. To determine if a boundary point b has a west-neighbor we check if the west-neighbor of b has an east-neighbor. Thus only two bits are neededto encode links.It is also necessary to be able to determine whether a boundary point is an extremity of segmentor a node. Since extremities are the boundary points which are linked to a node it is enough tomark the nodes in the boundary image.Therefore, only three bits are needed to store each entry of the boundary image: one bit to markthe nodes, one bit to encode east links, and one bit to encode the north links. This encoding issummed up in Figure 8. 000 nothingnode101011001010 110111

100segment pointFigure 8: Encoding of a boundary point in the boundary image.We denote by BI the boundary image and by BI(P ) or BI(iP ; jP ) the code of the pointP = (iP ; jP ) of the boundary plane. If the coordinates of the lower left corner of the segmentedimage are (0; 0) then the �rst entry of the array BI encodes the boundary point of coordinates(�12 ;�12). The basic functions associated with the boundary image BI are given in table 1. Notethat an entry of the boundary image may both be null and correspond to a boundary point with asouth and a west links. In that case it is enough to check one of the two directions, for instancethe west one. Remark that according to the current organization of computer memory it may bemore advisable to decompose the boundary image into clusters of four bits. The fourth bit may beused either to mark boundary point or to encode a third link direction (in that case a boundarypoint may not have a null code).The implementation of the function folw (see De�nition 7) can be optimized by choosing care-fully the order in which the directions are checked. Consider a boundary point b of a segment s andb0 one of the two points linked to b. The direction b0 ! b is called incoming direction. To computefolws(b0; b) consists in determining the direction from b to the other boundary point linked to it, say11

Page 12: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

To check if p Evaluate the expressionis a node BI(p) & 100 6= 0has a east link BI(p) & 010 6= 0has a west link BI((ip � 1; jp)) & 010 6= 0has a north link BI(p) & 001 6= 0has a south link BI((ip; jp� 1)) & 001 6= 0is a boundary point BI(p) 6= 0 or p has a west linkTable 1: This table describes the implementation of the basic functions associated with the boundaryimage BI . The symbol & denotes the bitwise and operator.the outgoing direction. The incoming direction is �rst checked. If there is no boundary point in thisdirection, the orthogonal direction allowing the faster computation is then checked. For instance ifthe incoming direction is the north direction the outgoing direction is computed as follows.Outgoing direction = if b has a north link then northelse if b has a east link then eastelse westOther cases can be deduced easily.Each head is represented by a tuple � n; l � where n is the node of the head and l is the directionof the related extremity of segment. A node n is implemented by a data structured containing:� the coordinates (in; jn) of the node in the boundary plane;� an array �n of four darts indexed by the four directions of the boundary plane.For each direction the corresponding entry of the array �n contains either the associated dart orempty if there is no linked segment extremity in this direction. Suppose for instance that for anode n we have �n[north] = d. It means that (n; b) where b is the north neighbor of n is a headassociated with the dart d. Since darts are encoded by positive and negative integers (see Figure 4)the integer 0 can be used to represent the value empty. An example of node with its dart array isgiven in Figure 9. S2 S3 NS1�N = f0; d1; d2; d3g S3 ! d3S2 ! d2S1 ! d1Figure 9: This �gure shows an example of encoding of the correspondence between heads and darts.The node n is linked to three segments s1,s2, and s3. The corresponding darts are d1, d2 and d3.There is no linked segment in the east direction.The set of all the arrays �n implements the correspondence head�!dart. The correspondencedart�!head is implemented with an array � of heads. This array is indexed by the set of darts.Each entry of � is a pair consisting of a reference to a node data structure and a direction. Finally12

Page 13: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

a hashcoding function is used in order to quickly retrieve the data structure of a node from itscoordinates. Thus when a node (i; j) is detected during a traverse of the boundary image thehashcoding function provides an e�cient access to �(i;j). Remark that each array �n encodes acycle of the permutation � of the topological map. Hence the encoding of � by using a speci�carray become redundant. On the other hand the computation of �(d) from �n where n is the nodeof �(d) is more costly. For purpose of e�ciency the array encoding � may be kept. The de�nitionsof the node data structures and of the array � for the running example are given in Figure 10. Thenode have been numbered according to the numbering of vertices in Figure 2.Dart �-10 � n7; east�-9 � n5; north�-8 � n6; north�-7 � n1; west�-6 � n6; west�-5 � n5; west�-4 � n4; north�-3 � n3; west�-2 � n1; south�-1 � n2; north�Dart �1 � n1;north�2 � n2;south�3 � n2;east�4 � n3;south�5 � n4;west�6 � n5;east�7 � n6;south�8 � n3;north�9 � n4;east�10 � n7;north��east north west southn1 (14,1) 0 1 -7 -2n2 (0,7) 3 -1 0 2n3 (5,7) 0 8 -3 4n4 (5,5) 9 -4 5 0n5 (9,2) 6 -9 -5 0n6 (11,2) 0 -8 -6 7n7 (11,8) -10 10 0 0Figure 10: This data structure encodes the discrete map associated for the example developed inFigures 2, 3, and 6. A hash-coding function provides a access to the node data structure indexedby node coordinates. 5. CONSTRUCTION OF THE DATA STRUCTUREThis section describes the construction of the topological and geometrical data structure of a seg-mented image. The data-structured is created with one initial region being the whole image. Thetopology is de�ned by a map made of a single vertex with a looping edge. The arrays moth anddaug are initialized such that the in�nite face of this map is included into the �nite face of thevirtual map. The boundary image is initialized with a closed contour surrounding the image. Anarbitrary node is inserted, for instance at the lower left corner. Other elements of the data structureare initialized in an obvious way according to this con�guration.We suppose that the segmented image is described by pixel labeling, the label of a pixel beingfor instance its color resulting from a color quantization. Thus a region is a connected component ofpixels having a same label. Though the construction is �rst made on the whole image, it is possibleto recursively apply it on a region of the segmented image, for instance by re�ning the segmentationof this region. In the following of this section we call working area the part of the image on which13

Page 14: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

the construction is performed. When the construction is made on the whole image the workingarea is in general a rectangle bounded by only one external contour. On the other hand when theworking area is a region l of the segmented image it may be any connected subset of the image, theset of contour of the working area being in that case:[l02flg[daug(l)'�(�[l0])The traverse of the pixels of the working area is done by converting half-integer contours of theregion into pixels provided with a parity attribute. It is then possible to traverse the region byusing a scan-line method. This reconstruction is described in section 6.The construction of data structure consists of three parts:A. The selection of a minimal set of nodes fnig associated with the new boundary elements andof the related �ni arrays, the insertion of the new boundary points into the boundary image,and the update of the � array and of the hashcoding function.B. The update of the arrays encoding the permutation �, the labeling function �, and the function�.C. The update of the arrays encoding both functions moth and daug.The partition of the working area into sub-regions makes appear new boundary points, and thusnew nodes. The �rst step of part A of the construction consists in traversing the contours of theworking area in order to �nd the contour points that must be converted into nodes (these pointsare the contour points having two half-neighbors with di�erent labels in the working area). Let bbe such a point. Two cases must be considered:1. The contour on which b is created contains only one node n. In that case the node n is anarbitrary node and the conversion of b into a node consists only in shifting n on b. Thusthe set of nodes remains minimal. The shifting of n results in updating BI , �n, �, and thehashcoding function.2. The contour on which b is created contains natural nodes. The point b belongs to a segment swhich the heads, say (n1; b1) and (n2; b2) are associated respectively with the darts d1 and d2.The node b is inserted into the data structure. The segment s is split into two sub-segmentss' and s" such that s' links the nodes n1 and b and s" links the nodes b and n2. The dart d2is assigned to the head of s' di�erent from (n1; b1) and a new dart d is allocated to label theedge associated with s". Related entries of the data structure are updated.Moreover, each new head linked to a node created during the traverse of the external contouris pushed into a stack. The second step of part A consists in traversing the new component ofboundary connected to the external contour and included in the working area is traversed. Thetraverse is done by following each face contour until reaching a boundary point already inserted inthe data structure. Remark that it follows from the �rst step that this point is necessarily a nodealready inserted in the data structure. Thus it is identi�ed without search overhead by using thewhash coding. Each time a node not already inserted in BI is reached the new heads not belongingto the current face contour are also pushed. For each head (n; b) popped from the stack the traverseof the contour of the face associated with (n; b) is initiated by searching the next contour pointencountered when turning counterclockwise (the orientation of �) around b from n. This pointis denoted by nxtcp(n; b). Suppose for instance that b = (i; j) and n = (i � 1; j). If the pixels(i � 12 ; j � 12) and (i + 12 ; j � 12) have di�erent labels the boundary point (i; j) is linked to theboundary point (i; j � 1) which is nxtcp(n; b). In the other case if (i+ 12 ; j � 12) and (i+ 12 ; j + 12)have di�erent labels then nxtcp(n; b) = (i + 1; j) else it is nxtcp(n; b) = (i; j + 1). The traversecontinues by computing nxtcp(b;nxtcp(n; b)) and so on until an already inserted boundary point isreached (remark that this point is necessarily a node).Let us now describe more precisely the algorithm used to traverse of a new connected componentof boundary included into the working area. The following steps are iterated while the stack is notempty: 14

Page 15: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

1. Pop a head (n; b). If b has already been inserted in BI then goto next iteration.2. Allocate a new dart d. Let � be the direction of the head (n; b). Set �[d] to � n; � � and�n[�] to d.3. Traverse the segment of head (n; b) by iterating nxtcp. Update BI for each encountered point.The traverse of the segment stops when a node n0 is reached. Let b0 be the previous boundarypoint and b00 be nxtcp(b0; n0).4. If n0 is already in BI(a) Update �n0 and � in the following way. Let � be the direction of the head (n0; b0). Set�[�d] to � n0; � � and �n0 [�] to �d.(b) If (b0; n00) is associated with an face l not already reached (in that case the contour is thecontour of a hole of the working area):� Traverse the contour, create new nodes and push new heads such as during the initialtraverse of part A.� Mark this face by clearing its � entry.� Goto next iteration.else(a) Add the node n0 in the data structure and push the heads not belonging to this contour(these heads are the heads linked to n0 and di�erent from both (n0; b0) and (n0; b00)).(b) Update �n0 and �[�d] as above.(c) Goto step 2 with the head (n0; b00).In Figure 11 are shown four steps of the initial construction of the data structure for the seg-mented image of the running example. During the traverse of the external contour two nodes arecreated which are b2 and b5 and two heads are pushed which are (b2; b4) and (b5; b6). The insertionof the node b2 is only a shift of the �rst node created during the initialization of the data structure.The traverse of this contour ends when the node b2 is reached again. Two pairs of darts havebeen allocated which are (1;�1) and (2;�2). The map shown on the middle column of the Figurecorresponds to the current state of the � arrays. When the node b2 is reached the head (b5; b6) ispopped and a new traverse start from this head to the head (b2; b4). During this traverse four headsare pushed. When the whole component is traversed the related map is correctly de�ned (third rowof the Figure). In that case there is no internal contour in the working area.When the stack is empty the whole component included into the working area has been traversed.It is then necessary to scan the working area to look for possible new connected component ofboundary to be inserted into the data structure. It is enough to look for vertical links. If aboundary point b to be inserted is reached this point is on the boundary of a new in�nite face. Thecontour of b is traversed counterclockwise. If b0 is the left neighbor of b in the boundary plane thecontour traverse is initiated from (b;nxtcp(b0; b)).The contour is traversed until either an already inserted boundary point is reached or the pointb is reached again. If an inserted boundary point is reached it is necessarily a node n insertedduring the initial traverse of the working area. In that case the contour of n is traversed againcounterclockwise and the new heads are pushed. Then the algorithm described above is used totraverse the new contours of this connected component. If the point b is reached again the contouris traversed a second time and is inserted in the boundary image. If there are natural nodes on thiscontour they are created and the new heads are pushed. A map is created with the related verticesand the new contours are traversed. If there is no natural node on the new contour it is a singleloop and the data structure is updated accordingly.In the construction illustrated in Figure 11 the point b15 is founded by the scan-line. Thetraverse is initiated from (b15; b16). Since this boundary component is a closed contour the pointb15 is selected as arbitrary node. 15

Page 16: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

b1

6-5-6

-9 -86-5

5-44-33-66

98 -77-5

-6 10-9 -85-44-33 98 -775-44-33 -77

-10

(b2; b4)(b9; b10)(b7; b8)(b2; b4)b16b15

(b11; b12) (b13; b14)(b5; b6)-12 -2 1-12 -2 1-12

-12 -2 1-2

b5b7 b13

b2b6b9 b11 b12 b14b8 b10 b4 b3

1Figure 11: Construction of the discrete map of the segmented image of the running example.16

Page 17: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

Proposition 1 The node set build during the �rst part of the construction is minimal.At the end of the part A the update of the encoding of discrete maps is completed. The boundaryimage contains all the node ags and all the links. The topological maps are wholly de�ned by theset of arrays �n. The part B consists in building the arrays �, �, and �. The permutation � iswholly encoded by the �n arrays. As sketched above the array � is built nevertheless for purposeof e�ciency. It can easily be done from the arrays �.Each dart created during the part A is created with the unde�ned label encoded by the value 0.Each cycle of a map � � � containing an unlabeled dart must be labeled with a new label. It mayhappen that a cycle of ��� has some of its darts labeled by a label l and the other ones unlabeled. Inthat case the label l was the label of a face associated with a split region (step 4b of the algorithm).Thus the cycle must be labeled anyway with a new label. For each cycle (d1; : : : ; dk) to label a newlabel l is allocated and the corresponding entries �[di]; 1 � i � k of lambda receive the value l. Inthe same time one or other of the darts of the cycle is selected and assigned to the entry �[l]. Thelist of created darts may be either stored during the step A or retrieved by traversing the unlabeleddarts of the maps (� � �; �) of each connected component.Finally the inclusion relations are updated during part C. It is necessary to determine in which�nite face each connected component of the working area is included. At the beginning of theconstruction the working area is a region labeled by l where l is the label of a �nite face. The listsof C connected components of the working area before the construction is the list daug(l). Duringthe construction the created components are stored in a linked list N . It is enough to store in N adart of the in�nite face of each component. Each modi�ed component is also stored in N . Such aface has been marked during the step 4b of the algorithm of part A. Finally the list L of connectedcomponents before parts A and B is the union of the list C from which have been removed themarked faces with the list N .For each component C of L a rightmost point ofC is selected. This point can easily be computedand stored during the previous steps of the construction. Then the components of the list L aresorted from right to left according to their rightmost point. Consider the rightmost componentC1 and let b1 be its rightmost point. The label l1 of the in�nite face of C1 is found by traversingcounterclockwise the contour of b1 until reaching a node. The boundary image is scanned from b1to the right until a boundary point b01 is reached. The face located on the left of the contour ofb01 is identi�ed by using nxtcp to initiate the traverse of the contour and folw to reach a node.In that case the face is necessarily a �nite face which is the mother face of l1 and the functionsmoth and daug are updated accordingly. Consider now the second component C2 of the list Land let b2 its rightmost point. As above the label l2 of the in�nite face of C2 is determined, theboundary image is scanned from b2 until a boundary point b02, and the face l2 located on the left ofb2 is identi�ed. The face l2 may be either the face l1 or a �nite face. Thus the functions moth anddaug can be updated. More generally when the component Ci is processed the face reached fromthe rightmost point bi may be either a �nite face or one of the face f1; : : : ; fi�1 and the functionsmoth and daughter can be updated. When the list L is empty the update of inclusion relations isachieved and so it is with the construction of the data structure of the working area.The part A of the construction is the most costly. Each pixel of the working area is traversedonce in order to �nd new connected component, and each segment is traversed once in order to insertits points into the boundary image. Some contours are traversed twice for initialization purpose.Thus the complexity of part A is in O(P +2:B) where P is the number of pixels of the working areaand B the number of boundary points adjacent to a pixel of the working area. The construction ofpart B consists in traversing the created nodes of the dual map ('; �) and for each node to traverseall its darts in order to label them. This part is in O(F:D) where F is the number of new facesand D the mean number of darts by face. The worst case is when each region is reduced to a singlepixel (in that case we have F:D = 4:P ). The worst con�guration for the part C is made up withone region reduced to one pixel on each line, each region being non adjacent and the location onthe left of the working area (in that case O(5P)). The localization (see. section 6) of the rightmost17

Page 18: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

point of an in�nite allows the computation of the mother face of an in�nite. The mean complexityof the localisation is O(S +R) where S in the mean length of segments and R is the mean radiusof regions. Generaly, the mean complexity of the part C is O(I:(S+R)), where I is the number ofin�nite faces. 6. REGION LOCALIZATION AND RECONSTRUCTIONThe localization of the region of a pixel p = (i; j) consists in �nding the label of the region to whichthis pixel belongs. The boundary image is scanned to the right in order to �nd a head addressingthe �nite face of the region or an in�nite face belonging to the daughter faces. If the selected headaddresses an in�nite face, the region which contains p is the mother of the in�nite face.The scanning starts at the point b = (i+ 12 ; j� 12) which is the entry (i+1; j) of the array encodingBI . If b is a node the face of p, this head is the �rst head encountered when turning counterclockwisearound b from its west neighbor. If b is a segment point, let b0 be the �rst boundary point linkedto b encountered when turning clockwise around b from its north neighbor. The segment of b istraversed in the direction (b; b0) and the reached head allows to address the face of p. Finally ifb is not a boundary point let (b0; b00) be the �rst vertical link ((i0; j � 12); (i0; j + 12)) reached whenscanning the boundary plane from b to the right. The face of p is determined from the head reachedfrom (b0; b00).Let l be the label of the region which we want to reconstruct the domain and let H be the listof heads f�(d); for d 2 [l02flg[daug(l)'�(�[l0])gThe heads ofH are the heads of the segments of the contours of l directed according to the orientationof the related face. Thus the segment traverse resulting from the iteration of the function folw ona head of H is done clockwise for the external contour of the region and counterclockwise for theinternal ones. The whole boundary of the region is traversed by traversing all the segments referredby H .The simplest way to reconstruct the domain of a region is to retrieve the extremities of thehorizontal lines of pixels covering the region. It is done by using bu�er large enough to containthe region. The segments of the boundary are traversed and the extremities of horizontal lines aredetermined and inserted in the bu�er. The reconstruction of the region is then done by scanningeach line of the bu�er and applying a parity rule to detect the beginning and the end of each line.Note that a line may be of length one. In that case it is reduced to a single pixel and a naiveparity check will fail. This problem can be solved by using two di�erent colors to draw the lineextremities. White pixels are used to mark a line beginning and black pixels to mark a line end ora line of length one.The white and black pixels marking the ends of a line are determined with the two local rulesgiven in Figure 12 and one global rule. The selection of local rules depends only on the direction ofthe next contour point. The global rule is the following one: a white pixel is drawn only if there isnot already a pixel at this location in the bu�er; a black pixel is always drawn, and can recover awhite one. These rules are applied for each head (n; b) of H and on each pair (b; b0) resulting fromthe iteration of folw on (n; b) until reaching a node.Figure 12: Local reconstruction rules giving the points used by the scan-line algorithm18

Page 19: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

An example of result produced by this algorithm is given in Figure 13 for the region 6 of therunning example. The list of horizontal lines covering the region is determined by the list of pair ofpixels (p1; p2) where:� either p1 and p2 are two consecutive respectively white and black pixels,� or p1 = p2 = p where p is a black pixel such that the previous colored pixel of the same lineis either black or unde�ned.Of course there may be any number of pair on a same line.Figure 13: Scan-line reconstruction of the region of label 1.The reconstruction of the domain of a region may also be done by using a boundary seed�ll[FVDFH90]. The boundary seed �ll can be done by adapting a usual boundary seed �ll algorithmin order to detect vertical links of the boundary.It is also possible to reconstruct the pixel boundaries of the region. For instance the outsidepixel boundary may be used to perform a boundary seed �ll. Also it may be useful to traversesimultaneously the inside and the outside pixel boundaries for purpose of analysis, for instance tocompute a gradient along the boundary. Both the inside and the outside pixel boundaries are alsoreconstructed by applying local rules on the region boundary.The simplest reconstruction is the reconstruction of the outside boundary de�ned by the contour.There are four reconstruction rules given in Figure ??. Each rule determines a pixel to be added tothe outside pixel boundary to be built. For instance if b = (ib; jb) is the current point of the contourand if the direction of the previous point is the north direction the pixel added to the outside pixelboundary is the pixel (i+ 12 ; j + 12).For the reconstruction of the inside pixel boundary the selection of the reconstruction ruledepends on both the previous and the next contour points. One pixel is added to the inside pixelboundary when the three points are in line, and two when they form a left turn. No pixel is addedon a right turn (see Figure 15). For instance if bi is the current point of contour and if we have:ibi�1 = ibijbi�1 = jbi + 1ibi+1 = ibi + 1jbi+1 = jbithen the points (ibi � 12 ; jbi � 12) and (ibi + 12 ; jbi � 12) are added to the inside pixel boundary.It is sometimes useful to reconstruct the domain of a union of regions. The contour of a unionof adjacent region may easily be simpli�ed by traversing the maps of face � � �.19

Page 20: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

Figure 14: These rules are the reconstruction rules giving the outside pixel boundary from theboundary. For each rule the black disk is the current point of contour and the grey disk is theprevious point. The square is the pixel added to the outside pixel boundary.

Figure 15: These rules are the reconstruction rules giving the inside pixel boundary from theboundary. For each rule the black disk is the current point of contour and the grey disks are itsneighbors. The squares are the pixels added to the inside pixel boundary.20

Page 21: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

7. CONCLUSIONIn this paper we have described a simple and general data structure to represent segmented imagesbased on an inter-pixel representation of boundary. The geometry of the boundary is representedin the plane P 12 resulting from the translation of the discrete plane by (�12 ;�12). We have describeda minimal decomposition of such a boundary which is the embedding in the discrete plane of aEuclidean graph encoding the topology of the boundary. This graph is a set of planar maps providedwith inclusion relations between connected components. We have shown that the combinatorialencoding of planar maps is very e�cient in that case. We have described a linear algorithm ofconstruction of the data structure. The algorithm works on a image which the domain is any 4-connected region. Hence it may be used to re�ne the construction on a region of the image. Mergingalgorithm are described in [?]. Of course topological features can be extracted very e�ciently byusing the maps. This model is used to experiment complex segmentation algorithms, allowinglocal re�nements and editing to perform design meta-methods of segmentation [] Finally we havedescribed the algorithms of point localization and region reconstruction.References[AAF95] E. Ahronovitz, J.P Aubert, and C. Fiorio. The star-topology: a topology for imageanalysis. In In 5th Discrete Geometry for Computer Imagery, Proceedings, pages 107{116, September 1995.[BD91] J.P Braquelaire and J.P Domenger. Intersection of discrete contours. In Proc. ofCompugraphics'91, pages 14{23, 1991.[BF70] C.R. Brice and C.L. Fennema. Scene analysis using regions. Arti�cial intelligence,1:205{226, 1970.[BG88] J.P. Braquelaire and P. Guitton. A model for image structuration. In Proc. of ComputerGraphics International'88, pages 426{435. Springer-Verlag, 1988.[BG89] P. Baudelaire and M. Gangnet. Planar maps: an interaction paradigm for graphicdesign. In Proc. of CHI'89, pages 313{318. Addison-Wesley, 1989.[BG91] J.P. Braquelaire and P. Guitton. 212d scene update by insertion of contour. Computer& Graphics, 15(1):41{48, 1991.[BGR+89] J.R. Beveridge, J. Gri�th, R.R.Kohler, A.R. Hanson, and E.M. Riseman. Segmentingimages using localized histograms and region merging. International Journal ComputerVision, 2:311{347, 1989.[BHA81] P.J. Burt, T.H. Hong, and A.Rosenfeld. Segmentation and estimation of image re-gion properties through cooperative hierarchical computation. IEEE Trans. Syst. ManCybernet., 11:802{809, 1981.[Bie90] H. Bieri. Hyperimages { an alternative to the conventional digital images. In Euro-graphics'90 proceedings, pages 341{352, 1990.[BP87] B. Bhanu and B.A. Parvin. Segmentation of natural sciences. Pattern Recognition,20(5):487{496, 1987.[Bro82] J.D. Browning. Segmentation of pictures into regions with tile-by-tile method. PatternRecognition, 15(1):1{10, 1982.[CL90] L.W. Chang and K.L. Leu. A fast algorithm for the restoration of images based onchain codes descriptions and its applications. Computer Vision, Graphics, and ImageProcessing, 50:296{307, 1990.[CLC91] S.Y. Chen, W.C. Lin, and C.T. Chen. Split-and-merge image segmentation based onlocalized feature analysis and statistical tests. CVGIP: Graphical Models and ImageProcessing, 53(5):457{475, 1991.[Cor75] R. Cori. Un code pour les graphes planaires et ses applications. Th�ese d'�etat del'universit�e Paris VII, and Ast�risque 27, 1973 and 1975.21

Page 22: REPRESENT - pdfs.semanticscholar.org€¦ · REPRESENT A TION OF REGION SEGMENTED IMA GES WITH DISCRETE MAPS Jean-Pierre BRA QUELAIRE and Jean-Philipp e DOMENGER LaBRI y, Univ ersit

[Dom92] Jean-Philippe Domenger. Conception et impl�ementation du noyau graphique d'un en-vironnement 2D12 d'�edition d'images discr�etes. PhD thesis, Univ. Bordeaux I, avril1992.[DRS80] R.C. Dyer, A. Rosenfeld, and H. Samet. Region representation: Boundary codes fromquadtrees. Communications of the ACM, 23:171{179, 1980.[FB85] K.P. Fishkin and B.A. Brasky. An analysis and algorithm for �lling propagation. InProc. of Graphics Interface'85, pages 203{212, 1985.[Fre61] H. Freeman. On the encoding of arbitrary geometric con�gurations. IRE Trans.,EC-10(2):260{268, 1961.[Fre74] H. Freeman. Computer processing of line drawing images. ACM Comput. Surveys,6(1):57{98, 1974.[FVDFH90] J.D. Foley, A. Van Dam, Feiner, and Hughes. Computer Graphics, Principles andPractices. Addison-Wesley, 1990.[GHPV89] M. Gangnet, J.C. Herv�e, T. Pudet, and J.M. VanThong. Incremental computation ofplanar maps. In Proc. of SIGGRAPH'89, 1989.[GVT91] M. Gangnet and J.M. Van Thong. Robust boolean operations on 2d paths. In Proc.of COMPUGRAPHICS'91, pages 434{444,1991, 1991.[HP76] S.L. Horowitz and T. Pavlidis. Picture segmentation by a tree traversal algorithm. J.Assoc. Comput. Mach., 23(2):368{388, 1976.[KKM90a] E. Khalimsky, R. Kopperman, and P.R. Meyer. Boundaries in digital planes. Journalof applied Math. and Stocastic Analysis, 3:27{55, 1990.[KKM90b] E. Khalimsky, R. Kopperman, and P.R. Meyer. Computer graphics and connectedtopologies on �nite ordered sets. Topology and its Applications, 36:1{17, 1990.[KKM91] T.Y. Kong, R. Kopperman, and P.R. Meyer. A topological approach to digital topology.XXXX, 1991.[Kov89] V.A. Kovalevsky. Finite topology as applied to image analysis. Computer Vision,Graphics, and Image Processing, 46:141{161, 1989.[KR89] T.Y. Kong and A. Rosenfeld. Digital topology: Introduction and survey. ComputerVision, Graphics, and Image Processing, 48:357{39, 1989.[Lee86] C.N. Lee. Recursive region splitting and hierachical scope views. Computer Vision,Graphics, and Image Processing, 33:237{258, 1986.[Loo65] R.G. Loomis. Boundary networks. Communications of the ACM, 8(1):44{48, 1965.[Mer73] R.D. Merrill. Representation of contours and regions for e�cient computer search.Communications of the ACM, 16(2):69{82, 1973.[Mor69] P. Morse. Concepts of use in contour map processing. Communications of the ACM,12(3):147{152, 1969.[Pav82] T. Pavlidis. Algorithms for Graphics and Image Processing. Computer Sci., Washing-ton, 1982.[PR82] M. Pietikainen and A. Rosenfeld. Split-and-link algorithm for image segmentation.Computer Vision, Graphics, and Image Processing, 15(4):287{298, 1982.[RK82] A. Rosenfeld and A.C. Kak. Digital Picture Processing, volume 2. Academic Press,1982.[Ros79] A. Rosenfeld. Picture Languages. Academic Press, 1979.[RSB93] S.V. Raman, S. Sarkar, and K.L. Boyer. Hypothesizing structures in edge-focusedcerebral magnetic resonance images using graph-theoretic cycle enumeration. CVGIP:Image Understanding, 57(1):81{98, 1993.[Sam80] H. Samet. Region representation: Quadtrees from boundary codes. Communicationsof the ACM, 23:163{170, 1980.[Tut63] W.T. Tutte. A census of planar maps. Canad.J.Math., 15:249{271, 1963.22