Discrete Medial Axis Transform for Discrete Thin and

0 downloads 0 Views 284KB Size Report
the image a center line, from which the surface of the object is computed. ... In section 3, the Discrete Medial Axis Transform for 2D discrete objects is defined ...
Discrete Medial Axis Transform for Discrete Thin and Elongated Objects A. Puig, D. Tost and I. Navazo Software Department, UPC (Catalonia), Spain Short running head: Discrete Medial Axis Transform

Anna Puig Avd. Diagonal, 647, 8 planta 08028 Barcelona Spain Phone. 34-93-4016739 Fax. 34-93-4016050 [email protected]

Abstract Skeletons are compact shape descriptions of discrete images. They have been extensively studied because of their utility in various applications such as data compression, shape abstraction, navigation and features detection. In this article, a new Euclidean skeletal definition for 2D discrete objects based on the Distance Map (DMAT) is being proposed. As a novel feature, it is shown that this skeleton is a connected subset of the discretization of the continuous medial axis of the object. Because of this property, the DMAT is 8-connected, it reflects all the features of the object and it preserves its topological characteristics. In addition, it provides dimensionality reduction, symmetry detection and invertibility. Moreover, it has a reasonable size and it guarantees low thickness. An efficient seed algorithm for the extraction of the DMAT is also proposed. The usage of a seed strategy is made possible by the connectivity of the DMAT. This algorithm requires a number of passes proportional to the dimensions of the object. Thus, it is especially suitable for thinned objects or for objects whose radius is low in relation to the size of the image. The simulations have shown that this method is useful in several applications, such as the extraction of blood vessels from medical images.

1 Introduction

( )

The Medial Axis Transform MATc O of an object O was defined by Blum in [1] as the closure of the set of centers of maximal balls which can fit inside a continuous object. This MAT is homotopic with the object characteristics and it is path-connected if the object is path-connected ([2]). In addition, it provides dimensionality reduction, symmetry detection and invertibility. Thus, it is an alternate compressed representation of objects and it preserves their topological characteristics. This is the reason why this description has been shown to be useful in CAD designs in order to reduce the computational complexity of certain algorithms. Nevertheless, it is a non minimal scheme and it is sensitive to small changes on the boundary of the object. Moreover, progress on its use as shape representation of 3D solids has been limited by the difficulty of developping a robust, accurate and efficient algorithm for its construction. The reconstruction of an object from discrete data is a common problem in application areas, such as medical imaging [3] and chartography. A possible strategy [4] to solve this problem consists in extracting from the image a center line, from which the surface of the object is computed. A similar strategy, composed of three steps, is proposed in [5] for the reconstruction of cerebral blood vessels. First, a discrete skeleton is extracted from the images. Next, this skeleton is vectorized. Finally, assuming that this vectorization is the Medial Axis of the analogic object, the object is reconstructed [6]. The error of the reconstruction is related to the initial discretization and to the three steps above mentionned. The former error is inherent to the registration process. The latter one can be avoided if the reversibility of the whole process is guaranteed. This is, the process requires that the discretization of the reconstructed object, according to known rules, is the initial discrete object. Thus, the discretization of the analogical medial axis must be equal to the discrete skeleton. In this paper, we address the definition and construction of the reversible discrete skeleton. Section 2 analyzes the existing discrete skeleton definitions and the hypothesis underlying the proposed solutions. In section 3, the Discrete Medial Axis Transform for 2D discrete objects is defined and its main properties are demonstrated. The algorithm of the MATD construction is proposed in section 4 and its evaluation and some simulations are analyzed in sections 5 and 6 respectively. Finally, the conclusions and the future work are presented in section 7.

2 Background Several works on 2D digital image processing, discrete approximations of the MAT, such as skeletal representations, are used as decompositions of discrete objects whose width is not negligible and may vary. The main construction algorithms of these skeletons are thinning ([7], [8], [9], [10]) and morphological methods ([11]). These skeletons are continuous but they do not reflect all the topological features of the discrete objects and they are not complete representation schemes. Other skeletal schemes are based on Distance Map transformations (DM) extrapolating Blum’s definition to the discrete case ([12], [9], [13]). The skeleton, skeleton(Od ), of a 2D discrete object Od is defined as the set of pixels which are centers of maximum-sized discrete disks fitted into Od , i.e. disks that cannot be completely covered by any other larger disk fitted into Od . These skeletons constitute complete and compressed representation models but they are not in general connected (see Figure 1). The preservation of the connectivity is essential to keep up the topological characteristics of the object boundary. It allows to apply algorithms that realize pattern recognition directly 1

on the skeleton instead of on the object boundary. Furthermore, the fact that the skeleton is not connected disables continuous traversals of the structure along it. In particular, its computation must be based on scans of the image. Several strategies have been proposed to reduce the computational cost of the skeleton construction, such as reducing the number of scans [14] and reducing the number of pixels to be considered in each scan [15].

Figure 1: Skeletons computed with different metrics.

