Topographic Maps

1 downloads 0 Views 547KB Size Report
May 21, 1999 - are all based on a Gaussian-like convolution followed by an analysis of ..... Recall the de nitions of erosion and dilation of a subset X ...... 34] B. Julesz, Texton gradients: the texton theory revisited, Biological Cybernetics, 54, ...
Topographic Maps Vicent Caselles  Bartomeu Coll y Jean-Michel Morel z May 21, 1999

Abstract

We call "natural" image any photograph of an outdoor or indoor scene taken by a standard camera. We discuss the physical generation process of natural images as a combination of occlusions, transparencies and contrast changes. This description ts to the phenomenological description of Gaetano Kanizsa according to which visual perception tends to remain stable with respect to these basic operations. We de ne a contrast invariant presentation of the digital image, the topographic map, where the subjacent occlusion-transparency structure is put into evidence by the interplay of level lines. We prove that each topographic map represents a class of images invariant with respect to local contrast changes. Several visualization strategies of the topographic map are proposed and implemented and mathematical arguments are developed to establish stability properties of the topographic map under digitization.

1 Introduction What are the basic, computable elements from which the analysis of any natural image could start ? The edges, that is, the discontinuity lines in an image have been and still are frequently considered as the basic objects in images, the "atoms" on which most Computer Vision algorithms can be built [43]. There is no single de nition for them, however. Many techniques from functional analysis have been proposed. A review of the variational approaches can be found in [48], where it is argued that, knowingly or not, all edge detection methods are variational. To make short a long story, let us recall that a digital image is modelled as a real function u(x), where x represents an arbitrary point of the plane and u(x) denotes the grey-level at x. In practice, an image has discontinuities everywhere, so that some selection process of the "true" discontinuities (or edges) must be de ned. One way to do the selection of the "right" discontinuities is to smooth previously the image by some convolution or di usion process, after which edges are detected as local extrema of the gradient magnitude in the gradient direction([43], [9]). Then these points must be connected to form curves. Another way to do this selection is to have an a priori model of the image, describing which kind of discontinuities are expected (and which kind of regularity). These expectations are translated into an energy functional E (u; u0 ) where u0 is the original digital image, and u an arbitrary element of an admissible class of interpretable images (e.g. with smooth regions and smooth discontinuity lines). Such a model for images is to impose (as proposed in [53]) to u that it belongs to BV (space of functions with bounded variation), so that, by a classical theorem in geometric measure theory, the discontinuity set is recti able, i.e., contained in a countable union of curves with nite length. Our aim here is to propose a di erent de nition of the basic curve structure of an image, the topographic map, that is, a complete description of the image by its levels lines and junctions of level lines. By a complete description of the image, we mean a description from which the image  y z

Dep. of Mathematics and Informatics, University of Illes Balears, 07071 Palma de Mallorca, Spain, [email protected] Dep. of Mathematics and Informatics, University of Illes Balears, 07071 Palma de Mallorca, Spain, [email protected] CMLA, ENS. Cachan, 61 Av. du President Wilson, Cachan, France, [email protected]

1

can be fully reconstructed. Our argumentation is as follows. First, we describe the main physical accidents of the generation process of natural, "real world" images. Then we deduce from invariance requirements with respect to the accidents what information is left: the level lines. In two words, the main reason why level lines appear central is that they contain all of the image information invariant with respect to local constrast changes. The main operations in the generation process are occlusion and transparency: they generate junctions of level lines and leave as only invariants the pieces of level lines joining them. As a result, we propose a computational model for singularities of Kanizsa [35], [36] theories: T-junctions. Further technological applications have been developped since the rst version of this paper and will be discussed at the end of this paper. At the computational level, the algorithm computing the topographic map of digital images is extremely simple, since it is based on the computation of level lines as the topological boundaries of level sets (which are computed by a simple thresholding !). As a rst algorithm analysing the topographic map, we propose a digital junction detector which works without previous smoothing of the image. Among works which have considered algorithms for the detection of T-junctions in images, we would like to mention [2], which proposes a rather successful mix of edge detection techniques and mathematical morphology. Other attempts to obtain T-junctions from a previous edge detection step are proposed in [19], [40] and [50]. These methods are all based on a Gaussian-like convolution followed by an analysis of edges and are not invariant with respect to contrast changes. Now, as explained in [19], [5], the T-junctions detection methods using a previous smoothing of the image tend to alter the junctions and let the edges vanish precisely where they are needed: in a neighborhood of the junction. So such methods necessitate, after the edge detection, a subsequent following up of the edges to restore the junctions. In the same way as we do, Romeny et al. [27] consider geometric properties of isophotes and in particular their invariance under nonlinear intensity transformation. They propose to use the gradient of isophotes curvature as a good candidate for a T-junction detector. This method requires a previous smoothing of the image by heat equation and the computation of third order derivatives. Brunnstrom [8] considered how junction detection and classi cation can be performed in an active visual system. D. Beymer [7] analysed junctions de ned as the intersection points of three or more regions in an image, which is basically what we also propose but without the need of a previous gradient computation. Deriche and Blaszka [18] proposed ecient models associated to edges, corners and junctions to extract and characterize these features directly from the image. In contrast, we do not push the characterization or classi cation of T-junctions or others, but argue that they might be selected among the more general kind of junctions yielded without any preprocessing by the topographic map. In particular, we think that level lines and their junctions can be a better starting point than edges in the clever non local grouping algorithms developped by Heitger and von der Heydt [30] and Nitzberg-Mumford [50] and in the structural analyses performed by Malik [42] and Leclerc-Zucker [39]. In [5] is presented a rigorous theory for detecting corners. Now, the proposition made therein, that junctions can be detected as the coincidence of several corners, does not take advantage of the topological di erence between corners and junctions. Junctions, as meeting points of level lines, are in fact easier to detect than corners. Our plan is as follows. In Section 2 we shall sketch the process of image formation and show how this process leads to invariance requirements for the image operators. We shall be particularly interested in the singularities which are inherent to the image formation process (T-junctions). In Section 3, we deduce which are the largest invariant objects in an image, containing the basic information and being a full representation of it. They constitute the basic structure of the image: the topographic map. In Section 4, we formally de ne the topographic map and prove it to be the invariant structure of an image under local contrast changes and we display some examples. In Section 5 we analyze the stability properties of the topographic map under digitization. Section 6 is devoted to the e ective computation of level lines and junctions of the image and to rst experiments. We then discuss di erent visualisation strategies for the topographic map. We nish with a discussion in Section 7. 2

2 How Natural Images Are Generated : Occlusion and Transparency as Basic Operations We shall, following the psychologist and gestaltist Gaetano Kanizsa, de ne two basic operations for image generation : occlusion and transparency. In the same way as in acoustics, where the basic operation, the superposition of transient waves, is interpreted as an addition of functions in a Hilbert space, we shall interpret occlusion and transparency as basic operations on images considered as functions u(x) de ned on the plane. The description of image generation which follows is intentionally sketchy, since our aim is to arrive at invariance requirements from the most straightforward accidents of image generation. Our description of image generation will at rst neglect the digitization e ects (that is, convolution and sampling). Later, in Sect. 5, we shall see how, assuming a simpli ed model for image formation with a di raction limited optical system, the grey level quantization involved in the digitization process comes to our help to maintain the basic geometric structure of the scene which is distorted by the convolution imposed by the nite aperture of the optical system.

2.1 Occlusion

