Image Anal Stereol 2011;30:63-76 Review article GENERALIZED FRACTAL TRANSFORMS AND SELF-SIMILARITY: RECENT RESULTS AND APPLICATIONS Davide La Torre^ and Edward R. Vrscay^ ^Department of Economics, Business and Statistics, University of Milan, Italy; ^Department of Applied Mathematics, University of Waterloo, Waterloo, Ontario, Canada N2L 3G1 e-mail: davide.latorre@unimi.it, ervrscay@uwaterloo.ca (Accepted June 7, 2011) ABSTRACT Most practical as well as theoretical works in image processing and mathematical imaging consider images as real-valued functions, u : X ^ R^, where X denotes the base space or pixel space over which the images are defined and r^ C m is a suitable greyscale space. a variety of function spaces .^{X) may be considered depending on the apphcation. Fractal image coding seeks to approximate an image function as a union of spatially-contracted and grey scale-modified copies of subsets of itself, i.e., u« Tu, where T is the so-called Generalized Fractal Transform (GFT) operator The aim of this paper is to show some recent developments of the theoiy of generahzed fractal transforms and how they can be used for the purpose of image analysis (compression, denoising). This includes the formulation of fractal transforms over various spaces of multifunctions, i.e., set-valued and measure-valued functions. The latter may be useful in nonlocal image processing. Keywords: fractal transforms, iterated function systems, measure-valued functions, multifunctions, nonlocal image processing, self-similarity. INTRODUCTION In his classic work. The Fractal Geometry oT Nature, Mandelbrot (1977) presented the first description, along with an extensive catalog, of selT-slmllar sets, namely, sets that may be expressed as unions of contracted copies of themselves. He called these sets "fractals," because their (fractional) Hausdorff-Besicovitch dimensions exceeded their (integer-valued) topological dimensions. The ternary Cantor set and the von Koch "snowflake curve" are two of the most famous examples of such sets. Hutchinson (1981) and, shortly thereafter, Bamsley and Demko (1985) showed how systems of contractive maps with associated probabilities, referred to as "iterated fiinction systems" (IPS) by the latter, can be used to construct fractal, self-similar sets and measures. These sets and measures are attractive fixed points of Tractal transTorm operators. (We shall briefly review IPS in the next section.) But Bamsley and Demko were the first to see the potential of using IPS for the purpose of approximation-. Given a "target" self-similar set (or measure), say 5, find an IPS fractal transform operator T with fixed point 5 that is as close as possible to 5. More on this below. The formulation of IPS-type methods over various complete metric spaces has been an ongoing research programme. It involves the construction of appropriate IPS-type operators, or generalized Tractal transTorms (GPT), over these spaces, including various fianction spaces and distributions (Cabrelli ez-aZ, 1992; Porte and Vrscay, 1998a;b), vector-valued measures (Mendivil and Vrscay, 2002), integral transforms (Porte e? a/., 1999), wavelet transforms (Mendivil and Vrscay, 1997; Vrscay, 1998). More recently, we have formulated GPTs over set-valued fianctions and measures, i.e., multifianctions, e.g., Kunze e?a/. (2007; 2008); La Torre and Mendivil (2008); La Torre e? a/. (2009a;b); La Torre and Mendivil (2009). The action of a generalized fractal transform T : on an element u of the complete metric space {ß^{X),d) can be summarized in the following steps: 1. It first produces a set of N spatially-contracted copies of u. 2. It then modifies the values of these copies by means of a suitable range-mapping. 3. Pinally, it recombines these altered copies by means of an operator appropriate to the space to produce the element ve i.e., v = Tu. Under conditions appropriate for each space, the generalized fractal transform T is a contraction mapping which, by Banach's fixed point theorem, guarantees the existence of a unique fixed point u = TU. Most practical as well as theoretical works in image processing and mathematical imaging consider images as real-valued functions. There are, however, situations in which it is useful to consider the greyscale value of an image u at a point x as a random variable that can assume a range of values R^ C M. This is an example of a multifunction representation of image functions. But it is often not enough to simply know the greyscale values that may be assumed by an image u at a point x. one must also have an idea of the probabilities (or frequencies) of these values. As such, it may be more useful to represent images by measure-valued functions, for example, ß ^{Rg), where ^{Rg) is the set of probability measures supported on Rg (La Torre et af, 2009b). This is another example of multifiinction representation of an image. Later in this paper, we outline this formulation along with an appropriate class of fractal transforms acting on this space. The IFS-based inverse problem, which has become important in a number of applications, may then be phrased as follows: Given a "target" element v e -^{X), find a (point-to-point) contraction mapping T : .^{X) ^ .^{X) with fixed point ü such that c/(v; u) is as small as possible. From a practical perspective, however, it is difiicult to construct solutions to this problem so one relies on the following simple consequence of Banach's fixed point theorem, known in the fractal coding literature as the Collage Theorem (BsmsXcy et af, 1985): Theorem 1 For any v G .^{X), where c is the contractivity factor ofT. (1) Instead of trying to minimize the error d{v,u), one looks for a contraction mapping T that minimizes the so-called collage error d{ v, Tv). As we shall describe below, this is the essence of fractal image coding (Fisher, 1995; Lu, 2003). However, this method of collage coding may be applied in other situations where contractive mappings are encountered. We have shown this to be the case for inverse problems involving differential equations. In the simplest case of ordinary differential equations, the contractive mapping is the Picard integral operators associated with the initial value problem (Kunze and Vrscay, 1999). At this point, it should be mentioned that in collage coding, the contractive (fractal) transform T is generally defined in terms of a finite set of parameters. In fractal image coding, this set is often referred to as the fractal code associated with the image. Solving the inverse problem using collage coding is based on the following continuity property of fixed points of contractive mappings (Centore and Vrscay, 1994): Theorem 2 Let {J^{X),d) be a complete metric space and Con{^ {X)) a set of contraction mappings T : .^{X) ^ .^{X). Let_Ti,T2 G_Con{.^{X)) with respective ßxed points, u\ and U2 and contraction factors ci and C2. Deßne the distance between T\ and Ti as follows, dconiX){TuT2)= sup d{71 U, T2u) . Then (l{ui,U2) < —--dcon{S^{X)){T\, T2) , ^ Qnin where c^m = min(ci ,02). ITERATED FUNCTION SYSTEMS (IPS) IFS: Here we briefly review the IFS formalism of Hutchinson (1981) and Bamsley and Demko (1985). In what follows, {X, d) denotes a compact metric "base space" (or "pixel space"), typically [0,1]". Let w = {ivi, • • • , wn} be a set of 1 -1 contraction maps Wj-.X^ X, to be referred to as an A'-map IFS. Let q G [0,1) denote the contraction factors of the Wi and define c = maxi0 such that IUti) - Hb)I < Kj\ti-t2\, for all ti,t2e R. In most application, the greyscale maps are assumed to be affine, i.e.. ({)i{t) = ait+ßi, (12) which automatically condition. satisfies the Lipschitz The above two sets of maps are said to comprise an "Iterated Function System with greyscale maps" (IFSM), denoted as (w, O) (Forte and Vrscay, 1998a). For each x G A', this IFSM produces one or more fractal components defined as 0, otherwise. If several fractal components exist for an x G X, then they are combined with an operation that is suitable for the space in which we are working (see Forte and Vrscay (1998a) for more details and examples of the various fianction spaces that can be considered). We usually consider the summation operator for .^{X) = LP{X), i.e., for a u G LP{X), the action of the fractal transform is given by n v{x) = {Tu){x) = J^gix) (13) i=i Theorem 5 (Forte and Vrscay, 1998a) Let (w, O) be an IFSM as deßned above, with spatial contractions Wi and Lipschitz greyscale maps (pj. Then for p> I andu,vGLP{X), Tu- Tv\\< Corollary 3 If c = w ley PR, i=i u— V (14) < 1, then T is contractive in LP{X) with fixed point u G LP{X). The fixed point equation. n i=l indicates that u is "self-similar," i.e., that it can be written as a sum of spatially-contracted and greyscale-modißed copies of itself Example: [0,1] and 3, with IFS maps / X 1 / X 1 1 / X 1 2 m (X) = -X, W2(X) = -X+-, W3(X) = -X+-, and associated (pi^ maps, (Note that in the I^-sense, the subsets Wi{X) may be considered as nonoverlapping.) The fixed-point Sanction u{x) of this IFSM is the famous "Devil's staircase fianction," sketched in Fig. 3 below. Clearly, ü{x) may be viewed as a union of three contracted copies of itself, with the middle copy being a "flattened" one. Fig. 3. "Devil's staircase function " on [0,1], It is also convenient to define IFSM operators with condensation functions. For example, given a set of IFS maps Wi, associated constants «y and condensation fianction b{x),xe X, define the action of the associated operator T as follows: For u^Ü{X), n v{x) = {Tu){x) = b{x) + Xaiu{w7\x)) . (15) i=i We now have the apparatus to consider the inverse problem of IFS-based approximation of Sanctions. In practice, one normally works with a fixed set of IFS maps Wi, I < i< N, and then finds the optimal associated greyscale maps - optimal in the sense that the collage distance || v— Tv\\ is minimized, where I'is the fianction to be approximated. This is the basis of fractal image coding, which we outline in the next section. LOCAL SELF-SIMILARITY AND BLOCK FRACTAL IMAGE CODING In practical applications, it is overly ambitious to expect that a signal or image will display the self-similarity property used above, i.e., that it can be well approximated as a union of spatially-contracted and range-modified copies of itself It is more reasonable to expect that a signal or image be locally self-similar, i.e., it may be well approximated as a union of spatially-contracted and range-modified copies of subsets of itself This is the basis of Jacquin's original fractal block coding method (Jacquin, 1989; 1992) which is also known as the local or partitioned IFS method (Bamsley and Hurd, 1993). We forego a formal mathematical discussion of this method and simply consider the particular case of fractal block coding of images. Here, subblocks of an image are approximated by contracted and greyscale-modified copies of other subblocks of the image. A very simple prescription for the fractal coding of an /3 x /3-pixel image u{x) is as follows. Let Rk, k = ,Nr, denote a set of hr x riR-pixel nonoverlapping range blocks that form a partition of the image. Let Dj, k = 1,2, • • • , Afe be a set of IriR x IriR-^hieX domain blocks that are selected from throughout the image. (In order to keep the size of the domain pool down, but at the expense of some accuracy, we may consider the set of nonoverlapping InR x 2/3;e-pixel blocks that cover the image.) For each range block, compute the collage errors Ajtj associated with all domain blocks, Dj, i.e., A,J = mm II u{R,) - au{Dj) -ß\\, J = 1,2,-■■ ,Nd. a,ß (16) Here, u{Dj) denotes the nR x nR-pixel block image obtained by "decimating" the InR x 2/3;e-pixel domain block image u{D]f). (For digital images, decimation is normally accomplished by replacing the image values over four neighbouring pixels that form a square in D]f by their average value placed on one pixel. Following the decimation, we may consider all eight possible isometries that map one block to another, i.e., four rotations and four reflections.) The block L'j(jt) yielding the lowest collage error Ajtj is chosen to be the domain block associated with Rj. The above procedure yields a fractal transform T which is defined in terms of the range-domain assignments {kj{k)) (along with isometries i{k) if applicable) and ^-map parameters a^^ßk- These parameters comprise the fractal code of the image u. The action of T may be expressed as follows: For each range block Rk,l 1 of the iteration procedure, each range block image u„,{Rk) of u„, supported on Rk is replaced by the affine scaled image akU„,{Dk) + ßk- The result of this procedure, as applied to the 512 x 512-pixel, 8 bit-per-pixel test image Boat, is shown in Fig. 4. Here, the range blocks Rk employed in the calculation were the 4096 nonoverlapping 8x8-pixel blocks of the image. The domain blocks D k used were the 1024 nonoverlapping 16 x 16-pixel blocks. The top left of the figure shows the original test image. Moving clockwise in the figure, the iterates u\ and U2 corresponding to the "seed" image uo = 0 (black) are shown. The lower left image is the fixed point u = uio corresponding to the fractal transform T. In this example, there was no attempt to perform any image compression. As such, the a and ß parameters were stored as real numbers to full machine precision, and not quantized according to any prescribed bit allocation. The so-called "PSNR value" of the fixed-point approximation, a measure of the accuracy of the approximation in terms of L^ error is roughly 25 dB. (The higher the PSNR, the lower the L^ error.) A better approximation to the test image, corresponding to a higher PSNR value, would be achieved if 4 x 4-pixel blocks were used for the range blocks Rk. For more detailed accounts of fractal coding, the reader is referred to Bamsley and Hurd (1993); Fisher (1995); Lu (2003). GENERALIZED TRANSFORMS Iterated Function Systems on Multifunctions: We now outline a simple IFS-type method on multifianctions, that is, set-valued functions. As a motivation, we suppose that to each pixel of an image is associated an interval which measures the "error" in the greyscale value at that pixel. For simplicity, we examine only the one-dimensional case where the base space is A' = [0,1]. The extension to higher dimensions is straightforward. Consider the space of multifianctions ß^ = {F : X Jf{Y)} and suppose that F{x) is a compact subinterval of F for all xGX.lt is quite straightforward to prove (La Torre et al., 2009a) that is a complete metric space with respect to the following metrics: cL(F,G)=supc4(F(x),G(x)) AreX and dp{F,G) = ( f dt{F{x),G{x))Pdß{x) \.Jx \ i/p y Fig. 4. Starting at upper left and moving clockwise: The original 512x512-pixel, 8 bit/pixel "Boat" test image. The iterates u\ and U2 along with the ßxed point u = u\q of the fractal transform operator T designed to approximate the test image. The "seed " image was uq =0 (black). where ß is the Lebesgue measure. A fractal transform operator on ^ may now be defined in terms of the following ingredients: 1. As before, a set of 1-1 contractive IFS maps, Wj: X^X, \ 0 are such that dix{wi{x)) < Sjdß{x). Example: In Fig. 5, approximations to the attractor multifimctions onX= [0,1] are plotted for two IFSMF with two contractive IFS maps Wj. The top image corresponds to the attractor for the following IFSMF: wi(x) = 0.6x, W2{x) = 0.6x+0A, ß{x) = [0.5,1.0]. «1 = 0.7, «2 = 0.5, piix)=0.5, pi{x)=0.5, (19) The bottom image corresponds to the attractor of the IFSMF with the same Wj maps and Uj and pi constants as above but with the following jS-function: iS« = [0,1], ß{x) = [0.5,1.5] 0 0, let C ^ be a complete subspace of ^ such that dniß, v) < M for all ju, v G . We now define Y = {fx: X ^ measurable} (26) and consider on this space the following metric C/HM,V)= / (27) J X We observe that dy is well defined, since ß and v are measurable fianctions, c/// is bounded and so the fianction ^ (x) = c///(/x(x), v(x)) is integrable on X. Theorem 9 (La Torre et al, 2009b) The space ( Y, dy) is complete. We now construct and analyze a fractal transform operator M on the space {Y^dy) of measure-valued fianctions. We list the ingredients for a fractal transform operator in the space Y. The reader will note that they form a kind of blending of IFS-based methods on measures (IFSP) and fianctions (IFSM). For simplicity, we assume that A'= [0,1]. The extension to [0,1]" is straightforward. 1. A set of A'^ one-to-one contraction affine maps Wi: X ^ X, wj{x) = SiX+ ai, with the condition that yjl,wix) = x. 2. A set of A'^ greyscale maps : assumed to be Lipschitz, i.e., for each i, there exists a «y > 0 such that I^Ih) - MWI < aj\ ti-t2l Mti, /2 G R^, (28) 3. For each x G A', a set of probabilities Pi{x), i = 1, • • • , A'^ with the following properties: - are measurable as functions of x - pi{x) = 0 if X ^ Wi{X) and - = 1 forallA-GX The action of the fractal transform operator M: Y ^Y defined by the above is as follows: For aß eV and any subset 5 c M^, n v{x){S) = {Mß{x)){S) = J^p,{x)ß{w7\xm7\S)). (29) i=i Theorem 10 (La Torre et al, 2009b) Let pi = Then forßi,ß2 G Y, / n \ dY{Mßi,Mß2)< J,\si\aiPi dyißußi). (30) / Corollary 4 Let pj = sup^^;^ pi{x). Then M is a contraction on (7, dy) if i=i (31) Consequently there exists a measure-valued mapping ß eY, such that ß = Mß. Examples: 1. The fractal transform M defined by the following two-IFS-map system onX= [0,1]: Wl{x) = ^x, W2{x) = hit) = The sets w\{X) and W2{X) overlap at the single point X = ^ so we let Pl{x) = \, P2ix)=0 Pl{x)=0, p2{x) = \ Pi (^) =/52(2) = 2 It is easy to confirm that Mis contractive. Its fixed point ß is given by ß{x) = 8{t-x), xG[0,l], (32) where 5 denotes the Dirac delta fianction. 2. A "perturbation" of the above fractal transform M that is produced by adding the following IPS and associated greyscale maps: The sets wi (X) and W3 (X) overlap over the entire subinterval [0, so we let pi{x) = pi{x) = -, p2{x) = 0 Pi{x) = pi{x) = Q, p2{x) = \ Once again, it is easy to confirm that M is contractive. Its fixed point ß{x) is sketched in Fig. 6. At this point, we mention that it is difficult to produce a sketch of the fixed point that will capture all of its detailed structure. First of all, the plot of ß{x) in the figure has the appearance of a (sheared) Sierpinski gasket with vertices at (0,0), (0,1/3) and (1,1). The "gaps" in this gasket reflect regions of low measure. Any attempt to increase the darkness of these regions would remove any idea of the self-similar variations in ß{x) in the x-direction. The important feature to note in this figure is that the the overlapping of the wi and W3 maps over [0, is responsible for the self-similar "splitting" of the measures ß(x) (hence lighter shading) over this interval, since ^ produces an upward shift in the greyscale direction. Since W2{}^ maps the support [0,1] of the entire measure-valued fianction onto [5,1], the self-similarity of the measure over [0, is carried over to [5,1]. Fig. 6. A sketch of the invariant measure ß(x) for the three-IFSmap fractal transform in Example 2, xgX= [0,1],7GR^=[0,1]. We now show that the moments of measures in the space (V, dy) also satisfy recursion relations when the grey scale maps are affine. We now consider the local or x-dependent moments of a measure G Y, defined as follows, gn{x)= f s^dß^is), m = 0,\,2,---- (33) where we use the notation ßj^ = ß{x) in the Lebesgue integral for simplicity. By definition, ^o(^) = 1 for xG X. Obviously the Sanctions g^ are measurable on X (since ß{x) are measurable) and bounded so that gm G L^ {X, J^). We now derive the relations between the moments of a measure ß G Y and the moments of V = Mß where M is the fractal transform operator defined in Eq. 29. Let h„ denote the moments of v = Mß. Then hnix) = f ^diMßUs) jRg For affine greyscale maps of the form (p{s) = «^5+ßj, we have I- N hn{x)= / + 1 J=0 i=l where cnj — The reader may compare the above result to that of Eq. 8 for the IFSP case. The place-dependent moments h„{x) are related to the moments gn evaluated at the preimages wj^{x). And it is the greyscale (^(s) maps that now "mix" the measures, as opposed to the spatial IPS maps wj{x) in Eq. 8. In the special case that ß = ß = Mß, the fixed point of M, then hn{x) = gn{x) and we have gn{x) = X J=0 N i=i gji^Y'i^)) ■ In other words, the moments gn{x) satisfy recursion relations that involve moments of all orders up to n evaluated at preimages wj^{x). Note that this does not yield a rearrangement, analogous to Eq. 11, which will permit a simple recursive computation of the moments gn{x). Nevertheless, the moment functions can be computed recursively (see (La Torre etal, 2009b)). MEASURE-VALUED FUNCTIONS, NONLOCAL IMAGE PROCESSING AND FRACTAL CODING Nonlocal image processing, the manipulation of the value of an image Sanction u{x) based upon values of »(/jt) elsewhere in the image, has recently received a great deal of attention, due in part to the success of the nonlocal means image denoising method (Buades etal., 2010). (This is in contrast to standard image processing methods which are local in nature, i.e., the points /jt lie in a neighbourhood of x.) Fractal image coding, outlined earlier in this paper, is another example of a nonlocal image processing method. In fact, both of these methods may be viewed under the umbrella of a more general model of affine image self-similarity (Alexander et al, 2008), in which subblocks of an image are approximated by other sublocks of the image. In La Torre et al. (2009b), we showed how the multifianction/measure-valued representation of images, outlined in the previous section of this paper, may be usefial in nonlocal image processing methods. In these methods, the value of an image function at a point x G X is, replaced by a transformed value Tu{x) which is usually composed by several values of the image function u{yi^) that lie elsewhere in the image. It may be useful to store these values in a measure or distribution ß{x) before performing the final projection of these values in order to produce the transformed value Tu{}dj. For example, the measure ß{x) could be used to characterize the local self-similarity of an image at a point xG X. The measure-valued formalism was used to analyze both the methods of nonlocal means denoising as well as fractal image coding. We now outline briefly its application to the latter. Historically, most fractal image coding research focussed on its compression capabilities - obtaining acceptable accuracy with the smallest possible domain pool in order to minimize (i) search times and (ii) storage of the fractal code. The fact that range blocks Ri of an image are, in general, well approximated by a good number of domain blocks Dj does not seem to have been emphasized or exploited. Consequently, investigations generally focussed on the results yielded by optimal domain blocks of the pool and not on the possible use of suboptimal ones. The reader will recall that the fractal coding method described earlier in this paper was based on the selection of the best domain block for each range block. More recently, however, the redundancy of good domain/range pairings has been exploited (Alexander, 2005) in order to perform image denoising. As in the case of nonlocal means denoising, the use of several domain blocks corresponds to an averaging over multiple samples, resulting in a reduction of noise variance. This may be viewed as a multiparent fmctal block coding method. At this point, it is important to mention that the idea of using several domain blocks for each range block is not new. Some examples of multiparent fractal coding schemes may be found in Gharavi-Alkhansari and Huang (1994); Vines (1995), and Furusawa and Nakagawa (2004). A simple measure-valued method associated with fractal coding: Here we outline a simple multiparent block fractal coding scheme that results from a modification of the block-based fractal coding method outlined an earlier section. This multiparent scheme lends itself nicely to a measure-based formalism. For convenience, we consider the same (square) range and domain block arrangement used in the fractal image coding scheme outlined earlier. For each range block Rj, we compute the Ajj approximation errors associated with a//domain blocks Dj, c/ Eq. 16. (Recall that for each range/domain pairing {Rj,Dj) there are eight spatial contraction/decimation maps w^j : Dj ^ Rj, \ < k < Once again, for simplicity of notation, we shall omit the k index.) The optimal greyscale map minimizing the error Aij will be denoted as ^ij{t) = aijt + ßij. (34) For this pairing we also assign a weight pij, normalized so that No J=i (35) For each range block it would seem natural to employ higher weights pij for those domain blocks Dj that yield lower collage errors Aij. Here we consider the following weighting scheme. 1 = ^exp ( ~hP (36) where P > 0, A > 0 and 4 = Ejexp(-Aj.//?0 is the normalization factor guaranteeing that Xj Pij = 1 for each i. In practice, P is either 1 or 2. Here, we shall employ P = 2, i.e., a Gaussian-type weighting. Regarding the adjustable parameter h >0: 1. In the limit A ^ 0+, the pij with the smallest error Aij will be selected. 2. In the limit h ^ <=°, all pjj become equal, i.e., all range/domain pairings are employed equally. The resulting multiparent block transform operator T is then defined as Nd v{x) = {Tu){x) = £ Pijaiju{w7l{x))+ßij, J=i x(^Ri, l