In order to avoid the disconnectness, [16], [17] have proposed a continuous box-skeleton for discrete objects which preserves the homotopy, which does not have interior and whose shape is an abstract shape of the object. Although it constitutes an initial estimation of the euclidean skeleton, it does not reflect every feature of the boundary. Other MAT-based strategies ([18], [19]) try to reconnected the local maxima by defining a suitable set of connecting pixels. Specifically, [18] add saddle pixels (i.e. pixels whose neighborhoods contain alternating humps and valleys) and linking pixels, which guarantee that the skeleton has only one 8-connected component. The extraction algorithm consists into three raster scans through the object: two for constructing the Distance Map and one, interleaved with the path growing process, to mark center of maximal disks, saddle pixels and linking pixels. Optionally, a prunning and beautifying scan through the skeleton can be realized to improve skeleton aesthetics. The skeleton proposed in [19] is composed by local maxima, the climbing neighbours between them and saddle points, along with hump climbing neighbours between saddle points. These authors compute the distance transform with two passes through the image. Then, the skeleton is computed with two additional scans. In the first scan through the image, the local maxima and climbing pixels from them are computed, and in the second scan the saddle points and their climbing pixels are identified. It must be pointed out that the local maxima can be defined according to a desired tolerance. Both scans can be integrated, although results may differ. These MAT-based skeletons preserve the connectivity of the object, and they allow to reconstruct it. In addition, they are invariant under rotation, and they are insensitive to border noise. The aim of this paper is to define a skeleton sharing these properties, and which is a subset of the discretization of the analogical medial axis. An important choice of these algorithms is the metric used in the distance transform. The skeleton proposed in [18] is metric independent. In the paper, the most suitable distance function for specific needs are analyzed. [19] use metrics that are approximations of the Euclidean distance (chamfer 2-3, chamfer 3-4). Although any of these metrics can be used, in this article, the Euclidean distance proposed by [12] has been chosen. It is a good approximation of the analogical euclidean metric in spite of its memory overhead. 2

3 Discrete Medial Axis Transform (DMAT)

( )

The Discrete Medial Axis MAd Od of a discrete object Od is defined as a continuous set of pixels composed of the centers of maximal disks plus pixels, that will be called sharing pixels and which connect successive maximal disk center pixels. The center of maximal disks are easily detectable by means of lookup tables. Next, the sharing pixels are defined.

3.1 Sharing sets

( )

( )

Let MAc O be the Continuous Medial Axis of a continuous object O with boundary bound O , then the points of MAc O in 2D space can be classified as CI (points with tangent continuity) and CII (points without tangent continuity) (see [6]). Thus, MAc O is composed by the union of segments limited by CII points. All these segments define a set of points which are centers of maximal disks inscribed into the object. These centers can be clustered in pairs such that their associated disks have a non-empty intersection area (see Figure 2).

( )

( )

CII points d2

CI points

d1

Center of disks Disks d1 and d2 Intersection of d1 and d2

Figure 2:

MAc(O) with CI and CII points.

It is possible to assume, without loss of generality, that the Continuous Medial Axis between every pair of non-disjoint inscribed maximal disks, D1 px1 y1 and D2 px2 y2 is equivalent to the Continuous Medial Axis of the object defined by the union of this pair of disks D1 px1 y1 [ D2 px2 y2 .

(

)

(

(

)

)

(

)

For this reason, the general case of any discrete object may be reduced to the discretization of a continuous object Ou defined as the union of two intersecting disks, non enclosed one into each other, of centers x1 ; y1 and x2 ; y2 respectively and of radii ra and rb .

(

)

(

)

Union of two continuous disks and its discretization

(

)

Let Ou be a continuous object defined by the union of two intersecting disks D1 and D2 of centers x1 ; y1 and x2 ; y2 respectively and of radii ra and rb . The Continuous Medial Axis of Ou is the straight-line segment between the two centers and every maximal disk associated to every point of this segment.

(

)

It should be noted that all the continuous maximal disks of the object Ou intersect with other maximals but they are never tangent to another maximal disk. The wrapping discretization of the straight-line segment between the two centers can be subdivided into waves. Let m to be the slope of a continuous straight line and let dir be the most influent direction of the slope m, a wave pij ; dir of this continuous straight line in a pixel pij of its discretization is the connected set composed by the intersection of the discretization of the straight line segment and the coordinate direction dir that passes through the pixel next to pij in direction dir. The waves are at most of two pixels.

(



)





The continuous MA is a symmetry axis of the object. Concretely, for the object Ou , all the maximal disks, but the end points, are normal points, i.e tangent to Ou in two symmetrical points. The wrapping 3

discretization retains this property: the waves are symmetrical in relation to the boundary of the object that they represent. The effect of the discretization of the metric (the continuous radii, r, on the discrete Euclidean metric, DEM r ) sums up with the spatial one (R2 on Z 2). The discretization of the metric produces that some tangencies between continuous disks change in the discrete metric. New discrete tangency concepts are defined.

()

()

As the DEM r defines a discretization of a set of continuous disks whose discrete shape is the disk defined by DEM r , it is possible to find continuous disks that intersect in R2 but whose discretizations do not intersect in Z 2 . Even more, their discretizations can be included one in the other.

()

DEM (r) = mind fd2 = x2 + y2= r  d & x 2 Z & y 2 Z g

REPR of disk (6, 2) respect with O

PEX disk (6,2)

PNR of disk (6,2) PINT(O) Center of the maximal disk (6,2) inside O

Figure 3: PINT, PEX and PNR sets.

( )

From the Euclidean distance associated to a pixel pi j of an Euclidean disk Dt pij , the following subset of pixels is defined (see Figure 3): 0

0

 PINT (Dt(pij )) are all pixels interior to the disk Dt (pij ). pi j 0

0

such that:

(i ? i)2 + (j ? j )2  t2 0

0

( ( )) exists whose distance is exactly t2 .



At least one pixel belonging to PINT Dt pij located exactly at t2 are called pivot pixels.



Let Dt pij be a disk centered at pij and with radii t, and let pi j a pixel inside Dt pij . The pixel pij is called owner of pi j . The Distance Map associated to pi j defines a subdisk, SDt pi j =Dt pij inside Dt pij with center on i j such that PINT SDt pi j = Dt pij 2 PINT Dt pij . Every subdisk SDt pi j =Dt pij inside Dt pij , being itself a disk, defines an interval of continuous radii. This interval intersects the interval of continuous radii defined by Dt pij (see Figure 4). The intersection arc is the union of the quadrant arc of the subdisk in relation with the disk and the arc bounded by the pivots of the subdisk. For any subdisk, the intersection arc defines the discrete tangency between the disk and the subdisk.

( ) ( )

0

0

0

( ) ( )) 0