As common knowledge indicates, we only see parts of the objects in front of us because they occlude each other. Let us formalize the basic operation of adding a new object in front of the scene. Given an object A~ in front of the camera, we call A the region of the image plane onto which it is projected by the camera. We call uA the grey level image of A~ thus generated, which is de ned in the plane region A. Assuming now that the object A~ is added in a real scene R~ of the world whose image was v, we observe a new image which depends upon which part of A~ is in front of objects of R~ , and which part in back. Assuming that A~ occludes objects of R~ and is occluded by no object of R~ , we get a new image uR~[A~ de ned by uR~[A~ = uA in A (1) = v in IR2 n A : u R~ [A~

Of course, we do not take into account in this basic model the fact that objects in R~ may intercept light falling on A~, and conversely. In other words, we have omitted the shadowing e ects, which will now be considered.

2.2 Transparency (or Shadowing)

Let us assume rst that one of the light sources is a point in euclidean space, and that an object A~ is interposed between a scene R~ whose image is v and this light source. We call S~ the shadow spot of A~ and S the region it occupies in the image plane. The resulting image u is de ned by

uR;~ S;g = v in IR2 n S ~ uR;~ S;g = g(v) in S : ~

(2)

Here, g denotes a contrast change function due to the shadowing, which is assumed to be uniform in S~. Clearly, we must have g(s)  s, because the brightness decreases inside a shadow, but we do not know in general how g looks. The only assumption for introducing g is that points with equal grey level s before shadowing get a new, but the same, grey level g(s) after shadowing. Of course, this

model is not true on the boundary of the shadow, which can be blurry because of di raction e ects or because the light source is not really reducible to a point. Another problem is that g in fact depends upon the kind of physical surface which is shadowed so that it may well be di erent on each one of the shadowed objects. This is no real restriction, since this only means that the shadow spot S must be divided into as many regions as shadowed objects in the scene ; we only need to iterate the application of the preceding model accordingly. 3

Figure 1: Nonlinear response of sensors. A variant of the shadowing e ect which has been discussed in perception psychology by Gaetano Kanizsa [35] is, following Fuchs [22], transparency. In the transparency phenomenon, a transparent homogeneous object S~ (in glass for instance) is interposed between part of the scene and the observer. Since S~ intercepts part of the light sent by the scene, we still get a relation like (2), so that transparency and shadowing are equivalent from the image processing viewpoint. If transparency (or shadowing) occurs uniformly on the whole scene, the relations (2) reduce to

ug = g(v);

(3)

which means that the grey-level scale of the image is altered by a nondecreasing contrast change function g.

2.3 Requirements for Image Analysis Operators

Of course, when we look at an image, we do not know a priori what are the physical objects which have left a visual trace in it. We know, however, that the operations having led to the actual image may include formulas (1, 2). Thus, any processing of the image should avoid to destroy the image structure resulting from (1, 2). The identity and shape of objects must be recovered from the image by means which should be stable with respect to those operations. Thus, our physical simple model for image generation already imposes that image analysis operations should be invariant with respect to any contrast change, a requirement proposed by Matheron [47]. We shall say that an operation T on an image u is contrast invariant if T (g(u)) = T (u) (4) for any nondecreasing contrast change g (classical examples of contrast invariant operators are erosion, dilation, opening and closing). To further support the previous conclusion, we remark that most light sensors have a nonlinear behavior and, even worse, have a nite range. Whenever light is too strong (or too weak), saturation of the sensors occurs (see Figure 1). The contrast changes are not only caused by the sensors but also due to the changes of the light intensity and the same objects. In other words, not only there exists a global contrast change when illumination intensity changes but also a contrast change conditioned by the objects in the scene. This is one of the informations provided by formulas (1, 2). We shall formalize this notion as local contrast change invariance in Section 4, Def. 5. By the contrast invariance requirement in computer vision, we by no means suggest that human vision is insensitive to contrast : It is plain that we do not see the same objects when we change the contrast of an image (see e.g. [31]). In fact, the contrast invariance requirement is nothing but a theory of information requirement in the computational use of digital images : we assert that even though some level lines can be below our range of sensitivity, they contain useful geometric information. Such 4

information is typically recovered by a viewer by adjusting the contrast of the image he is looking at. In contrast, the fact that an "edge" have a strength of say 10 or 30 does not change at all its geometric contents. Wertheimer [59] stated this remark, the irrelevance of grey level, as a basic principle of Gestalt theory. In the same way, rotation invariance is generally assumed in Computer Vision tasks, in contrast to our well known preference for vertical and horizontal lines and to the fact that our interpretation of objects is in uenced by our recognition and is certainly not rotationally invariant. The evidence of contrast invariance in some tasks of human shape recognition is only indirect, but strong. Indeed, Julesz texton theory proposes extrema of curvature (corners, terminators in his terminology) as well as their orientation as clues to texture detection. In the same way, Attneave's theory of human shape recognition also relies on extrema of curvature and in exion points. Now, it is noticeable that both orientation and curvature are invariant with respect to global and even local contrast changes in the sense we have de ned in this paper. Indeed, the orientation is given by a vector tangent to the isophote and is not altered by a contrast change. In the same way, curvature is computed as the curvature of the level lines and does not depend on local contrast.

3 The basic structure for image analysis We call basic objects a class of mathematical objects, simpler to handle than the whole image, but into which any image can be decomposed and from which it can be reconstructed. Two classical examples of image decompositions are

 Additive decompositions into simple waves: Basic objects of Fourier analysis are cosine and sine

functions, basic objects of Wavelet analysis are wavelets or wavelet packets, basic objects of Gabor analysis are gaussian modulated sines and cosines. In all of these cases the decomposition is an additive one and we have argued against it as not adapted to the structure of images, except for restoration processes. Indeed, operations leading to the construction of real world images are strongly nonlinear and the simplest of them, the constrast change, does not preserve additive decompositions. If u = u1 + u2 , then it is not true that g(u) = g(u1 )+ g(u2 ) if the constrast change g is nonlinear. This objection does not apply to image compression, because in compression tasks, the ne scale structure of the image dominates and this structure is linear: By Shannon sampling theory, the image must be the result of a ne convolution, so that, at ne scale, the image indeed is a sum of waves.

 Next, we have the representation of the image by a segmentation, that is, a decomposition of the

image into homogeneous regions separated by boundaries, or "edges". The notion of edge as a discontinuity of the image u(x) is not against the contrast invariant axiom. Indeed, if g is any continuous and increasing contrast change and u has a discontinuity at x0, then g(u) is also discontinuous at x0, and conversely. The notion of discontinuity does not impose a minimum strength on the jump but, in practice, one cannot compute them without xing the strength of constrast on the edges, tipically a uniform value for the whole image. This criterion is not invariant with respect to contrast changes. Indeed rg(u) = g0 (u)ru and g0(u) is close to zero when the image is close to obscurity or saturation. Moreover, classical edge detection basically consists of a convolution of u with a kernel k, followed by a di erential edge detector. Now, clearly, if g is nonlinear, k  (g(u)) 6= g(k  u). Mathematical morphology o ers an alternative: to decompose an image u into its binary shadows (or level sets), that is, we set X u = fx 2 IR2 : u(x)  g. The sets X u, or simply X , are called level sets of u. An image can be reconstructed from its level sets by the formula u(x) = supf; u(x)  g = supf; x 2 X ug : (5) The decomposition is therefore nonlinear, and reduces the image to a family of plane sets fX g. Obviously, if we transform an image u into g(u(x)), where g is an increasing continuous function 5

(understood as a contrast change), then it is easily seen that the set of level sets of g(u(x)) is equal to the set of level sets of u. A stronger invariance is even possible if we note that by formulas (1, 2) the contrast change can a ect only the connected parts of the level sets of u. This contrast invariance will be precisely de ned in the next section. Let us begin by de ning the topographic map of an image. Let be a domain in IR2. Let u : ! IR be an image, i.e., a bounded measurable function.

De nition 1 Given an image u, we call upper level set of u any set of the form [u  ] where  2 IR. De nition 2 ([17]) Let X be a topological space. We say that X is connected if it cannot be written

as the union of two nonempty closed (open) disjoint sets. A subset C of X is called a connected component if C is a maximal connected subset of X , i.e., C is connected and for any connected subset C1 of X such that C  C1, then C1 = C .

De nition 3 The upper topographic map of an image is the family of the connected components of the level sets of u, [u  ],  2 IR. Note that, by (5), the upper topographic map associated with u uniquely determines the function u. We could have also used the lower level sets of u, [u  ]. We call level lines of u the boundaries of the upper level sets of u. If we assume that we can determine the level sets of u from their boundary level lines, then we shall refer to the topographic map of u as the family of level lines of u. This is the case if our image is such that, for each level set [u  ],  2 IR the boundary @ [u  ] is made of a nite or countable union of closed Jordan curves. Then the oriented level lines perfectly de ne level sets, and, hence also the function u. Recall that a continuous curve is called a Jordan curve if it has no sel ntersection, except possibly at its endpoints (Examples: a circle, a segment, a parabola). This restricts our functional model for continuous images but does not represent any restriction for discrete or digital images. Indeed, in the discrete framework (or in any continuous interpolation framework for images), we can associate with each level set a unique nite set of oriented Jordan curves which de ne its boundary and, conversely, the level set is uniquely de ned from those Jordan curves. We shall call them level curves of the image. In the following, we assume that these level curves exist, be it because the image is discrete or, e. g., in an adequate function space.

De nition 4 If u belongs to a function space, such that each connected component of a level set is

bounded by a countable or nite number of oriented Jordan curves, we call topographic map the family of these Jordan curves.

Remark. When in the following we display the topographic map, we only display the Jordan curves, without specifying their level  or orientation. Now, in order to ensure reconstruction of u, we of course need this information. If we assume that the level sets are closed Cacciopoli subsets of IR2 , that is, closed sets whose boundary has nite length, then its essential boundary is a countable or nite union of closed Jordan curves and, possibly, a set of null H 1 Hausdor measure (see [15]). In this case, we can describe the connected components of level sets by their boundary (see [15]). This is an interesting case, since it covers the case of functions of bounded variation (or simply, BV functions) which have been frequently used as functional image models for purposes of denoising, edge detection, etc. ([54]). If u is a function of bounded variation, u 2 BV ( ), then almost all level sets [u  ] are closed Caccioppoli sets [20]. Then, the topographic map of u can be described in terms of the level lines of u and Formula (5) holds as well.

Two objections. Before starting with the mathematical model, let us discuss two serious objections which were raised by auditors and readers of a preliminary version of the present paper. The rst is 6

concerned by \shape from shading" models. Human performance in recovering shape from shading has been demonstrated in phenomenological rigorous experiences. Now, if the image is known up to a contrast change, then there is no way of recovering the 3D shapes from a single view by the \shape from shading equation". Contrast invariance is nontheless a sound assumption when we look at a photograph of, say, a statue. In that case, we ignore lighting and photographying conditions. Thus, the reconstruction of the 3D shape from a photograph is in theory impossible without some further information. Archeologists know this well, since they are not contented with photographs of objects found, but ask for a good conventional drawing. Lab. phenomenological experiments are a di erent story, since the subject is placed in known lighting conditions, so that the contrast invariance assumption is not valid anymore. Another objection of a di erent kind is whether level lines can exist for textured image and yield a useful information. The answer is de nitely yes. No matter how complicated the patterns of the level lines may look, they re ect the structure of the texture. We have commented right above that level lines of a digital image can always be computed (see e.g. Figure 3.5 for a detail of a textured image.) Texture classi cation by the study of \granularity" is nothing but the exploration of the structure of small level sets, the boundary of which are small level lines ([57]).

4 Invariance properties of the upper topographic map We now prove that the topographic map is a contrast invariant description of an image. We work in the continuous framework but all we shall say is obviously true for digital images. Even if our main interest lies in IR2 , the formalism being the same, we shall work in IRN , N  1. We shall denote by LN the Lebesgue measure in IRN . Let be an open subset of IRN . Given a function u : ! IR,  2 IR and x 2 [u  ], we shall denote by cc([u  ]; x) the connected component of [u  ] containing x. Setting X = [u  ]; we also set [ cc^ (X ; x) = cc(X0 ; x): 0 >

Roughly speaking, we call local contrast change of an image u a function h(x; ) such that the new image v(x) = h(x; u(x)) has globally the same connected connected components of level sets as u. In the following, we always consider functions h(x; ) which are nondecreasing with respect to . We set hl (x; ) = sup h(x; ) and hr (x; ) = inf h(x; ): >

 0, we shall denote by Br the open ball of radius r centered at the origin of coordinates. Recall the de nitions of erosion and dilation of a subset X  IR2 by a structuring element Y  IR2 X Y = fx 2 IR2 : x + Y  X g X  Y = fx 2 IR2 : (x + Y ) \ X 6= ;g: Recall also that IR2 n (X Y ) = (IR2 n X )  Y: (10) If Y = B,  > 0, then X  B = fx 2 IR2 : d(x; X ) < g. Let G be the convolution operator whose kernel G(x) is a positive radially symmetric function such that Z G(x)dx = 1: (11) 2

Let  > 0 and let  > 0 be such that

IR

Z IR2nB

G(x)dx = :

(12)

Note that if G is of compact support contained in B then we may take  = 0.

Lemma 1 Let B be a measurable subset of IR . Then, [G(B ) > ]  B  B 2

and

B B  [G(B )  1 ? ]: 11

(13) (14)

Proof. i) If x 62 B  B , then using (10) we have (x + B) \ B = ;. Then, setting B (x) = 1 if x 2 B , B (x) = 0, otherwise,

Z

G(B )(x) =

ZIR2

+

G(x ? y)B (y)dy =

2 ZIR n(x+B)

=

IR2n(x+B )

Thus

Z

G(x ? y)B (y)dy

x+B

G(x ? y)B (y)dy

G(x ? y)B (y)dy 

Z IR2nB

G(z)dz = 

IR2 n (B  B)  [G(B )  ]

which gives (13).

ii) If x 2 B B, then x + B  B . Hence

G(B )(x) =

 =

Z

Zx+B Zx+B B

G(x ? y)B (y)dy + G(x ? y)B (y)dy =

G(z)dz = 1 ? 

Z ZIR2n(x+B) x+B

G(x ? y)B (y)dy

G(y ? x)dy

and (14) follows.

Consequence. Let u be an image and 0 2 IR. Then G(u)  0G( u0 )  0(1 ? ) u0 B : (15) Hence [u  0] B (0; )  [G(u)  ] where  = 0(1 ? ). To prove a similar inclusion in the other direction, let M = supfju(x)j : x 2 IR g. Let us write  = 1 ?  which is a number close to 1. Observe that M ? u  (M ?  ) u a(1 ? ) + M + k]  D  B : (23) If k > 0 we may write [G(u)  a(1 ? ) + M + k] instead of [G(u) > a(1 ? ) + M + k]. If G(x) has compact support in B , then we may take  = 0 and, if k satis es (22), we have D B  [G(u)  b]  [G(u) > a + k]  D  B: (24) The value of k may help to maintain separated two level sets so that the quantization step does not

destroy them.

Proof. The rst inclusion in (23) is a consequence of Lemma 2. The second inclusion follows from

(22). Observe that

[G(u) > a(1 ? ) + M + k]  [G(u) > a(1 ? ) + M] Finally, the last inclusion in (23) follows from the above observation and Lemma 2. Our last remark follows from the observation that [G(u)  a(1 ? ) + M + k]  [G(u) > a(1 ? ) + M] when k > 0.

Practical consequences. If a level set X is associated with a jump of sucient size, then after

convolution with a kernel of size , a level set of G(u) will be located at a Hausdor distance  of X . To get a clearer idea let us illustrate it with a numerical example. We recall that the pixel spacing is 0:5r0 = 21 . Thus  is interpreted as a two pixel distance. Assume that we do not want to destroy level sets which have a superliminal contrast. Then, assuming M = 255, we shall take b ? a = 15, k = 1 (All 14 = 0:0518. are standard values in digital processing devices). If we compute  = 15;1 = Mb?+ab??ka = 270 Then we need to choose  such that Z G(x)dx = 0:0518 2 J 

IR nB

We recall that G(x) = (2 1 0 ) where r = jxj. This amounts to 5 pixels as our best  above. 0 10 = 0:037. In the worst case, the level set may have Assume b ? a = 15, k = 5, then  = Mb?+ab??ka = 270 8 displaced up to say 6 pixels. Finally, assume b ? a = 10, k = 2, then  = Mb?+ab??ka = 265 = 0:03. This amounts to around 8 pixels in the worst case. ( rr ) 2 r r

30 = 0:105263157 we obtain  = 3; 5 pixels. If If b ? a = 30, k = 0,  = 30;0 = Mb?+ab??ka = 285 b ? a 50  b ? a = 50, k = 0,  = 50;0 = M +b?a = 305 = 0:163934426. We almost get to  = 2 pixels.

Let us nally see the e ect of the scanning operator. 13

Lemma 3 Let u be an image. We assume that [u  ] is a constant set D for all  2]a; b]. Then D Q  [AQ(u)  b]  [AQ(u) > a]  D  Q; (25) i.e., the level set is displaced at most one pixel by the scanning process.

