In this paper we ‘localize’ the global notions of compensated convex transforms, first introduced in [28, 29], by defining such transforms over bounded convex closed domains in so that their values in the domain agree with the globally defined transforms applied to some special extensions of the function to . The motivation for such local definitions is mainly from applications to digital images and data arrays, where we have to consider functions defined on a rectangular box.
The theory of compensated convexity transforms has been applied to, for example, digital image processing and computational geometry. So far, applications of the theory include the design of multiscale, parametrized, geometric singularity extraction of ridges, valleys and edges from graphs of functions and from characteristic functions of closed sets in. Several robust methods have been developed to date, namely, for the extraction of the set of intersections between two or more smooth compact manifolds [31, 34]; for the extraction of the multiscale medial axis from geometric objects 
, and for the interpolation and approximation of sampled functions. By ‘robustness’ here we mean the Hausdorff stability, that is, the error between the outputs obtained from two data samples is controlled by the Hausdorff distance between the two sampled input data sets.
In the applications mentioned above, the data domains are usually represented by boxes in . The numerical schemes used in [30, 31, 32, 33, 34] for the evaluation of the compensated convex transforms relied on the availability of schemes for computing the convex envelope of a given function and on the implicit assumption that the transforms coincide with the function at the boundary of the data domain. Such schemes were used to demonstrate the numerical feasibility of the transforms rather than (i) designing efficient numerical schemes that compute them and/or (ii) analysing the effect of the boundary assumptions. In this paper we address the more practical question of accurately and effectively computing the compensated convex transforms for functions defined on a bounded convex domain without using numerical schemes that compute the convex envelope. In order to do so, we will explore the alternative definitions of the compensated convex transforms based on the Moreau envelopes. One of the advantages of this approach is that when it comes to the numerical implementation by the scheme we propose, we obtain an estimate of the number of iterations which provides the exact discrete Moreau envelope. This is different from the application of iterative schemes to compute the convex envelope which can be shown to converge but for which no convergence rate is known to be available .
Before we introduce our local versions of compensated convex transforms on a bounded closed convex domain, we recall from  the notions of quadratic compensated convex convex transforms in . For a function satisfying the growth condition , , for some constants , and the Euclidean norm of , the quadratic lower compensated convex transform (lower transform for short) of for is defined for by ,
where is the convex envelope of the function bounded below. Given such that , , the quadratic upper compensated convex transform (upper transform for short) of of module is defined for by
where, in our notation,
In mathematical morphology [24, 27, 25], the Moreau lower and upper envelopes can be viewed as ‘greyscale’ erosions and dilations by quadratic structuring elements [3, 13], respectively, thus it is possible to offer an alternative interpretation of the transforms (1.3) as ‘one-step’ morphological openings and closings .
Note that (1.1), (1.2) and their alternative representations (1.3) are given for extended real valued functions. They can thus be applied to functions , defined in proper subsets of by defining an extension of to be or in , as is common practice in convex analysis. However, such natural and direct definitions of local compensated convex transforms for functions defined in using (1.3) depend on values of the Moreau envelope at points outside the domain , while convex envelope based methods using (1.1) or (1.2) will rely on convex envelope based schemes which, as far as we know, are neither efficient nor accurate.
These problems lead us to design the following simple local compensated convex transforms based on the mixed Moreau envelope definitions (1.3) of the compensated convex transforms without the need of calculating values of the Moreau envelopes outside the bounded closed domain . Before introducing our local transforms, we introduce some notation and recall some definitions.
Let be a non-empty bounded open convex subset of . We consider bounded functions satisfying in for some constants . Without loss of generality, and if not otherwise specified, we set and and define the oscillation of in by
We consider the auxiliary functions, and that extend from to its closure ,
and the auxiliary functions and that extend from to the whole space ,
In practice, the extensions , of to the boundary correspond to adding a frame of one pixel wide layer on the boundary of the data array and defining at each point of the frame by the maximum value or the minimum value of the function.
For the function and we then consider the following transformations which are well defined for ,
and their characterization (1.3) in terms of the critical mixed Moreau envelopes:
For a bounded function defined in the closure of a convex bounded open set , we also introduce for the notation and to denote the following inf- and sup-convolutions of with quadratic weights,
which coincide with the restriction to of and , respectively, where
Motivated by the characterization (1.3) for compensated convex transforms, we now define the local lower compensanted convex transform of in , as
and the local upper compensanted convex transform of in , as
An important feature of the special extensions , , , of functions to and to is that we have, for that
It is easy to see that equalities (1.13) do not hold, in general, if we consider and [respect. and ]. While our extensions can make the local versions equals to the global ones, the infinity versions would not have this property.
After this brief introduction, in the next Section we present background results on convex analysis and the theory of compensated convex transforms. The main theoretical results are stated in Section 3. Here, we state that if is a bounded convex open set and a bounded function, then for any (see Theorem 3.1)
Furthermore, we also find that there exists a constant which depends on and such that at the points with , the values of and depend only on the values of on . For the special case of the characteristic function of a compact set , which represents ‘geometric shapes’ (binary data), we use the natural and simple extension defined in (3.9), which is the restriction of the characteristic function to , and itself, rather than the extensions defined in (1.5), (1.6), respectively. Under the condition that , we establish (see also the remarks about Theorem 3.7 below). We present in Section 4 an algorithm that allows the numerical realization of the Moreau envelope, whereas Section 5 contains numerical experiments which illustrate how to apply our theoretical findings to carry out, for instance, image processing and computational geometry tasks. As examples, we discuss the finding of ridges in the graph of a function, image inpainting, and intersections of curves in a plane. The paper concludes with Section 6 which contains the proofs of the main results.
2 Notation and Preliminaries
This section presents a brief overview of some basic results in convex analysis and the theory of compensated convex transforms that will be used in the sequel for the proof of the main results; for a comprehensive account of convex analysis, refer to Refs. [11, 22], and to Refs. [28, 30] for an account of the theory of compensated convex transforms.
Let be coercive in the sense that as , and . Then
The value of the convex envelope of at is given by
If, in addition, is lower semicontinuous, then the infimum is attained, that is, for some there are , for , satisfying and such that the points , , lie in the intersection of a supporting plane of the epigraph of , , and , and
The value , for taking only finite values, can also be obtained as follows:
with the attained by an affine function if is lower semicontinuous.
We will also introduce the following local version of convex envelope at a point.
Let and . Denote by the open ball centered at with radius , and by the corresponding closed ball. Suppose is a bounded function in . Then the value of the local convex envelope of at in is defined by
If is lower semicontinuous, then by using the second part of Proposition 2.1, we see that the infimum is attained in . This means that for some there are , such that for , satisfying , and
thus, in this case, depends only on the values of in .
We recall also the following ordering properties for compensated convex transforms which can be found in Ref. ,
whereas for in , we have that
(Translation invariance property) For any bounded below and for any affine function , . Consequently, both and are translation invariant against the weight function, that is
for all and for every fixed . In particular, at , we have
For both theoretical and numerical developments, the following property on the locality of the compensated convex transforms for Lipschitz functions and bounded functions plays a fundamental role. The result for bounded functions is a slight modification of the locality property stated in Theorem 3.10, Ref. . For a locally bounded function , we define the upper and the lower semi-continuous closure and [11, 22], respectively, by
We have the following result,
Suppose is bounded. Let and . Then the following locality properties hold:
with . If is Lipschitz continuous with Lipschitz constant , then .
The values of given here have improved upon those obtained in Theorem 3.10, Ref. .
By Remark 2.3, we have
for some , , for , satisfying , and
for all . Similar conclusion can be drawn for .
Next we state the locality properties for the Moreau envelopes.
If is bounded, then for any fixed , if satisfy
If is a Lipschitz function with Lipschitz constant . Then for any fixed , if satisfy
For completeness, we recall the following relationship between the lower and upper Moreau envelope and the lower and upper compensated convex transform given by
Next we recall from  the definition of modulus of continuity of a function along with some of its properties.
Let be a bounded and uniformly continuous function in . Then,
is called the modulus of continuity of .
Let be a bounded and uniformly continuous function in . Then the modulus of continuity of satisfies the following properties:
A function defined on and satisfying (2.16) is called a modulus of continuity. A modulus of continuity can be bounded from above by an affine function (see Lemma 6.1 of Ref. ), that is, there exist some constants and such that
We conclude this Section by recalling the following definitions.
Let be a subset of . We define the distance of from as
the diameter of the set as
the indicator function of as the function defined in such that
and the characteristic function of as the function defined in such that
It is then not difficult to verify that for any
that is, is the inf-convolution of with , and is proportional to the lower Moreau envelope of with parameter .
3 Main Results
The main results given in this section consist of two parts. In the first part, we establish the relationship between the local Moreau envelopes of (1.5) and the global Moreau envelopes of (1.6), and between the corresponding mixed Moreau envelopes. This relationship is a consequence of the type of auxiliary functions under consideration. In the second part, we give conditions that ensure that the local Moreau envelopes and the corresponding mixed Moreau envelopes depend only on the local values of . The precise meaning of this statement will be specified for each result. Next we consider the case of a bounded function defined on a bounded domain .
Let be a bounded open set and a bounded function. Consider the extensions and given by (1.5a) and (1.6a), respectively, and the extensions and given by (1.5b) and (1.6b), respectively. Then, for any ,
Consequently, for any ,
Furthermore, we have the following locality results:
If is such that and there is such that
then [resp. ] is determined by values of on , in the sense that .
If is such that and there is a such that
then [resp. ] is determined by values of on , in the sense that where .
The locality properties of Theorem 3.1 state that under the conditions and on , respectively, the values of [resp. ] depend on the values of on . This means that the values of [resp. ] are not influenced by the values of we defined on when we define [resp. ]. We express this by saying that [resp. ] is not affected by boundary values.
As an application of Theorem 3.1 we next consider the case where is the squared Euclidean distance to a closed set. The following two results are useful, for instance, when we need to compute the multiscale medial axis map . Let be a nonempty closed set, the quadratic multiscale medial axis map of with scale is defined in [32, Definition 3.1] for by
Next we describe how can be expressed in terms of the local lower transform. The first result can be applied to find the multiscale medial axis map of the set , where is an open subset of and a compact set.
Let be an open set and a non-empty compact set. Let for and be defined by (1.5a). Then for ,
Equation (3.7) actually gives for any given that for .
The next result, on the other hand, applies when we need to define the multiscale medial axis map
of an open set