0

(

0

0

0

( )

4

(

0

0

(

0

0

0

0

( )))

The pixels

( ) ( )) ( ( ( )) 0

( )

0

0

Quadrant arc Pivot arc

Interval radii of the subdisk

Intersection points

Interval radii of the disk

Figure 4: Arc of tangency between a disk and one of its subdisks.



The External Pixels of an object, PEX, is the set of pixels which are not inside the object but which have a 8-neighbor that belongs to the object.

PEX (O) = fpij = 9pi j : pij 2 8 ? neighbor(pi j )

(pi j ) = 1 & (pij ) = 0g 0

0

0

0

0

0

( )

This definition is extensible to maximal disks inside an object, i.e. the PEX of a disk Dt pij , PEX Dt pij is the set of pixels externals to Dt pij , which have a 8-neighbor inside it. The PEX of subdisks is defined restricted to the tangency area of the subdisk with its owner disk. It is the set of pixels external to the subdisk that have a 8-neighbor inside the subdisk and which are external to the owner of the disk. The PEX of a subdisk is thus a subset of the PEX of its owner disk.

( ( ))



( )

The Pixels Represented by a disk of an object, REPR that are external to the object:

(Dt(pij ); Od), is the subset of PEX (Dt(Pij ))

REPR(Dt(pij ); Od) = PEX (Od) \ PEX (Dt(pij ))



The Pixels Not Represented by a disk, PNR that are inner to the object Od .

(Dt (pij ); Od) is the subset of pixels of PEX (Dt(pij ))

PNR(Dt(pij ); Od) = PEX (Dt(pij ))? REPR(Dt(pij ); Od) The two definitions above apply for subdisks as well. The PNR of a disk can be viewed as a “door” from the disk to the remaining of the object. It is therefore empty if the object is a unique disk. In the discretization of the object Ou , end-points have only one PNR whereas normal maximal disks have two opposite PNRs. In practice, because the rasterization can be double, it may happen that a normal maximal disk is tangent to the boundary only on one side of the object. In this case, another maximal disk exists, tangent to the other side and such the union of both disks have two corresponding PNRs (see Figure 5). 5

(a)

(b)

Figure 5: “Doors” of a maximal disk: (a) single discretization, (b) double discretization. Being the PEX of a subdisk restricted to the tangency area with its owner disk, the PNR of a subdisk is always a subset of the PNR of its owner disk (see Figure 6, (a)). It can be empty if the REPR is totally external to the object (see Figure 6, (b)) and it can be equal to the owner’s PNR (see Figure 6, (c)). In the latter case, the subdisk defines the same “door”to the object than its owner disk and it is symmetrical in relation to this “door”. Coming back to the original problem stated in section 2, these subdisks appear to be precisely maximal analogical disks that have been discretized into non-maximal discrete disks.

(b)

(c) (a)

Figure 6: Interelation ships between the PNR of a disk and the PNR of a subdisk: (a) subset, (b) empty set and (c) equal.



A minimal connected set, C, in relation to the PNR, is a set of 4-connected pixels in an object Od such that no other 4-neighbor pixel to C exists, that added to it, could change its PNR in relation to Od:

8p 2 Od : p 4 ? connected to C :

the number of 4-connected sets in PNR(C, Od ) does not change k PNR C [ Dt p ; Od PNR C; Od

(

( ) )=

(

)

These definitions leed to the characterization of the sharing pixels which belong to the discretization of the medial axis of the object Ou . Of course, double discretizations produce that the union of two subdisks covers the “door” of their owner(s). Def 1. A sharing pixel pij of

Discr(Ou) is a center of a non-maximal disk that belongs to a minimal 6

connected set whose PNR is equal to the PNR of a minimal connected set containing its owner.

sharing = (pij ) 2 Dt (pi j ); 9C1 : C1 a minimal connected set 9C2 : C2 a minimal connected set pi j 2 C1 & pij 2 C2 : PNR(C2=C1; Od) = PNR(C1; Od) 0

0

0

0

In Appendix A the two following propositions concerning the sharing pixels are proved. Proposition 1. All sharing sets are contained into a wave of the wrapping dicretization of the Continuous Medial Axis, MAT of the object Ou . Proposition 2. Any wave w of the discretization of the continuous straight line axis of two disks is composed either of: 1. Only one pixel which is the center of a discrete maximal disk (M1), or 2. Two pixels that are the centers of two discrete maximal disks (M2), or 3. Only one sharing pixel which is thus center of a discrete non-maximal disk sharing the same PNR as at least one other wave of the discretization (NM1), or 4. Two sharing pixels that are centers of two discrete non-maximal disks such that the union of their associated PNR wraps at least one other PNR of a wave of the discretization (NM2), or 5. A pixel which is center of a discrete maximal disk with a non-maximal and non-sharing pixel (M1+NM3).

( ( ))

These propositions along with Proposition 2, enunciated above, prove that both skeleton D Ou and Sharing Pixels D Ou are fully contained into the wrapping discretization of the medial axis of Ou. Moreover, this proposition distinguishes three types of pixels in the wrapping discretization: maximal, sharing and NM3 (non-maximal and non-sharing). The two former ones are well-characterized and they only appear in the wrapping discretization. Instead, NM3 cannot be defined as only belonging to the discretization. However, the existence of NM3 pixels does not prevent a definition of a connected subset of the discretization, because they never appear alone in a wave.

( ( ))

3.2 Definition As mentionned above, in the general case of any continuous object, the MAT can be subdivided into linear segments. Propositions 2, 3 and 4 are obviously valid in any linear segment. In the junctions between segments, the maximal disks centers still belong to the wrapping discretization of the axis. The nonmaximal pixels can have various owners belonging to different branches. For these pixels, it is sufficient to be labelled as a sharing in relation to at least one owner, to belong to the Discrete Medial Axis. 7

( )

Def 2. The Discrete Medial Axis, MAd Od , of a discrete 2D-object Od , is the set of pixels belonging to the closure of the centers of the maximal disks incribed into the domain of the discretization plus the set of pixels which are centers of non-maximal disks sharing their non-represented pixel set with the maximal disk to which they belong.

MAd (Od) = f pij = (pij ) 2 (center(maximal disk) [ sharing(pij )g Def 3. The Discrete Medial Axis Transform of an object DMAT (Od ) is a pair < MAd (Od ); dist(MAd (Od )) >, where MAd (Od ) is the Discrete Medial Axis of the object and dist(MAd (Od )) is a function which assigns the Euclidean distance at each pixel belonging to MAd (Od ). 3.3 Properties of the Discrete Medial Axis The following propositions prove that the Discrete Medial Axis defined above fulfills the initial requirements: it is connected, it is a bounded set and it is a complete model. Proposition 3. The Discrete Medial Axis of a discrete 4-path-connected object is 8-connected. Proof. The Continuous Medial Axis of a path-connected object is path-connected ([2]). The discretization of a path-connected object is a discrete path-connected object. The wrapping discretization of the continuous Medial Axis is a 4-connected set of pixels. The difference between the Discrete Medial Axis and the wrapping discretization of the Continuous Medial Axis of the object is the set of NM3 pixels. However, these pixels always belong to a wave of the 4-connected discretization that is formed by almost one maximal. Then, the MAd Od is a 8-connected set only if Od is 4-path-connected.

( )

Property 1. The width of the Discrete Medial Axis is at most of 2 pixels on the linear segments of the axis. Proof. It is trivial because the Discrete Medial Axis is a subset of the wrapping discretization of the Continuous Medial Axis. Property 2. The Discrete Medial Axis Transform is a complete representation scheme. Proof. Every point of the boundary is represented by some point of the Discrete Medial Axis Transform and it is also possible to reconstruct the boundary only from the information stored in the Discrete Medial Axis Transform. Specifically, [12] has demonstrated the completeness of the subset of the maximal centers (skeleton O ) included in the definition 2.

( )

4 Building Algorithm In this section, a building algorithm is proposed based on the properties of the Discrete Medial Axis Transform analyzed above. The core of the algorithm is a seed strategy. It starts with an initial pixel that is specified beforehand and which belongs to the Discrete Medial Axis of the analyzed object. 8

First, a set of discrete disks and their associated PEX are computed in a pre-process and stored in lookup tables in order to accelerate the algorithm. Next, the seed process starts, composed of two main computations per step. First, the Distance Map at the current pixel is calculated and then, from this value, the ownership of the pixel to the Discrete Medial Axis is tested. The following seed function performs both processes:

( )

Def 4. Let wij be a wave of the Discrete Medial Axis of Od and Dt is defined as:

(wij ) its associated disk, then f (wij )

f (wij ) = fwik jk = maximal wave(wik jk =wij ) k sharing wave(wik jk =wij )g where,

(wik jk =wij ) = f

maximal wave

wik jk = 8pik jk : pik jk 2 wik jk & pik jk 2 8 ? neighbor(wij ) : maximal(pik jk ) & 4 ? connected set(wik jk ) g sharing wave(wik jk =wij ) = f wik jk = 8pik jk : pik jk 2 wik jk & pik jk 2 8 ? neighbor(wij ) :

9pij 2 wij : pik jk 2 Dt (pij ) : PNR(wij ; Od) = PNR(wik jk =wij ; Od)k

9pis js : pik jk 2 Dt(pisjs ) & pisjs 62 8 ? neighbor(pij ) :

9C1 : pisjs 2 C1 ^

C1 is a minimal connected set : PNR(C1 ; Od) = PNR(wikjk =C1; Od) g

Theorem 1. The Discrete Medial Axis Transform of a 2D discrete object may be computed with the seed function defined in Definition 4. Proof. The proof reduces to demonstrate that:

( )

1. The function f wij defined in Definition 4 computes pixels that belong to the Discrete Medial Axis and only this type of pixels. This property is implicit in the Discrete Medial Axis definition. 9

2. The seed function is a local computation, i. e., the functions sharing wave, maximal wave and Dt pij may be calculated from local information of the neighborhood of pij . The function sharing wave is computable using directly its definition in a local neighborhood.

( )

( )

Computing Dt pij is equivalent to calculating the associated Distance Map at pij . There are two ways to compute the Distance Map at a pixel. First, it can be calculated in a pre-process that realizes a double scan of the image ([12]). This pre-process has a linear cost with the size of the image and it needs an additional image buffer. However, it guarantees the locality of the seed algorithm computations. On the other hand, it is possible to calculate locally the Distance Map in the seed algorithm if the coherence of the Distance Map of a neighbor is used. Proposition 4. Given a pixel pij and its associated Distance Map, the Distance Map of any neighbor of pij may be computed locally.

( )

This proposition is proved in Appendix A.

5 Cost According to the explanations above, there are two strategies for the construction of the Discrete Medial Axis Transform: computing the Distance Map in a pre-process or computing it locally during the construction. In Proposition 5 the former strategy cost is evaluated and the latter is analyzed in Proposition 6. Proposition 5. The cost of the construction algorithm of the Discrete Medial Axis is O1 (8n+#PINT (Od ) K1), where n is the number of pixels of the initial image and #PINT (Od) is the number of pixels which define the object. K1 is the number of basic operations, such as additions or comparisons, and it is greater than 1. The first term of the sum is the cost of the Distance Map computation with a pre-process such as Danielsson’s. The second term is the cost of the seed function. Therefore, the cost is linear with the number of pixels of the image. In the algorithm implemented, the value of K1 is about 132 basic operations. Proposition 6. If the computation of the Distance Map is performed locally in each iteration of the seed algorithm, its cost is O2 PINT Od    d  K2 , where d is the maximum diameter of the greater disk used.

(#

( ) (

2 + ))

The cost of an algorithm to compute skeletal approximations such as Dannielsson’ s one is O n  PINT Od n .

(#

( ) + 23

))

(8  n + 3 

In conclusion, because of the comparison between the PNR sets of two adjacent pixels, the proposed algorithm has, in general, a higher cost than a classical skeleton approximation. However, as all the costs are linear, in images where the ratio between the number of pixels of the object and the number of pixels of the image is low, such as thinned objects, the seed algorithm improves the scan algorithm. Therefore, the algorithm is especially suitable to extract connected skeletons of elongated structures. Moreover, it guarantees the inclusion of the final skeleton into the discretization of the Continuous Medial Axis, easying thus the vectorization of the object through its discrete skeleton. 10

6 Results on empirical data The construction algorithm has been proved with sets of synthetic images of different sizes and with different objects. The run times and the memory costs are analyzed with a square, a key, a letter “l” and a complex object. Color Plates 1, 2, 3 and 4 show these simulations. In each figure, the original data, its distance map and the medial axis are illustrated. In these medial axes, the pixels in blue are the seed pixels, the red ones are the sharing points and the green ones are the centers of maximal disks. Run times for these analysis are performed with a SunSparc 10 machine on the SunOS version 4.1.3 using 16 Mb RAM, 1Mb Cache at 40 MHz. Data oc10 oc20 oc30 oc40 oc50 oc60 oc70 oc80

Original size 64x64 64x64 64x64 64x64 64x64 64x64 64x64 64x64

Occup. Run time (sec.) 10% 3.60 20% 7.76 30% 8.81 40% 14.5 50% 32.66 60% 36.50 70% 38.21 80% 42.12

Axis size (pixels) 30 32 34 36 60 60 70 60

Table 1: Run times (in seconds) and memory requirements of the simulations of 2D algorithm with data sets of same sizes and variable occupancy of the object in the image. From Table 1 it can be concluded that the occupancy of the objects in the images strongly determines the time processing. The sizes of the images and of the axis have been kept constant in the sets in order to measure the occupancy separately. Data size1 size2 size3 size4 size5 size6

Original size 8x8 16x16 32x32 64x64 128x128 256x256

Occup. Run time (sec.) 20% 1.05 20% 5.17 20% 11.20 20% 20.86 20% 29.38 20% 40.34

Axis size (pixels) 2 5 12 128 130 272

Table 2: Run times and memory requirements of the simulations of the building algorithm with data sets of different original sizes and with the same occupancy of the objects inside the images. Obviously, with different sizes of input data sets (Table 2), the time increases in an approximatively linear form. In Table 3, the run time is linear in relation to the size of the axis (complexity of the object). The last three simulations correspond to double discrete axes and then, the time increases in a non-linear form. 11

Data com1 com2 com3 com4 com5 com6 com7 com8

Original size 64x64 64x64 64x64 64x64 64x64 64x64 64x64 64x64

Occup. Run time (sec.) 10% 8.56 20% 20.86 30% 35.06 40% 49.94 50% 66.83 60% 81.52 70% 99.09 80% 111.16

Axis size (pixels) 64 128 188 252 314 376 428 596

Table 3: Run times and memory requirements of the simulations of the building algorithm with different complexities of the objects.

7 Conclusions and future lines A new definition of a Discrete Medial Axis which provides 8-connectivity, low thickness and model completness has been proposed. As it is a Medial Axis, it provides dimensionality reduction, symmetry detection and invertibility. The main feature of this skeleton is that it is included into the discretization of the Continuous Medial Axis of the continuous object. This property is essencial to provide a good reconstructibility of the object because it preserves the topological characteristics of the object. This DMAT is based on an euclidian metric because of its exactness, but it could be extended to a 3,4 metric for thin enough objects. Work is on progress to analyze the feasibility of other metrics on thin objects, such as the 5,7,11 one, which would reduce the memory requirements and make the center of maximal disk’s detection faster. An efficient seed algorithm that requires a number of passes proportional to the dimensions of the object has been described. This algorithm works better on thinned objects or on objects whose radius in respect 12

to the size of the image is low. It can be useful in applications such as pattern recognition of thinned structures on large images. Another application is the extraction of a model of elongated anatomical structures such as blood vessels [20], intestines or the colon in medical images. Similarly, it may be used for the detection of rivers and roads in Geographical Information Systems. Within these different applications, work is currently underway to apply this method to real 2D angiogram images. A current research line is the improvement of the algorithm using coherent information between two consecutive steps of the seed. The additional data provided by the bisectrice defined by a maximal disk may also be used in order to cull-off pixels in the navigation of the building algorithm. Finally, the definitions and the building algorithm seem to be easily extensible to the 3D case. A 3D disconnected medial axis approximation has already been proposed in [21], that generalizes Danielsson’s algorithm to 3D without increasing the maximal distance error. Work is currently underway to define the 3D Discrete Medial axis and to prove its 28-path-connectivity, its completness and its minimum witdh [20].

13

14

Appendix A Proof. of Proposition 2 First, the most simple case, i.e. if the object O is a continuous disk, is demonstrated. Next, this proof is extended to the general case.

( ( )

)

Let D be a disk on R2 with radius r centered at x0 ; y0 . The distance surface of D is a single-valued function that associates to any interior point x; y of the disk, the value of the minimum distance from the point to the boundary of D. The distance surface is a strict crescent function in the radial direction from the boundary of the disk to the disk center. It has a singularity at the center point of the disk. This singularity represents the MAT of the disk. In the discretization in Z 2 , the distance surface is sampled at the center of every pixel and then, the continuous distance is discretized to the discrete distance map.

kdistE (r)k2 = mind f d2 = x2 + y2= rd&x2Z &y2Z g The Euclidean distance function kdistE (r)k2 can be expressed as the sequence S of integer numbers whose square is the sum of the square of two positive integers [22]:

S = fk = k = x2 + y2; x 2 Z; y 2 Z g

(1)

Every element of S can be expressed as the product of its factors. An integer value k belongs to S if and only if all the factors of its product that are larger than two and with odd exponent are congruent with 1 mod 4. This property can be also expressed as:

k = 2a  k with k  1(mod 4) 0

0

Then, it is possible to define the successor of any element k in S according to the value a of the exponent. This relationship is expressed as:

(2)

if a  2 then succ(k) = k + 1 if a = 1 then succ(k) = k + 2 or succ(k) = k + 3 if a = 0 then succ(k) = k + 1 or succ(k) = k + 3 or succ(k) = k + 4

From this proposition, it is obvious that, given a number k of S, its successor in S can only be k k or k .

+3

+4

+1, k +2,

Equation 2 determines the range of distance maps that is associated to the rasterization of a continuous disk. This derives naturally from the fact that, being an Euclidean distance, DM r is an element of S.

()

15

( ) 1 ( +  ) + ( +  ) ) (p + ) ( )=( ) =p + = +

In addition, given i; j , the DM of any internal pixel of an object with connected boundary, the DM of all the 8-neighbors of the pixels are bounded by i i; j j such that i  ?i and j  ?j and 2 2 2 2 ki i j j ? i j k  . From this, given the Distance Map associated to a pixel, i ; j associated to any DM pxy i; j such that r i2 j 2 , and the Distance Map DM px y 2 2 of its 8-neighbor px y with r i j , r is bounded by an interval, whose coarse bound is: 0

0

0

0

0

4

( + + )

(

0

0

 )=(



0

0

)

0

(3)

if i 6= 0 and j 6= 0 r2 ? (2  min(i; j ) ? 1)  r 2 and r 2  r2 + (2  min(i; j ) + 1) if i = 0 k(0; j ? 1)k  r  k(i + 1; j + 1)k if j = 0 k(i ? 1; 0)k  r  k(i + 1; j + 1)k 0

0

0

0

Z

Z

Y

Y

X

X

Figure 7: Distance surface and discrete distance surface. Then, after the analysis of the discretization of the continuous distance to the discrete distance, it can be concluded that:

 

The discrete distance surface is a discrete wrapping function of the continuous distance surface (see Figure 7). The discretization of any radial line of the continuous surface is such that the Distance Map of the pixels along the line increases at least in one unity from one pixel to the next pixel closer to center (Equation 3).

Z Y

X Medial Axis

Region A Region B

Figure 8: Distance surface of the union of two continuous disks. Thus, the discrete distance surface is a strict crescent radial function, except for the singularities of the distance surface. Therefore, pixels that do not contain the center of the disk, cannot be maximal. In the general case, in order to characterize any wave w of the discretization of the continuous straight line axis, it is sufficient to analyze the distance surface of the union of two disks (see Figure 8). The 16

singularities of this surface compose the medial axis. The corresponding discrete distance surface can subdivided into two types of regions. Region A is composed by pixels that belong only to one maximal disk. It behaves as the simple case studied above. Region B is the set of pixels that belong to the two maximal disks. The edge of singularity of this region represents the local maxima of the distance function. Thus, maximal discrete disks centers can only appear in this edge. Moreover the edge is the locus of the discretization of all the continuous maximal disks centers. Therefore, the centers of all the discrete maximal disks can only appear in the wrapping discretization of the continuous medial axis.

Proof. of Proposition 3 Let suppose the existence of a sharing set C2 that does not belong to the discretization of the Medial Axis of the object. According to the definition of a sharing set, a minimal connected set C1 exists, which shares its PNR with the sharing set PNR.

C1 belongs to the axis discretization, PNR(C1 ; Ou) is symmetrical in relation to the axis. Then, if PNR(C1; Ou) = PNR(C2=C1; Ou), according to the sharing set definition, PNR(C2 =C1; Ou) is also symmetrical in relation to the axis. But if C2 does not belong to the discretization, it cannot be symmetri-

If

cal!.

(

)

Otherwise, if C1 does not belong to the axis discretization, its PNR C1 ; Ou can be empty or not. The empty case is trivial. If the PNR is non-empty then, as C1 is not in the axis dicretization, its PNR is asymetrical in relation to the axis. Being itself also outside from the axis discretization, C2 , must have a different PNR from C1 :

PNR(C1; Ou) < PNR(C2=C1; Ou) k PNR(C2=C1; Ou) < PNR(C1; Ou) Thus, C2 cannot be a sharing set of C1 !. Even more, a set as C1 , that does not belong to the axis discretization, cannot define a sharing set.

Proof. of Proposition 4 Any wave of the wrapping discretization of an axis is composed by at least one pixel and at most two pixels. As demonstrated in Proposition 2, maximal disks only appear in pixels crossed by the continuous medial axis. Then, a wave can be composed by zero, one or two maximal. Let pi1 j1 be a non-maximal disk center that belongs to a wave of the discretization. Being non-maximal, it labeled as subdisk center SD pi1 j1 =Dt pi0 j0 that belongs to the maximal Dt pi0 j0 . The intersection of PEX SD pi1j1 =Dt pi0 j0 and PEX Ou is not empty because at least one pixel of the subdisk (the pivot pixel) must be exterior to the object in order to be labeled with its distance map (see Definitions od the PEX and PNR sets, its properties and case A in Figure 9).

( (

) (

))

((

) ( )) ( )

(

)

( ( ( )) ( ( ) ( ) ) ) ( ) )= ( ( )

Besides, the continuous medial axis is a symmetry axis of the object. If the PEX SD pi1j1 =Dt pi0 j0 , is also symmetric in relation to the direction of the medial axis, then PNR SD pi1 j1 =Dt pi0 j0 ; Ou is symmetrically bounded by pixels of the PEX Ou . Then, PNR SD pi1 j1 =Dt pi0 j0 ; Ou PNR Dt pi0 j0 ; Ou . And then, any 4-neighbour of pi1 j1 fulfils that:

( )

( (

17

)

A

A

A

B

B

B

(A)

(B) Non-maximal

(C) Medial axis

Maximal

Figure 9: Symmetries of the axis in relation to the PEX and PNR sets.

PNR(SD(pi1j1 ) [ SD(pi2j2 )=Dt (pi0j0 ); Ou) = PNR(SD(pi1j1 )=Dt(pi0 j0 ); Ou) It is the case of a wave composed by one non-maximal (see case B in Figure 9), i. e. the minimal connected set is composed by only one non-maximal pixel.

( ( ( )) ( ( ) ( ) )

On the contrary, if the direction of the medial axis is asymmetric in relation to the PEX SD pi1j1 =Dt pi0 j0 , then the continuous axis, in this wave, is composed by two pixels. Moreover, PNR SD pi1 j1 =Dt pi0 j0 ; Ou PNR Dt pi0j0 ; Ou . Then, it exists a neighbor of pi1j1 , pi2 j2 , that accomplishes:

( (

)

)

PNR(Dt2 (pi2j2 ); Ou) \ PNR(Dt (pi0j0 ); Ou) 6=  The pixel pi2 j2 can either be a maximal disk (case M

1 + NM 3) or a non-maximal disk (case NM 2).

In the last case, if pi2 j2 is not a maximal disk, and it belongs to the same maximal disk as pi1 j1 , then, by symmetry, it must have at least one of its pivots in PEX Ou , in the opposite side of the pivot of pi1 j1 (see case C in Figure 9). Otherwise, if this pivot does not exist, then pi2 j2 would not have a non-maximal Distance Map. Moreover, pi1 j1 and pi2 j2 define the minimal connected set of the wave, because both contain the full PNR-set of their owner.

( )

PNR(SD(pi1j1 ) =Dt(pi0 j0 ); Ou) [ PNR(SD(pi2j2 )=Dt(pi0 j0 ); Ou) = If pi2 j2 belong to another maximal disk Dt3 (pi3 j3 ) PNR(Dt(pi0 j0 ); Ou) than the owner of pi1 j1 , then, as the intersection of the two subdisks SD(pi1 j1 =Dt (pi0 j0 )) and SD(pi2 j2 = Dt (pi3j3 )) is equal to the intersection of Dt (pi0j0 ) and Dt3 (pi3j3 ), following the previous reasonning, it is

obvious that:

PNR( SD(pi1j1 )= Dt (pi0 j0 ) [ SD(pi2j2 )=Dt3 (pi3j3 ); Ou) = PNR(Dt (pi0 j0 ) [ Dt3 (pi3j3 ); Ou)

Proof. of Proposition 6 This proposition is demonstrated directly from Equation 3 in Proposition 2. Equation 3 defines a finite interval where the radius associated to any neighbor of pij can vary. It can be state that the number of r2 r2 ? . and discrete disks to explore in this radius interval can be bounded by

p( + 4) p(

18

4)

References [1] H. Blum. A transformation for extracting new descriptors of shape. Models for the Perception of Speech and Visual Form. MIT Press, Cambridge, Mass., pages 362–380, 1967. [2] E.C. Sherbrooke, N.M. Patrikalakis, and F.E. Wolter. Differential and topological properties of medial axis transforms. Graphical Models and Image Processing, 58(6):574–592, November 1996. [3] W.E. Lorensen and H.E. Cline. Marching cubes: A high resolution 3d surface construction algorithm. ACM Computer Graphics, 21(4):163–169, July 1987. [4] L. Hong, A. Kaufman, Y.C. Wei, A. Viswambharan, M. Wax, and Z. Liang. 3d virtual colonoscopy. IEEE Computer Graphics and Applications, pages 26–32, 1995. [5] A. Puig, D. Tost, and I. Navazo. An interactive cerebral blood vessel exploration system. IEEE Visualization’97, October 1997. [6] P.J. Vermeer. Medial axis transform to boundary representation conversion. PhD Thesis, Purdue University, May 1994. [7] L. Lam, S.W. Lee, and C.Y. Suen. Thinning methodologies - a comprehensive survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 14(9):869–885, September 1992. [8] S.S.O. Choy, C.S.T. Choy, and W.C. Siu. New single-pass algorithm for parallel thinning. Computer Vision and Image Understanding, 62(1):69–77, July 1995. [9] R. Kimel, D. Shaked, N. Kiryati, and A.M. Bruckstein. Skeletonization via distance map and level sets. Computer Vision and Image Understanding, 62(3):382–395, November 1995. [10] T.C. Lee, R.L. Kashyap, and C.N. Chu. Building skeleton models via 3-d medial surface/axis thinning algorithms. CVGIP: Graphical Models and Image Processing, 56(6):462–478, November 1994. [11] Y. Masutani, K. Masamune, and T. Dohi. Region-growing based feature extraction algorithm for treelike objects. Proceedings of 4th International Conference Visualization in Biomedical Computing, Hamburg, Germany, pages 161–171, September 1996. [12] P.E. Danielsson. Euclidean distance mapping. Computer Graphics and Image Processing, 14:227– 248, 1980. [13] F. Nilsson and P.E. Danielsson. Finding the minimal set of maximum disks for binary objects. Graphical Models and Image Processing, 59(1):55–60, January 1997. [14] A. Rosenfeld and J.L. Pfaltz. Distance functions on digital pictures. Pattern Recognition, I:33–61, 1968. [15] P.C.K. Kwok. A thinning algortihm by contour generation. Communications of ACM, 31:1314–1324, 1988. [16] A. Sudhalkar, L. G¨urs¨oz, and F. Prinz. Box-skeletons of discrete solids. Computer-Aided Design, 28(6/7):507–517, 1996. 19

[17] A. Sudhalkar, L. G¨urs¨oz, and F. Prinz. Continuous skeletons of discrete objects. ACM Proceedings on Solid Modelling 93, Montreal, Canada, pages 85–94, 1993. [18] G. Sanniti and E. Thiel. Skeletonization algorithms on path-based distance maps. Image and Vision Computing, 14:47–57, 1996. [19] C.W. Niblack, P.B. Gibbons, and D.W. Capson. Generating skeletons and centerlines from the distance transform. CVGIP: Graphical Models and Image Processing, 5:420–437, September 1992. [20] A. Puig. Contribution to Volume Modeling and to Volume Visualization. PhD thesis, Software Department, Universitat Politecnica de Catalunya, Barcelona, Spain, October 1998. [21] G. Gerig, Th. Koller, G. Sz´ekely, Ch. Brechb¨uhler, and O. K¨ubler. Symbolic description of 3-d structures applied to cerebral vessel tree obtained from mr angiography volume data. Proceedings of the 13th International Conference on Information Processing in Medical Imaging, Springer-Verlag, New York/Berlin, pages 94–111, 1993. [22] A. Rio. Personal communication. Departament de Matematica Aplicada, UPC, 1998.

20

Suggest Documents