Proof. Let d be the size of the pixel, i e. the radius of the square representing the pixel, x be such that d(x; IR2 n [u  b])  d. Then Z AQ(u)(x) = Area1 (Q) u(y)dy  b (26) x+Q Hence D Q  [AQ (u)  b]. Now if d(x; D)  d, then Z u(y)dy  a: AQ(u)(x) = Area1 (Q) x+Q

(27)

It follows that [AQ(u) > a]  D  Q.

Conclusion. We see from the former Lemma that if an imaging system only consists of a scanning

process followed by sampling, then displacement of level lines will be of at most two pixels on both sides of physical 'edges'. Corollary 1 predicts a larger displacement (up to 8 pixels in the worst case) for optimal imaging systems like astronomic observation devices. Now, returning to images generated by CCD cameras of the today's technology or scanners, it is easy to check that the ratio between optimal pixel spacing (from the optical viewpoint) and actual pixel spacing is more than 10 (this is even the case for earth observation satellites, like SPOT). Thus it is expected that each 'edge' in the image generates about four or ve level lines at a one pixel distance from each other. In other words, the pixel displacement predicted by Corollary 1, though existing, is negligible as a displacement factor for all purposes digital imaging systems. This is easily checked in ALL topographic maps displayed here. In fact, a wider width of 'edges' in terms of number of level lines is only observed where the image is defocussed. The defocussing can be evaluated by Lemma 3 again, since the defocus kernel is compactly supported, in general some disk or square.

5.2 Digitization of Junctions

We must be able to de ne the notion of analog and discrete Junction so that the digitization process applied to an 'analog Junction' creates a 'discrete Junction'. We shall assume that both the convolution kernel and the scanning kernel have size , i.e., we assume that Q  B (x; ).

De nition 7 Let ; ; R > 0. Let u : ! IR be a bounded measurable function. We say that a point p 2 is an analog Junction (at resolutions given by ; R; ;  > 0) if i) it is locally stable in the following sense: there exist real numbers (p); (p) with (p)  (p) ? 2 and connected components cc([u < (p)]), cc([ (p) +   u < (p) ?  ]), cc([ (p)  u]) of the sets [u < (p)], [ (p) +   u < (p) ? ], [ (p)  u] such that (cc([u < (p)]) B ) \ B (p; R) = 6 ; (cc([ (p) +   u < (p) ? ]) B  ) \ B (p; R) = 6 ; (cc([ (p)  u]) B  ) \ B (p; R) = 6 ; ii) the sets cc([u < (p)]) B  , cc([ (p) +   u < (p) ?  ]) B  and cc([ (p)  u]) B  are connected by arcs and have an area  . 3

3

3

3

3

14

3

De nition 8 Let u be an image and let U be its digital version. We say that there is a discrete Junction (at level of resolution 1 ; 1 ; R > 0) at p 2 ZZ 2 if there exist real numbers 1 (p); 1 (p) with 1(p)  1(p)?1 and connected components cc([U < 1(p)]), cc([ 1 (p)  U < 1(p)]), cc([ 1 (p)  U ]) of the sets [U < 1 (p)], [ 1 (p)  U < 1 (p)], [ 1 (p)  U ] with area  1 such that cc([U < 1(p)]) \ B (p; R) 6= ; cc([ 1 (p)  U < 1(p)]) \ B (p; R) 6= ; cc([ 1 (p)  U ]) \ B (p; R) = 6 ;

Remark. The conditions de ning analog and discrete Junctions require some comments. In the

de nition of analog Junction we assume that 'three objects' arrive at a point p so that the point is a multiple singularity. Moreover, in a neighborhood of the junction, the objects have some interior. This is required if we want to nd a trace of the set near the point p after digitization (convolution with a kernel of size or 'aperture' ). Our assumptions are related to the notion of regular model which in the context of mathematical morphology guarantees that the discrete version of a connected set belonging to the regular model will remain a digital connected set ([57],Thm. VII.2, p. 216).

Lemma 4 Let p be an analog Junction on a continuous image u : ! [0; M ] at resolutions given by ; R; ;  > 0. Let U be a digitization of u. Assume that 21M ?   , where  is given by (12). Then there exists a digital junction at p, possibly at a di erent level of resolution. Proof. If x 2 [u < (p)] B , then B (x; )  [u < (p)], hence Z

IR

G(x ? y)u(y)dy = 2

Z

ZB(x;)

G(x ? y)u(y)dy

G(x ? y)u(y)dy < (p)(1 ? ) + M;

+

IR2nB(x;)

If x 2 [ (p) +   u < (p) ? ] B , then

Z

IR2

and If x 2 [ (p)  u] B then

Z IR2

G(x ? y)u(y)dy  ( (p) + )(1 ? ) ? M: G(x ? y)u(y)dy < ( (p) ? )(1 ? ) + M:

Z IR2

G(x ? y)u(y)dy  (p)(1 ? ) ? M

Since 21M ?   , we have that (p)(1 ? ) + M  ( (p) +  )(1 ? ) ? M and ( (p) ?  )(1 ? ) + M < (p)(1 ? ) ? M. Let 1(p) = (p)(1 ? ) + M, 1(p) = (p)(1 ? ) ? M, 2(p) = ( (p) + )(1 ? ) ? M, 2(p) = ( (p) ? )(1 ? ) + M. Notice we may take 1  . From the above inequalities, we deduce [u < (p)] B  [G(u) < 1(p)] [ (p) +   u < (p) ? ] B  [ 2(p)  G(u) < 2(p)] [ (p)  u] B  [ 1(p)  G(u)] Arguing for the rst of these level sets, we have that [u < (p)] B2  [U < 1(p)]; 15

(28)

a priori also Now,

[u < (p)] B3  [U < 1(p)]:

(29)

cc([u < (p)]) B3  cc([u < (p)] B3) (30) and we conclude that cc([U < 1(p)]) has an area  . Similarly for the other two sets. Concerning the connectedness assertion, let x; y 2 cc([u < (p)]) B3. Then there exists a curve ?  cc([u < (p)]) B3 joining x and y. Let us denote by Q a generic pixel, i.e., a square in IR2 which we shall consider closed in the argument below. We shall identify, by notation, Q with its corresponding sampling point by the Dirac comb. Let ?~ = fQ : Q \ ? = 6 ;g. Then ?~ is connected (4-connected). Let ~ Q 2 ?. Since the diameter of the pixel is less than  we have that Q  ? + B (0; 2)  cc([u < (p)]) B  [G(u) < 1(p)]: It follows that AQG(u) < 1(p) on Q. Hence Q 2 [U < 1(p)]. Therefore ?~  [U < 1(p)]. We have shown that the set [U < 1(p)] contains an arcwise-connected subset cc([u < (p)]) B3 of area   which, according to i) intersects B (p; R). Thus cc([U < 1(p)]) \ B (p; R) = 6 ;. A similar result holds for the other two sets.

Remark. In the same line of argument as the conclusions we derived for level sets, if the scanning

dominates the image formation process, we can expect a displacement of about two pixels on the location of the digital junction with respect to the position of the analogous one.

5.3 Phenomenological interpretation of the topographic map Since the image formation, either continuous or digital, may include an unknown and non recoverable local contrast change, we have reduced the image to its parts invariant with respect to contrast changes, the connected components of the level sets of the image. (This invariance requirement was rst observed by Wertheimer ([59]) who argued that the grey levels in an image are not physically observable.) For digital images (or for continuous ones, if we assume an adequate functional model) the level sets may be described by their boundaries which we called level curves. Thus, for computational purposes, the topographic map of an image may be described by the family of its level curves. Let us discuss on an example how the level lines structure reveals the object occlusion structure. Figure 2 is an elementary example of image generated by occlusion. A grey disk is partly occluded by a darker square (a). In (b) we display a perspective view of the image graph. In (c) and (d) we see two of the four distinct level sets of the image, the other ones being the empty set and the whole plane. It is easily seen that none of the level sets (c) and (d) corresponds to physical objects in the image. Indeed, one of them results from their union and the other one from their set di erence. The same thing is true for the level lines (e) and (f) : they appear as the result of some "cut and paste" process applied to the level lines of the original objects. Following Kanizsa, we de ne signi cant parts of images as the result of a segmentation of level lines by T-junctions. The level lines (e) and (f) represent two level lines at two di erent levels and in (g) we have superposed them in order to put in evidence how they are organized with respect to each other and the resulting T-junctions. We have displayed one of them as a thin line, the other one as a bold line and the common part in grey.

Remark. We shall not go into the classi cation of Junctions (as T; Y; X; ; :::-junctions). For a more detailed discussion we refer to ([11]).

Let us summarize the main invariance argument.

Invariance Argument 16

Figure 3: An elementary example of image generated by occlusion.

 Since the image formation may include an unknown and non recoverable contrast change: We can reduce the image to its parts invariant with respect to contrast changes, that is, the level lines.  Since, every time we observe two level lines (or more) joining at a point, this can be the result of an occlusion or of a shadowing, we must break the level lines at this point : indeed, the branches of level lines arriving at a junction are likely to be parts of di erent visual objects (real objects or shadows). As a consequence, every junction is a possible cue to occlusion or shadowing. This Invariance Argument needs absolutely no assumption about the physical objects, but only on the " nal" part of image generation by contrast changes, occlusions and shadowing. The conclusion of Invariance Argument coincides with what is stated by phenomenology [35], [?]. Indeed, Gaetano Kanizsa proved the main structuring role of junctions (T and X-junctions) in our interpretation of images.

6 Computation and visualization of the topographic map 6.1 Computation of level lines and junctions

In this section, we discuss how level lines and junctions can be computed in digital images and we present experimental results. In a digital image, the level sets are computed by simple thresholding. A level set fu(x)  g can be immediately displayed in white on black background. In the today's technology,  = 0; 1; :::; 255, so that we can associate with an image 255 level sets. The Jordan curves limiting the level sets are easily computed by a straightforward contour following algorithm, which yields chains of vertical and horizontal segments limiting the pixels. In the numerical experiments, these chains are represented as 17

chains of pixels by simply inserting "boundary pixels" between the actual image pixels. According to De nition 8, in the discrete framework, we de ne "junctions" in general as every point of the image plane where two level lines (with di erent levels) meet (in a neighborhood of the point). In the experiments below, we take into account junctions if and only if the area of the occulting object, the apparent area of the occulted object and the area of background are large enough.

Discrete Junction Detection Algorithm  Fix an area threshold n (in practice, n = 40 pixels seems sucient to eliminate junctions due to

sampling e ects) and a grey level threshold b (in practice : b = 2 is sucient to avoid grey level quantization e ects). These values are more optimistic than the ones computed in a `worst case' in Section 5.2.  At every point x where two level lines meet : de ne 0 < 0 the minimum and maximum value of u in the neighboring pixels of x.  We denote by L the connected component of x in the set fy; u(y)  g and by M the connected component of x in the set fy; u(y)  g. Find the smallest   0 such that the area of L is larger than n. Call this value 1 . Find the largest ; 1    0, such that the area of M is larger than n. We call this value 1. If 1 ? 1  2b, and if the set fy; 1 ? b  u(y)  1 + bg has a connected component containing x with area larger than n, then retain x as a valid junction. In Experiment 2, we display the computation of junctions on di erent images. We thank the anonymous second referee for the following remark : "The discrete junction algorithm only appears to work when there is a variation in background contrast ; this induces a "T" junction between the level lines of the background and the level lines bounding the foreground object ; when there is no background variation, there is no junction (according to our de nition) and nothing is signaled by our algorithm." This observation is quite true. In fact, the boundary of the foreground object will have T-junctions in the inside if it is well-contrasted itself and T-junctions on the outside if the background has some contrast. Thus, and although we have seen no instance of it in experiments, an occluding boundary without T-junctions is possible if both foreground and background are strictly constant in grey level.

6.2 Visualisation of the topographic map

In this section, we discuss several strategies for visual inspection of the topographic map of a digital image. Clearly, we can see on a screen all level lines of a digital image by simply zooming the image by a factor 2. This method, however, yields in a good quality image a dense set of lines, so that the structure of the topographic map is too rich to be apparent. Thus, we propose to de ne strategies for partial, but structured presentation of the topographic map. In contrast with edge maps, to a simpli ed topographic map is associated a simpli ed image, so that we can check by visual inspection whether the simpli cation is not excessive. The main objective of simplifying the topographic map for visual inspection is to single out basic objects, that is, level lines and junctions.

6.2.1 Removal of small connected components As a rst tool, related to denoising, permitting a good visualization of the topographic map, one can apply the Vincent-Serra algorithm [58]. This contrast invariant algorithm removes all connected extremal regions of the image whose area is less than a xed number of pixels. This can also be formalized in the Matheron theory as an opening with all connected sets with area less than a threshold, followed by a closing with the same set of structuring elements (see [45] [46]). As a consequence of this operation, it can be checked in experiments that the topographic map becomes readable, a tipical area threshold being between 10 and 30 according to the image size. 18

Image 4.1

Image 4.2

Image 5.1 Image 5.2 Figure 4: Choice of the parameters and examples of Junctions. Image 4.1 displays the result of the Junction Detection Algorithm applied to Image 2.2 with area threshold n = 40 and grey level threshold b = 2 with (in white) small "T"s indicating locations of detected junctions. Image 4.2 displays the same experiment but using an area threshold n = 100. We can compare these two results on the same image and we can see the e ects on the number of junctions found. Image 5.1 is the result of the application of the Junction Detection Algorithm with an area threshold n = 40 and grey level threshold b = 2. The same parameters are used for SPOT Image 5.2.

19

6.2.2 Quantization Another way to make the topographic map readable is to take advantage of the redundancy of the topographic map, particularly on edges, where level lines accumulate. Presenting all level lines with levels multiples of a xed amount, say 10, will preserve all edges whose contrast is larger than 10. It must be emphasized, however, that we do not pretend that the removed information in the above processes is irrelevant. We simply take advantage of the possibility o ered by the topographic representation of a partial, coherent view of the image structure.

6.3 Conclusions

We have shown that a basic structure of an image u invariant to local contrast changes, is given by its topographic map. Its 'atoms' are the junctions and the pieces of level lines joining them. The topographic map has several structural properties, not true for other image descriptions: 1. It contains all the image information, with an obvious reconstruction algorithm, provided we keep the level and orientation of each level line. 2. It needs no scale space, that is, no additional scale parameter. By this, we mean that level lines are, like edges attend to be, global structures and require no parameter for their computations. If we intend to simplify the image, in the scale space sense, that is the removal of small details, this can be performed, as indicated in Section 6, by removing small level lines, in which case a scale parameter is introduced. The need for a more classical scale space can arise when we wish to smooth each level line as well. This is possible by using curve scale spaces ([37], [3], [55], [56], who use variants ot the Osher-Sethian curve evolution computational theory.) From the viewpoint adopted in [10], and further on in [41], image scale space is performed separately on each level line of the image. 3. In contrast with "edges", level lines need no connectedness algorithm to be computed : they are immediately connected curves. The question must be raised, of how the topographic map can help to get back to the physical structure of underlying objects. As far as shape recognition is concerned, it must be emphasised that pieces of level lines between junctions perform an easy to compute grouping which can be used for shape recognition, in the same way as edges are. 4. Its structure is preserved under standard digitization processes.

7 Discussion The mathematical discussion of the stability of level lines and junctions performed in Sections 5.1 and 5.2 by no means pretends to lead to a detection theory. It only proves that under certain conditions of contrast and size of the regions in the analogous image, the level lines and junctions will be preserved in the digitization process. Now, we do not exclude the creation of spurious level lines and junctions due to the digitization process. As noticed by the second, anonymous reviewer, the de nition of junction corresponds to the conjunction of multiple conditions, some of which are introduced to guarantee the existence of intensity relationships (the 's and 's) that persist over a neighborhood given some erosion. This is analogous, in a sense, to the more recent attempts to de ne nonlinear edge detectors (see e.g. [32]). Between the rst submission of this paper and the nal revision, three years have transcurred, and this has the main advantage of having given time to several technological developments. It had to be demonstrated that the local contrast invariant structure given by the topographic map can be used in applications. The rst obvious idea has been to use it for the comparison of images taken at di erent times and under di erent illumination or weather conditions. This is performed in [6] on satellite images. The idea is to compare all connected components of level sets in both 20

Image 6.1

Image 6.2

Image 6.3

Image 6.4

Image 6.5 Image 6.6 Figure 5: Image 6.1 is Image 2.1 in which we have removed all connected components whose area is less than 80 pixels. Image 6.2 displays the level lines of Image 6.1 which are multiples of 20. Image 6.3 is the original image and Image 6.4 shows the Image 6.3 after removing all connected components of area less than 100 pixels. Image 6.5 and Image 6.6 display the level lines of Image 6.3 and Image 6.4, respectively, which are multiples of 30.

21

Image 7.1

Image 7.2

Image 7.3

Image 7.4 Image 7.5 Figure 6: Image 7.1 is the original image and in Image 7.2 is Image 7.1 after removing all connected components whose area is less than 80 pixels. Image 7.3 shows the level lines of Image 7.2 which are multiples of 20. Image 7.4 is Image 2.2 after removing all connected components of area less than 40 pixels. Image 7.5 displays the level lines of Image 7.4 which are multiples of 10. We note that we can compare this last image with Image 2.5 which gives us the level lines multiples of 10 for the original image. 22

images and, more generally, all "sections", that is, connected components of bilevel sets [  u  ], ;  2 IR. Thanks to this algorithm, images of the same scene with very di erent radiometry can be compared and it has been experimentally shown that they have many parts of their topographic maps in common. In addition, the complete description given by a topographic map permitting reconstruction, the comparison algorithm also yields an intersection image, that is, an image having roughly for topographic map the intersection of topographic maps of both compared images. A further extension of this idea is performed in P. Monasse, who uses Jordan curves of the topographic map of two views in order to perform registration. P. Monasse and F. Guichard have proposed a Fast Level Set Transform in [49], which de nes the topographic map as a tree of Jordan curves. All operations mentionned above (intersection, registration, Vincent-Serra lters, etc.) can be performed in "real time" thanks to the FLST. Simon Masnou uses the topographic map in order to perform disocclusion, that is, a reconnection of level lines arriving to junctions bounding a spot in the image [45]. In a forthcoming paper, Jacques Froment uses explicitly the level-lines-junctions as described in this paper to propose a structured compression algorithm which selects the most signi cant part of the topographic map and also uses the possibility o ered of reconstructing an image from a part of a topographic map. Acknowledgement: We gratefully acknowledge partial support by DGICYT project, reference PB941174, by european project PAVR, reference ERB FMRX-CT96-0036, the TMR European project Viscosity Solutions and their Applications and Centre National d'Etudes Spatiales (CNES).

8 Appendix: The upper topographic map

Proposition 2 Let u : ! IR be a measurable function and let v(x) = h(x; u(x)), x 2 , be a local representative of u. Let fX :  2 IRg, resp. fY :  2 IRg, be the families of upper level sets of u, resp. of v. Then i) v(x) = supfh(x; ) : x 2 X g, a.e. in . ii) v is a measurable function. iii) Let  2 IR and  = h(x; ). Then cc(X ; x)  cc(Y ; x). iv) Let  2 IR, x 2 Y . Then there is  2 IR such that either cc(Y ; x) = cc(X ; x) or cc(Y ; x) = cc^ (X ; x).

Conditions H 1; H 2; H 3 in De nition 5 permit that local contrast changes preserve measurability :

Lemma 5 Let u : ! IR be a measurable function and f :  IR ! IR be such that i) f (x; :) is measurable as a function of x for almost all  2 IR. ii) f (x; :) is upper semicontinuous at u(x) for almost all x 2 . iii) f (x; ) is nondecreasing as a function of  for almost all x 2 . Then the function v(x) = f (x; u(x)) also is measurable.

Proof. Recall that a function v(x) is measurable if and only if for every  2 IR the level sets [x : v(x)  ] are Lebesgue measurable. Recall also that countable unions and intersections of measurable sets are measurable. Now [x : v(x)  ] = [x : f (x; u(x))  ]. Let us choose a dense sequence (bk )k2IN in IR such that f (:; bk ) are measurable. Let  be the set of points x 2 such that f (x; :) is nondecreasing and upper semicontinuous at u(x). By assumption, LN ( n ) = 0. If x 2 , since f (x; :) is upper semicontinuous at r = u(x), we have that f (x; r)   if and only if for all n 2 IN , 23

there exist k 2 IN such that r  bk and f (x; bk )   + n1 . Thus,

[x : v(x)  ] \  = [x 2  : 8n; 9k; bk  u(x) and f (x; bk )   + n1 ] = \ [ ([x : u(x)  b ] \ [x : f (x; b )   + 1 ] \ ): n k

k

k

n

Thus v is measurable.

Lemma 6 Under the conditions and notations of De nition 5, let ;  2 IR be such that   h(x; ). Then cc(X ; x)  cc(Y ; x). Proof. Without loss of generality, we may assume that cc(X ; x) =6 ;. Let y 2 cc(X ; x). Then, using H 4), v(y) = h(y; u(y))  h(y; ) = h(x; )  . Therefore, cc(X ; x)  cc(Y ; x). Lemma 7 i) If h(x; ) < hr (x; ), x 2 X , then cc(Y ; x) = cc(Yh x; ; x) for all  2 (h(x; ); hr (x; )]. ii) If h(x; ) <   hr (x; ), where  is chosen as in H 6), then cc^ (X ; x)  cc(Y ; x)  cc(X ; x). r(

)

iii) Either cc(Yh(x;) ; x) = cc^ (X ; x) or cc(Yh(x;) ; x) = cc(Yh (x;); x). r

Proof. i) Let h(x; ) <   hr (x; ). Then cc(Yh x; ; x)  cc(Y ; x). Let y 2 cc(Y ; x). Using H 7), v(y)  hr (x; ). Thus, cc(Y ; x)  Yh x; and, therefore, cc(Y ; x)  cc(Yh x; ; x). ii) Let h(x; ) < . If y 2 cc(Y ; x) and u(y) < , then, using H 6), we have   v(y) = h(y; u(y))  hl (y; ) = hl (x; )  h(x; ) < . This contradiction proves that cc(Y ; x)  X . Hence cc(Y ; x)  cc(X ; x). Now,   hr (x; )  h(x; 0), for all 0  . Using Lemma 6, we conclude that cc^ (X ; x)  r(

r(

)

)

r(

)

cc(Y ; x). iii) By ii), we know that cc^ (X ; x)  cc(Yh(x;) ; x). Either we have equality or strict inclusion. In the second case, using H 8), we conclude that cc(Yh(x;) ; x)  cc(Yh (x;); x). Since the opposite inclusion r

always holds, we have equality.

Proof of Proposition 1. i) If x 2 X ,  2 IR, then u(x)   and v(x) = h(x; u(x))  h(x; ). Hence, v(x)  supfh(x; ) : x 2 Xg. Now, since x 2 Xu(x) for all x 2 , then supfh(x; ) : x 2 X g  h(x; u(x)) = v(x). Both inequalities prove i). ii) is a direct consequence of Lemma 5. iii) Let y 2 cc(X ; x). Then u(y)  , and, using H 4), we have h(x; ) = h(y; ). Thus  = h(x; ) = h(y; )  h(y; u(y)) = v(y). Then cc(X ; x)  Y. Hence cc(X ; x)  cc(Y ; x). iv) Let  2 IR, x 2 Y . According to H 5) and H 6) there is  2 IR such that hl (x; )    hr (x; ), x 2 X , and satis es H 6). We consider several cases. Case 1) hl (x; ) <   h(x; ). By Lemma 6, cc(X ; x)  cc(Y ; x). Let y 2 cc(Y ; x) n cc(X ; x) such that u(y) < . Then, using H 6),   v(y) = h(y; u(y))  hl (y; ) = hl (x; ) < , a contradiction. Thus, in this case, cc(Y ; x) = cc(X ; x). Case 2) hl (x; ) = . Since   h(x; ), by Lemma 6, we have cc(X ; x)  cc(Y ; x). Let a = inf f0   : hl (x; 0) = hl (x; )g. Suppose rst that a = . Then, for all 0 < , we have hl (x; 0) < hl (x; )g. Let y 2 cc(Y ; x) n cc(X ; x) such that u(y) < , and let u(y) < 0 < . Then, using H 6),   v(y) = h(y; u(y))  hl (y; 0) = hl (x; 0) < hl (x; ) = . This contradiction proves that cc(Y ; x) = cc(X ; x). Suppose that a <  and hl (x; a) = hl (x; ) =   h(x; a). By Lemma 6, cc(Xa ; x)  cc(Y ; x). Let y 2 cc(Y ; x) n cc(Xa ; x) such that u(y) < a, and let u(y) < 0 < a. Then hl (x; 0) < hl (x; a) =  and   v(y) = h(y; u(y))  hl (y; 0) = hl (x; 0) < . This contradiction proves that cc(Y ; x) = cc(Xa ; x). Finally, we consider the case where a <  and hl (x; a) < hl (x; ) = . Since  = h(x; 0) for all 0 2 (a; ), then hr (x; a) =  and we are in the situation hl (x; a) <  = hr (x; a). If h(x; a) = hr (x; a) we are in case 1) and we conclude that cc(Y ; x) = cc(Xa ; x). We are nally left with the situation h(x; a) <  = hr (x; a) which we shall consider in the next case. Observe that a <  and then, by H 6), we have that hl (y; 0) = hl (x; 0) for all 0  a. 24

Case 3) h(x; ) <   hr (x; ). By Lemma 7, we have that either cc(Y ; x) = cc^ (X ; x) or cc(Y ; x) = cc(Yhr (x;); x) for all  2 [h(x; ); hr (x; )]. In this second case, using Lemmas 6 and 7, we have cc(X ; x)  cc(Yh(x;) ; x) = cc(Y ; x)  cc(X ; x), i.e., cc(Y ; x) = cc(X ; x).

De nition 9 Let u : ! IR be a measurable function. We say that a level  2 IR is not critical if X is a countable union of connected components, modulo a null set. Otherwise, we say that  2 IR is a critical level.

Theorem 2 Let u; v : IRN ! IR be two bounded measurable functions and let X , respectively Y ,

be the families of their level sets. Assume that the sets of critical levels of u and v are of measure zero. Assume that for any  2 IR and x 2 Y there is  2 IR such that either cc(Y ; x) = cc(X ; x) or cc(Y ; x) = cc^ (X ; x). Then there exists a local contrast change h(x; ) such that v(x) = h(x; u(x)).

Given A; B  IRN , we shall write A  B (mod LN ) if LN (A n B ) = 0 and A = B (mod LN ) if A  B (mod LN ) and B  A (mod LN ).

Proof. Suppose that u : ! [a; b], v : ! [c; d]. For each x 2 ,  2 IR, we de ne H (x; ) = f 2 IR : cc(Y ; x)  cc(X0 ; x) = 6 ; for some 0  g;

(31)

and

h(x; ) = sup H (x; ): Observe that (?1; c)  H (x; ), for all (x; ) 2  IR. Hence h(x; ) is well de ned. Step 1. We prove that v(x) = h(x; u(x)). Let  2 H (x; u(x)) and let   u(x) be such that cc(Y ; x)  cc(X ; x) 3 x. Hence, v(x)  . Thus h(x; u(x)) = sup H (x; u(x))  v(x). Let  = v(x). Then cc(Y ; x) 6= ;. By assumption, there is  2 IR such that either cc(Y ; x) = cc(X ; x) or cc(Y ; x) = cc^ (X ; x). In both cases, we obtain cc(X ; x) = 6 ; and, therefore, u(x)  . Hence  2 H (x; u(x)). As a consequence, we have v(x) =   h(x; u(x)). Step 2. h(x; :) is nondecreasing for all x 2 . This follows from the fact that H (x; 1 )  H (x; 2) for all 1  2. Step 3. h(x; :) is upper semicontinuous at u(x) for almost all x 2 . By Step 2, limn h(x; n )  h(x; ), if n % . Let n & u(x). Suppose that limn h(x; n) = ` > h(x; u(x)). Let  be such that h(x; n) >  > h(x; u(x)) for all n. Thus, for each n, there is 0n  n such that cc(Y ; x)  cc(X0 ; x) = 6 ;. 0 Hence u(x)  n and  2 H (x; u(x)). We obtain that   h(x; u(x)), a contradiction with our choice of . Step 4. We prove that h(:; ) is measurable, for almost all  2 IR. We recall that h(x; ) = supf 2 IR; cc(Y ; x)  cc(X ; x):g Let M  IR be a dense countable subset of noncritical values of v and   IR a dense countable subset of noncritical values of u. Then (h(x; ) > ) $ (9 2 M;  > ; 90 2  [ fg; cc(Y ; x)  cc(X ; x)): Thus [h(x; ) > ] is a countable union of sets of the kind E = fx; cc(Y ; x)  cc(X ; x)g; whereS and  are noncritical for v and u respectively. We can therefore writeS two countable unions, Y = j CYj , where the CYj are the connected components of Y and X = i CXi, where the CXi are the connected components of X . Thus [ CXi; E= n

i; 9j; CXi CYj

25

which is a measurable set as the CXi are. Step 5. It is immediate to check that if y 2 cc(X ; x), then H (x; ) = H (y; ). Hence h(x; ) = h(y; ). Step 6. Let  2 IR and x 2 Y. We prove that there is some  2 IR such that

hl (x; )    hr (x; ): (32) Suppose that cc(Y ; x) = cc(X ; x) for some  2 IR. In this case,  2 H (x; ), and, therefore,   h(x; )  hr (x; ). Let a = inf f0   : cc(X0 ; x) = cc(X ; x)g. Let 0 < a. If  2 H (x; 0), then there is   0 such that cc(Y ; x)  cc(X ; x)  cc(X0 ; x). Since cc(X0 ; x)  cc(Y ; x) and we do not have equality, we have a contradiction. Hence  62 H (x; 0). We conclude that h(x; 0)   for all 0 < a and, therefore, hl (x; a)  . If a < , we have that cc(Y ; x) = cc(X0 ; x); for all a < 0  . (33) Thus,  2 H (x; 0) for all a < 0  . It follows that   hr (x; a). We have proved that if a < , then (32) holds with  = a. We also note that, as a consequence of (33), we have cc^ (Xa ; x) = cc(Y ; x). Suppose that a =  and let 0 < . As in last paragraph, we prove that  62 H (x; 0). Hence h(x; 0)   for all 0 < . We conclude that hl (x; )  . Since also   h(x; )  hr (x; ), then (32) holds with  = . Again, we note that cc(X ; x) = cc(Y ; x). Finally, if cc(Y ; x) = cc^ (X ; x) for some  2 IR, with a similar argument we prove that (32) holds with  = . Step 7. Let  2 IR and let  2 IR be the value obtained in last step satisfying (32) and either cc(X ; x) = cc(Y ; x) or cc^ (X ; x) = cc(Y ; x). Let y 2 cc(Y ; x). Then we have hl (x; 0 ) = hl (y; 0 ) for all 0  . (34) Indeed, it is immediate to see that in these circumstances we have H (x; 0 ) = H (y; 0 ) for all 0 < . This implies (34). Step 8. Let y 2 cc(Y ; x), x 2 X, be such that h(x; ) <   hr (x; ). Then we have v(y)  hr (x; ). First, let us prove that

cc(Y ; x) = cc^ (X ; x) for all h(x; ) <  < hr (x; ). (35) Let  > . Since  < h(x; ) there is some 0   such that cc(Y ; x)  cc(X0 ; x) 6= ;. If 0  , then  2 H (x; ) and, therefore,   h(x; ), a contradiction. Thus,  < 0  . This implies that cc(X0 ; x)  cc(Y ; x) for all 0 >  and, thus, cc^ (X ; x)  cc(Y ; x). Let 2 IR be such that either cc(Y ; x) = cc(X ; x) or cc(Y ; x) = cc^ (X ; x). Suppose that cc(Y ; x) = cc(X ; x). Observe that, if  , then  2 H (x; ), and, therefore,   h(x; ), a contradiction. Thus > . In that case, cc(X ; x)  cc^ (X ; x)  cc(Y ; x)  cc(X ; x): Thus

cc(Y ; x) = cc^ (X ; x)  cc(X ; x); the last inclusion being strict, since  > h(x; ). The same conclusion holds when cc(Y ; x) = cc^ (X ; x). >From (35) it follows that, v(y)  hr (x; ) for all y 2 cc(Y ; x). Step 9. Suppose that cc^ (X ; x)  cc(Yh(x;) ; x), the inclusion being strict, h(x; ) < hr (x; ) and y 2 cc(Yh(x;) ; x). Then we have v(y)  hr (x; ). Let h(x; ) <  < hr (x; ). Then cc(Y ; x)  cc(Yh(x;) ; x). If cc(Y ; x) = cc(Yh(x;) ; x), then v(y)   for all  2 (h(x; ); hr (x; )) since cc(Y ; x) = cc(Y ; x) for all such . Thus v(y)  hr (x; ). Suppose now that cc(Y ; x)  cc(Yh(x;) ; x), the inclusion being strict. Let  be such that h(x; ) <  < hr (x; ). 26

Let 0 > . Since  < h(x; 0), then there is   0 such that cc(X ; x)  cc(Y ; x). If    then  2 H (x; ) and, therefore,   h(x; ), a contradiction. Thus  <   0. Since this holds for all 0 >  we conclude that cc^ (X ; x)  cc(Y ; x) = cc(Y ; x), the inclusion being strict. Now, we prove that cc(X ; x)  cc(Y ; x): (36) Indeed, let 2 IR be such that either cc(Y ; x) = cc(X ; x) or cc(Y ; x) = cc^ (X ; x). Suppose that cc(Y ; x) = cc(X ; x). Then cc(X ; x)  cc^ (X ; x), the inclusion being strict. Hence   and, therefore, cc(X ; x)  cc(X ; x) = cc(Y ; x). We proceed in the same way in case that cc(Y ; x) = cc^ (X ; x). Now, from (36), it follows that  2 H (x; ) and, therefore, we obtain   h(x; ), a contradiction. We give some conditions which imply that the set of critical values is of measure zero.

Proposition 3 Let u : ! IR be a lower semicontinuous function. Let Zu be the set of critical values of u. Then Zu  f 2 IR : LN ([u = ]) > 0g. In particular, L (Zu ) = 0. Proof. Let  2 IR be a critical value of u. Let CC (X ) = fX : X is a connected component of X with LN (X ) > 0g; CC (X ) = fX : X is a connected component of X with LN (X ) = 0g: Let X = [X 2CC+ X X . Since X is a countable union of measurable sets, then it is measurable. Hence, X = X n X is also measurable. Since  is a critical value, we have LN (X ) > 0. Let Y 2 CC (X ). We know that Y  [u  ]. If p 2 Y is such that u(p) >  then, since u is lower semicontinuous, there is r > 0 such that B (p; r)  [u > ]. Since p 2 Y and Y is connected, then also B (p; r)  Y . Hence LN (Y ) > 0, a contradiction. We conclude that Y  [u = ] and, therefore, X  [u = ]. In particular, LN ([u = ]) > 0. Then L (Zu )  L (f 2 IR : LN ([u = ]) > 0g) = 0. (Indeed, the set f 2 IR; LN ([u = ]) > 0g is countable and has therefore zero Lebesgue measure). Corollary 2 Let u : ! IR be a function such that u = u almost everywhere, where u (x) = lim inf y!x u(y). Let Zu be the set of critical values of u. Then L (Zu ) = 0. Proof. Let Zu be the set of critical values of u . Let  62 Zu . Since u = u a.e., we have that [u  ] = [u  ] = [nX n (mod LN ) where X n are connected components of [u  ]. Since u  u, we have [u  ]  [u  ]. Thus, for each n, there is a connected component Y n of [u  ] such that X n  Y n . Then [u  ] = [nX n  [n Y n  [u  ] (mod LN ), i.e., [u  ] = [n Y n (mod LN ). Thus,  62 Zu . In other words, Zu  Zu . Since u is lower semicontinuous, by the last lemma, we have L (Zu )  L (Zu ) = 0. 1

+ 0

+

(

0

)

+

+

0

0

0

1

1

1

1

1

References [1] Ch.D. Aliprantis and K.C. Border, In nite Dimensional Analysis, Springer Verlag, 1994. [2] J. Alison Noble, Finding half boundaries and junctions in images, Image and Vision Computing, vol. 10, 4, May 1992. [3] L. Alvarez, F. Guichard, P. L. Lions, and J. M. Morel, Axioms and fundamental equations of image processing, Arch. Rational Mechanics and Anal. , 16, IX (1993), pp. 200-257. [4] L. Alvarez and J.M. Morel, Formalization and Computational Aspects of Image Analysis, Acta Numerica, 1994, Cambridge University Press. 27

[5] L. Alvarez and F. Morales, Ane Morphological Multiscale Analysis of Corners and Multiple Junctions, Ref 9402, August 1994, Dept. Informatica y Systemas, Universidad de Las Palmas de Gran Canaria. To appear in International Journal of Computer Vision. [6] C. Ballester, E. Cubero-Castan, M. Gonzalez and J.M. Morel, Contrast Invariant Image Intersection. Preprint. [7] D.J. Beymer Finding Junctions Using the Image Gradient, Computer Vision and Pattern Recognition, pp. 720-721, Lahaiana, maui, Hawai, June 3-6 1991. [8] K. Brunnstrom, T. Linderberg and J.O. Eklundh, Active Detection and Classi cation of Junctions by Foveation with a Head-Eye System Guided by the Scale-Space Primal Sketch, Technical Report ISRN KTH/NA/P-91/31, CVAP, Royal Institute of Technology, 1992. [9] J.F. Canny, A computational approach to edge detection IEEE Transactions on Pattern Analysis and Machine Intelligence, 8, 769-798, 1986. [10] V. Caselles, F. Catte, B. Coll and F. Dibos, A Geometric Model for Edge Detection Numerische Mathematik 66, 1-31, 1993. [11] V. Caselles, B. Coll and J.M. Morel, A Kanizsa programme, Preprint CEREMADE, Univ. Paris-Dauphine, 1995. [12] V. Caselles, B. Coll and J.M. Morel, Scale-space versus Topographic Map for natural images, Scale-space `97. Proc. First Conference on Scale Space, Utrecht. [13] V. Caselles, J.L. Lisani, J.M. Morel and G. Sapiro, Shape Preserving Local Histogram Modi cation., Technical Report HPL-97-58, April, 1997. Also in Proceedings ICIP-97, IEEE Press, 1997. [14] V. Caselles, J.M. Morel and C. Sbert, An Axiomatic Approach to Image Interpolation. IEEE Transactions on Image Processing, Special Issue on PDE's, Geometry Driven Di usion and Image Processing, vol. 7, No. 3, 376-386, 1998. [15] V. Caselles and J.M. Morel, The Connected Components of Plane Sets of Finite Perimeter. In preparation. [16] K.R. Castleman, Digital Image Processing. Prentice Hall, 1996. [17] G. Choquet, Topology, Academic Press, New York, 1966. [18] R. Deriche and T. Blaszka, Recovering and Characterizing Image Features Using and Ecient Model Based Approach, Proc. CVPR, June 1993, New York, pp. 530-535. [19] R. Deriche and G. Giraudon, A computational approach for corner and vertex detection, International Journal of Computer Vision, 10, 2. 101-124, 1993. [20] L. C. Evans and F. Gariepy, Lectures Notes on Measure Theory and Fine Properties of Functions, CRC Press, 1992. [21] J. Eatwell, M. Milgate and P. Newman (eds.), The New Palgrave, a Dictionnary of Economics, 4 volumes. The Macmillan Press Limited, 1994. [22] W. Fuchs, Experimentelle Untersuchungen ueber das simultane Hintereinandersehen auf der selben Sehrichtung, Zeitschrift fuer Psychologie, 91, 154-253, 1923. [23] L.M.J. Florack, The syntactical structure of scalar images, PhD thesis, University of Utrecht, The Netherlands, 1993. 28

[24] J. Froment et al., MegaWave, image processing environment, Ceremade, 1997. [25] J.P. Fitch, E.C. Coyle and N. C. Gallagher, Threshold decomposition of multi-dimensional ranked order operations, IEEE Trans. on Circuits and Systems, 5, 445-450, 1985. [26] B.M. ter Haar Romeny, Geometry-Driven Di usion in Computer Vision Kluwer Acad. Publ., 1994. [27] B.M. ter Haar Romeny, L.M.J. Florack, J.J. Koendering and M.A. Viergever Invariant ThirdOrder Properties of Isophotes: T-Junction Detection, Proc. Scandinavian Conference on Image Analysis, August, 13-16 1991. [28] R. M. Haralick and L. G. Shapiro, Computer and Robot Vision, I, Addison-Wesley, 1992. [29] E. Hecht and A. Zajac , Optica. Addison Wesley Iberoamericana, 1986. [30] F. Heitger and R. von der Heydt, A computational model of neural contour processing: Figureground segretation and illusory contours, 4th Proc. International Conference on Computer Vision, pp. 32-40, Berlin, Germany, May 1993. IEEE Computer Society Press. [31] C. Illueca, In uence of contrast of the recognition of defocused letters: a geometrical model, Vision Research, 1995. [32] L. A. Iverson and S.W. Zucker, Logical/Linear Operators for Image Curves, IEEE Trans. Pattern Anal. Machine Intell. vol. 17, No. 10, 982-996, 1995. [33] B. Julesz, Textons, the elements of texture perception, and their interactions, Nature, 290, 12 March 1981. [34] B. Julesz, Texton gradients: the texton theory revisited, Biological Cybernetics, 54, 245-251, 1986. [35] G. Kanizsa, Organization in Vision , N.Y. Praeger, 1979. [36] G. Kanizsa, Vedere e pensare , Il Mulino, Bologna, 1991. [37] B.B. Kimia, A. Tannenbaum, and S.W. Zucker, On the evolution of curves via a function of curvature, 1: the classical case, J. of Math. Analysis and Applications 163, No 2, 1992. [38] J.J. Koenderink, The structure of images, Biological Cybernetics, 50, 363-370, 1984. [39] Y.G. Leclerc and S.W. Zucker, The Local Structure of Image Discontinuities in One Dimension, PAMI-9, number 4, 1987. [40] T. Lindeberg, Junction detection with automatic selection of detection scales and localization scales, Proc. First Int. Conf. on Image Processing, Austin, Texas, Vol 1, 924-928, Nov. 1994. [41] R. Malladi, J. Sethian and B.C. Vemuri, Shape Modelling with Front Propagation: A level Set Approach. IEEE Transactions on PAMI, 17(2), 158-175, 1995. [42] J. Malik, Interpreting Line Drawings of Curved Objects, IJCV, vol. 1, 1987. [43] D. Marr, Vision, Freeman and Co., 1981. [44] S. Masnou and J.M. Morel, Restauration d'images et ltres de Yaroslarsky, Proc. Workshop GRETSI 97, Grenoble, France 97. [45] S. Masnou and J.M. Morel, Level lines based disocclusion. Proc. IEEE ICIP'98, Chicago, USA, Vol. III, pp. 259-263, 1998. 29

[46] S. Masnou and J.M. Morel, Image restoration involving connectedness To appear in proc. of Workshop "Digital Image Processing", Vienna, Austria 1997, SPIE, Vol. 3346, January 1998. [47] G. Matheron, Random Sets and Integral Geometry, John Wiley, N.Y., 1975. [48] J.M. Morel and S. Solimini, Variational methods in image processing, Birkhauser, 1994. [49] P. Monasse and F. Guichard, Fast Computation of a Contrast Invariant Image Representation, Cahiers de l'ENS Cachan, 9815, 1998. [50] M. Nitzberg and D.Mumford, The 2.1 Sketch, Proceedings of the Third International Conference on Computer Vision, Osaka 1990. [51] M. Nitzberg, D.Mumford and T. Shiota, Filtering, Segmentation and Depth, Lecture Notes in Computer Science, 662, Springer-Verlag 1993. [52] S. Osher and J. Sethian , Fronts propagating with curvature dependent speed: algorithms based on the Hamilton-Jacobi formulation, J. Comp. Physics 79, 12{49, 1988. [53] L.I. Rudin, Images, numerical analysis of singularities and shock lters. PhD dissertation, Caltech, Pasadena , California n5250:TR, 1987. [54] L.I. Rudin, S. Osher and E. Fatemi, Nonlinear Total Variation Based Noise Removal Algorithms. Physica D, 60:259-269, 1992. [55] G. Sapiro and A. Tannenbaum, On ane plane curve evolution, Journal of Functional Analysis, 119, 1, 79-120, 1994. [56] G. Sapiro and A. Tannenbaum, Ane Invariant Scale Space, The International Journal of Computer Vision, 11 (1), 25-44, 1993. [57] J. Serra, Image Analysis and Mathematical Morphology. Academic Press, 1982. [58] L. Vincent, Grayscale area openings and closings, their ecient implementation and applications. First Workshop on Mathematical Morphology and its Applications to Signal Processing. J. Serra and Ph. Salembier, editors. pp. 22-27, Barcelona, Spain, May 1993. [59] M. Wertheimer, Untersuchungen zur Lehre der Gestalt, II Psychologische Forschung, 4, 301-350, 1923. [60] A.P. Witkin, Scale-space ltering, Proc. of IJCAI, Karlsruhe 1983, 1019-1021.

30