Iterated Function Systems for Real-Time Image Synthesis
Sławomir Nikiel
Iterated Function Systems for Real-Time Imag...
20 downloads
667 Views
8MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Iterated Function Systems for Real-Time Image Synthesis
Sławomir Nikiel
Iterated Function Systems for Real-Time Image Synthesis
Sławomir Nikiel, PhD Institute of Control and Computation Engineering University of Zielona Góra Poland
British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library Library of Congress Control Number: 2007921123 ISBN-10: 1-84628-685-9 ISBN-13: 978-1-84628-685-8
e-ISBN-10: 1-84628-686-7 e-ISBN-13: 978-1-84628-686-5
Printed on acid-free paper © Springer-Verlag London Limited 2007 Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers, or in the case of reprographic reproduction in accordance with the terms of licences issued by the Copyright Licensing Agency. Enquiries concerning reproduction outside those terms should be sent to the publishers. The use of registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant laws and regulations and therefore free for general use. The publisher makes no representation, express or implied, with regard to the accuracy of the information contained in this book and cannot accept any legal responsibility or liability for any errors or omissions that may be made. 987654321 Springer Science + Business Media springer.com
Contents Introduction
1
1. Image Models for Fractals 1.1. Colour-Space Models 1.2. Image-Space Models
5 5 7
2. Fractal Models for Image Synthesis – a Survey 2.1. Classification of Fractal Models 2.2. Fractal Geometry Models 2.2.1. Geometric Construction of Self-Similar Fractals 2.2.2. Affine Fractals and Fractal Terrains 2.2.3. Self-Squaring and Self-Inverse Fractals 2.2.4. Shape Grammar for Fractal Shapes 2.2.5. Particle Systems and Fractal Structures 2.2.6. Diffusion-Limited Aggregation 2.2.7. Cellular Automata 2.2.8. Strange Attractors for Fractal Models
11 12 12 13 17 19 22 23 25 27 29
3. Iterated Function Systems – the Model 3.1. Background 3.2. n-Dimensional Iterated Function Systems 3.3. Alternative IFS Models 3.3.1. Recurrent Iterated Function Systems 3.3.2. Partitioned Iterated Function Systems 3.3.2.1. Image Coding – Image Compression 3.3.2.2. Image Decoding – Image Decompression 3.3.3. Polar Iterated Function Systems 3.3.4. Self-Congruent Iterated Function Systems 3.3.5. Fractal Tops, Homeomorphism and Super IFS
31 31 37 39 39 40 41 43 45 48 49
4. Inverse Problem – the Collage Theorem
55
5. IFS Rendering Algorithms 5.1. Random Iteration Algorithms 5.1.1. Classic Random Iteration Algorithm 5.1.2. Colour-Stealing Random Iteration Algorithm 5.2. Deterministic Iteration Algorithms 5.2.1. Classic Deterministic Iteration Algorithm 5.2.2. Deterministic Iteration Algorithm and Superfractals 5.3. Minimal Plotting Algorithm 5.4. Constant Mass Algorithm 5.5. Escape-Time Algorithm
61 61 61 65 67 67 69 71 73 74
vi
Contents
5.6. String-Rewriting Algorithm 5.7. Tesseral Synecdoche Algorithm 5.8. Recursive Rendering Algorithms 5.8.1. Point Recursive Rendering Algorithm 5.8.2. Vector Recursive Rendering Algorithm 5.9. Image-Based Rendering Algorithm 5.10. Accurate Fractal Rendering Algorithm 5.11. Rendering of Self-Congruent IFS 5.12. Recurrent IFS Algorithms 5.12.1. Vector Recurrent Grayscale Photo-Copy Algorithm 5.12.2. Vector Recurrent Probabilistic Domain Algorithm 5.13. Performance 5.13.1. Number of Iterations 5.13.2. Sample Comparison of Four Volumetric IFS Renderers
76 78 79 79 81 83 85 88 89 90 91 91 92 96
6. nD Iterated Function Systems and Their Applications 6.1. Two-Dimensional Iterated Function Systems 6.1.1. Implementation 6.1.2. Properties 6.1.3. Applications 6.1.3.1. Black-and-White IFS Fractals 6.1.3.2. Fractal Interpolation 6.1.3.3. Fractal Palettes 6.1.3.4. 2.5D IFS Terrains 6.1.3.5. 2D Vector IFS 6.2. 3D IFS 6.2.1. Implementation 6.2.2. Properties 6.2.3. Applications 6.2.3.1. 2D + Grayscale/Palette IFS Fractals 6.2.3.2. 3D Binary IFS Fractals 6.2.3.3. 2D Vector IFS Fractals + Selected CSG Primitives 6.2.3.4. 3D Vector IFS Fractals + CSG Primitives 6.3. 4D IFS 6.3.1. Implementation 6.3.2. Properties 6.3.3. Applications 6.3.3.1. 3D Grayscale/Palette Fractals 6.3.3.2. 3D Vector IFS Fractals + Selected CSG Primitives 6.4. 5D IFS 6.4.1. Implementation 6.4.2. Properties 6.4.3. Application: 2D + RGB and 2D + HSI IFS Fractals 6.5. 6D IFS 6.5.1. Implementation 6.5.2. Properties
99 99 99 100 101 101 102 105 108 112 115 115 116 116 116 118 118 119 121 121 121 122 122 122 124 124 124 125 126 126 127
Contents
6.5.3. Applications 6.5.3.1. 3D + RGB and 3D + HSI Volumetric IFS Fractals 6.5.3.2. 3D + RGB and 3D + HSI Vector IFS + CSG Primitives 6.5.3.3. 2D + RGB ALPHA IFSs Fractals 6.6. 7D IFS 6.6.1. Implementation 6.6.2. Properties 6.6.3 Application: 3D Vector RGB IFSs + Selected CSG Primitives
vii
128 128 128 129 129 129 130 131
7. Conclusions, Directions for Further Development
133
References
137
Appendix A: Acknowledgments
147
Appendix B: Abbreviations
149
Appendix C: Index
151
Introduction Processing numerical data is the key feature of computer science. The most exciting applications, however, have been observed in the fields of computer-driven simulations, computer-aided design (CAD) and computer graphics. Because of the tremendous number of technological changes that have occurred in the field of computer science, computer graphics has become a standard element of scientific visualization, education and entertainment. The domain of computer graphics technology is now developed to such a sophisticated level that the overhelming volume of text and imagery, including video, has been processed by one of dedicated CG systems. Computer graphics techniques can be used to store and process complex data representing threedimensional scenes and objects. The benefits of digital representation are mostly visible in computer-aided design, three-dimensional modeling and animation technologies that are used in industry and entertainment. The success of real-time 3D computer graphics has been greatly influenced by low-cost graphic workstations and PCs as well as game consoles with high-quality displays. It has also depended on the evolution of effective software tools for data manipulation. Computer graphics has been expanded by a wealth of modeling tools that include object representation, spline curves and surfaces, blobs, BSP trees, shape grammars, surface rendering methods, advanced illumination models, particle systems, physical simulation, morphing and fractals. All these methods are firmly based on mathematical models. Mathematics is concerned largely with sets and functions to which the methods of the classic calculus are applied. Models based on computational geometry and Euclidean geometry form the basic bricks of computer graphics systems. The most versatile vector models (introduced briefly along with raster models in Chapter 1) are based on sets and functions that are smooth and regular. Those objects that are not sufficiently regular have tended to be either ignored as a ‘side effect’ of the digitization process, or faked with raster-oriented image-based rendering methods. After the serious development of fractal theory, this attitude has changed. The observation of nature led to fundamental books on fractals that address the problem of ‘irregularity’ at many levels: the scientific, philosophical and pictorial ones [1,2,3,4]. There is a wide literature that addresses the subject of fractal-based image synthesis, and representative references are cited at the end of this monograph. Very popular in two-dimensional representations, fractals can be rather hardly found in volumetric applications of computer graphics. The computational complexity of popular fractal rendering methods and algorithms prevents their implementation in real-time volumetric graphics. Moreover, fractal models are usually based on random sequences. This is in sharp contrast to the classic purely deterministic geometry models used in popular CG modeling systems. Euclidean-type objects are usually based on certain differential equations (for example, circles and curves used in CAD models). A random generation of objects and their particular geometry reduces designer-computer interaction to a choice of aesthetically pleasing model that cannot be easily re-created by other modelers. Most CG models take considerable time to be constructed and rendered to a high-quality representation. Considering real-time
2
Iterated Function Systems for Real-Time Image Synthesis
computer graphics systems, the models face severe limitations on how they are represented and rendered. Further implications arise when very life-like scenes are the main goal of the visualization system. This usually results in more and more complex scenes, and more resource-demanding rendering techniques. The quality of rendering and efficiency are critical factors in rigorous real-time CG systems. Therefore, there is a need for models and techniques that meet these criteria. Fractals can meet some of the demands pointed above. They seem to offer perfect models for a visual simulation of complex natural scenes and phenomena. Historically, the interest in fractal theory has been stimulated by its references to nature. The recent physics literature addresses the variety of natural phenomena that are described as fractals shapes of clouds, topographical surfaces, a turbulent flow of fluids, patterns in geology and so on [1,2,3,4]. Considering purely mathematical fractals, none of these are actual fractals. Fractal characteristics disappear in small scales of observation. Nevertheless, over certain limited ranges of scale they appear very much like fractals. Therefore, at such scales (usually referred to distant and medium ‘shots’ in photography and cinema), fractal models are sufficient enough to approximate visually such phenomena. Fractal models can add pictorial realism to different simulations of real-life situations. It starts from the visually thrilling First-Person Shooter games, goes through engaging trainers for troops and emergency teams, and ends at highly complex and expensive Digital Cultural Heritage (DCH) systems, where the visual context to virtual reconstructions of human-made artifacts is crucial to understand the history of civilisation. Fractals offer much better approximation to natural scenes than the figures of the classic geometry. The reason for that is that fractal models provide a general framework to study and reconstruct irregular and complex objects and situations. Looking at typical examples of fractal models (described briefly in Chapter 2), we can observe some of their distinct features. Fractal objects are usually self-similar irregular sets. All mathematical fractals can be rendered to very large scales, thus they have a ‘fine’ structure. Fractal models are obtained by a recursive procedure. Successive steps of repeatedly implemented fransformations result in highly complex images. The images are intricate, but the underlying models are rather simple and straightforward. Their geometry is very hard to describe in the classic terms. Methods that are common in the Euclidean geometry are unsuited to study and model fractal objects. Some alternative ways are needed, then. Some theories and techniques like fractal dimension are very general and hold for all classes of fractals [5,6]. Various other models have been proposed to address chosen features of fractal objects [7–12]. The field of fractal modeling is wide and constantly growing in completely different areas, such as biology, architecture or culture [13–20]. This monograph aims to present specific models and techniques of fractal-based object modeling for real-time image synthesis. The emphasis is put on iterated function systems that can be defined in geometry-related terms. Iterated function systems are recursive and have deterministic characteristics. Such features are very attractive as far as the process of interactive image synthesis is considered. By the generalization of iterated function systems to the n-dimensional case, provided that the average contractivity of the model is obeyed, it is possible to create very complex image structures in real time. The main scope of the monograph is to set up an intuitive set of tools for image modeling of complex natural and artificial phenomena, leaving place for a
Introduction
3
further implemenation of dynamics for sophisticated simulation systems. The content that can be produced with the proposed models and methods should be as widely useful, portable and elastic as possible. The monograph encompases different types of models that may address different users and developer groups and aims to make a contribution to distinct scientific objectives. Both raster and vector graphics models, introduced briefly in Chapter 1, are available for exploration in the field of fractal imaging, although the chapter is focused on the develoment of vector models aiming at portability to other modeling/rendering environments. Fractal modeling for image generation has a long and interesting history. Chapter 2 presents a brief summary of the most representative fractal geometry models very often applied in many commercial and freely available graphic design environments. Lindenmayer systems, affine fractals, self-squaring models, shape grammar along with genetic programming, particle systems and springs, diffusion-limited aggregation, cellular automata and strange attractors provide a wealth of algorithmic tools for models usually implemented as shaders. Iterated function systems are particularly interesting; however, their application to computer graphics is somewhat underestimated. The genuine iterated function systems model is based on the research done by Hutchinson, and was presented by Barnsley and Demko several decades ago [21,22]. The IFS model was accompanied by a few rendering algorithms that allowed a relatively easy and straightforward implementation on almost any personal computer equipped with a graphic display. This model is presented in Chapter 3 along with other IFS-related extensions. Recurrent iterated function systems and partitioned iterated function systems are the most popular extensions to IFS theory. They are applied to image compression and decompression schemes (Chapter 3.3.2). The fractal image compression/decompression process is very efficient but highly asymmetrical. Compression time is much longer and resource demanding than the decompression process. Polar IFSs present an interesting challenge for an automated solution to the inverse problem (Chapter 3.3.3). The selfcongruent code model aims to fill the gap between the fields of IFS modeling and biology-related Lindenmayer systems. Recent developments in this field are presented briefly in Chapter 3.3.4. Up-to-date developments of the so-called fractal tops as well as super IFSs and superfractals are discussed in Chapter 3.3.5. The n-dimensional IFS model is introduced in Chapter 3.2. The model is very flexible and open to many extensions as well as further developments that can be added to the classic IFS model. The collage theorem (described in Chapter 4) provides foundations for an interactive fractal manipulation. Along with the supporting theorem, it gives the main user-centered tool for a real-time IFS-based image and object synthesis. The very first implementations of iterated function systems were slow and inefficient. There have been many improvements made over IFS rendering algorithms (the state-of-the-art in this field is presented in Chapter 5). Considering recent improvements and the purely deterministic character of some IFS rendering algorithms (like the tesseral synecdoche algorithm, vector recursive rendering and image-based rendering), it is possible to render fractals in real time. The overall performance of fractal-rendering implementation depends on many factors; this issue is addressed in Chapter 5.13. The main problem in real-time image synthesis is the intuitive user control over object construction and the parametrization of the model. Since IFS models may employ the classic geometrical transformations, it is possible to create user-friendly fractal design environment
4
Iterated Function Systems for Real-Time Image Synthesis
based on model manipulation tools known in CAD systems. The main difference between the ‘classic’ and fractal modeling paradigms lays in focusing on the reconstruction of the general shape in the former, and in spotting and exploiting selfsimilarities in the latter. Implementations of nD IFSs in real-time CG modeling, analysis and simulation are discussed in Chapter 6. Both binary flat image synthesis and truecolour volumetric datasets are implemented. The developments described in this monograph broaden the application area of fractal modeling in real-time computer graphics. The following is a concise summary of the contribution of this work to computer science: • The monograph proposes a generalized model, called the nD IFS, which opens brand new possibilities for applications enhancing the state-of-the-art in computer graphics. • A new paradigm for user-centered fractal modeling is proposed. • The unique concepts of vector-based fractal models (in particular, the vector IFS) and the accompanying rendering algorithm are forwarded. • The monograph introduces a recursive fractal rendering scheme, which is very efficient, is open to parallel computation and gives a purely deterministic output. • The problem of the efficiency of IFS fractal image generation is formulated and analyzed. • Possible applications of the proposed n-dimensional IFS model are thoroughly investigated and supported by sample results obtained from alpha-stage prototype modeling and rendering applications. • The monograph systematizes problems related to IFS-based image synthesis. • IFS-based terrain models for context-dependent terrain engineering are proposed. The monograph is organized as follows: Chapter 1 introduces digital image models that are used in fractal imaging. Chapter 2 presents a survey of the most popular fractal models applied in the field of image synthesis. Chapter 3 discusses iterated function systems models, including recent developments in the theory of affine maps, contractivity theorems and other IFS representations such as PIFSs, RIFSs, polar IFSs, self-congruent IFSs and super IFSs. Chapter 4 addresses an inverse problem in fractal imaging – the collage theorem, and its implications. Chapter 5 presents the state-of-the art of IFS rendering algorithms. Performance issues are discussed as well. In Chapter 6, n-dimensional iterated function systems are presented through the set of their possible practical implementations in real-time computer graphics. Chapter 7 concludes the monograph and points out some directions for further development. The models discussed in the work are illustrated by accompanying images and diagrams. The monograph contains both a description text and pseudo-code samples for the most important rendering algorithms for iterated function systems. The figure plates depict colour renderings supporting the material presented in the main body of the monograph.
1 Image Models for Fractals Computer graphics is a large and complex subject covered by many excellent books. Mathematical methods and software technologies used in CG systems are discussed in a wealth of books, scientific journals and conference proceedings. This chapter presents specific computer graphics topics related strictly to image models used in fractal image representations. The techniques form the background models of every digital image-generating system and are crucial for fractal image synthesis. These individual topics are extremely broad and it is impossible to cover them all in detail. They will be briefly described in order to support the concepts presented in further chapters. 1.1 Colour-Space Models Colour models are invaluable to set up properly the simulation of complex interactions between objects and the lighting environment. It is very important to implement such techniques that assure a better quality of the rendered images. In order to render colour images, we need to define the background of colour representation. Various colour models are used in computer graphics. The majority of them describe colour as a set of separate composites, usually three numbers, or equivalently a position in the 3D colour space. The colour-space model is implemented in the fractal models discussed in Chapter 6. Physically, colour is s set of mixed wavelengths where different aplitudes, spectra and phases add to a given colour. Some colours are not visible in spectra; they are perceptive and their recognition depends mostly on human vision. Brown, olive green and gold are good examples of colours that cannot be directly derived from the ‘rainbow’ of spectra. Nevertheless, digital colour models can approximate most of what we perceive. Most scientists define colours in terms of their location on a twodimensional graph known as the CIE1 chromacity diagram [23,24]. The 1976 CIE diagram maps the spectral parameters of colour (and its physical equivalent – the wavelength) onto the x,y plane (Fig. 1.1). Almost all visible colours can be located inside the CIE diagram. The CIE model is the most widely used standard for the description of colours. However, for numerical processing, other colour models seem to be more convenient. They are not as accurate as the CIE model, but they allow most visible colours to be represented. The most popular models are RGB, HSI, YIQ, YUV, CMYK, RYB and NCS. They are practical and implemented in many digital imaging systems. Generally, there is a visible distinction between the so-called additive, subtractive, natural and conceptual colour models [24,25,26]. Additive models add colour components (lights of different wavelengths) to compose the output colour. The Red + Green + Blue (RGB) components match human eye perception and are used primarily for colour displays.
1
Commission Internationale de l’Eclairage.
6
Iterated Function Systems for Real-Time Image Synthesis
Fig. 1.1. CIE-1976 diagram shows the relative placement of different colour values according to their wavelengths.
The maximum values of RGB sum up to White (W), while the zero values of RGB give the blacK (K) colour (K is usually capitalized to differentiate between the Blue (B) and black colour abbreviations). The depth of colour in the RGB model is related to the number of bytes assigned to this model. A one-bit system encodes two selected colours. An eight-bit depth is used in the grayscale and palette images (offering 256 levels of gray or selected colours). A 16-bit representation is usually known as the hi-colour model and approximates the colour space to 65,536 colour values. The 24-bit RGB colour model is the most popular in computer graphics systems. With eight bits or, equivalently, 256 levels for each colour component, it represents the so-called true-colour systems and describes millions of colours. All depths of the RGB colour model are exploited in the fractal image synthesis described in Chapter 6. Modern CG applications can implement more than eight bits per colour component (up to 128 bits), e.g. PNG and RGBE [27,28,29]. High Dynamic Range (HDR) models process and store more bits in colour model representation, although they are primarily used to better estimate lighting and shading in complex scenes. The HDR model perfectly fits fractal imaging. It can be used to highlight subtle details in complex fractal structures. RGB values can be extracted from digital images. Image-Based Rendering (IBR) techniques can be used to assign realistic colours to fractals. The colour stealing method (Chapter 5.1.2) derives colour values from a given digital image and maps it on the IFS attractor.
Image Models for Fractals
7
Subtractive colour models are where colour components subtract from white as in mixing paint pigments on a paper. Usually, we start with white canvas and then subtract light with layers of paint absorbing different wavelengths. Cyan-MagentaYellow (CMY) is a subtractive analogue to additive RGB. Cyan-Magenta-YellowblacK (CMYK) is used widely in DeskTop Publishing (DTP) and in printing/press. Red-Yellow-Blue (RYB) is another subtractive colour model used mainly for mixing pigments by artists. There are quite straightforward converting calculations between the CMYK, RYB and RGB colour models [30,31]. Natural colour models are closer to the human perception of colours. They allow describing colour in terms of its sensual values. Considering the brown colour, which cannot be foud in the CIE diagram, it is possible to approximate it with low-intensity oranges. It is possible to obtain such an approximation with the RGB model, but the process is neither intuitive nor easy to control interactively. Natural models such as HSI and NCS allow describing colour better in terms of intuitive parameters. Hue Saturation Intensity (HSI) clearly defines colour as a range/circle of hues (similar to light spectra) with a specific intensity (from dark to bright shades) and a given saturation (from pale pastels to intense, oil-like, colours). The brown colour would be defined with the HSI model as of an orange hue with a low intensity and a medium saturation. The HSI model describes the colour space with real numbers and is widely used for colour selection in digital painting tools. This model is implemented in fractal colouring described in Chapter 6. The Natural Colour System (NCS) describes any colour in terms of the redyellow-green-blue circle as well as intensity and saturation [32]. Thus, colour values are determined by a six-dimensional space. The NCS is very accurate and popular among painting and paint mixing companies (analogy to the PANTONE colour model used in desktop publishing and based on colour samples) to assure an identical blend of pigments. The NCS model is distributed commercially. The main clients are the interior design and car industries, although the model can be used in many more fields. There is no simple way to convert between the RGB and NCS and HSI models. LAB, YIQ and YUV are colour models that cannot be classified as intuitive, additive or subtractive. Such models are conceptual and they separate luminance and chrominance channels in the digital image. The models are used in advanced digital image processing (LAB), broadcast television (YIQ) and image compression schemes (YUV). The separation of the luminance and chromatic information can be used in better image compression schemes (Chapter 3.3.2). Some insensitivity of the human eye to the local colour variations can be exploited to average colour hues and drastically increase the compression ratio. The YUV model is used mainly in image storage and is implemented in the JPEG and MPEG standards. The values of the LAB, YIQ and YUV components are usually calculated from RGB colour components [23,26]. 1.2 Image-Space Models Digital image needs quantized information both in colour and space. Two-dimensional raster images are constructed from a set of pixels (picture elements) that determine the spatial resolution of the digital picture. Each pixel has an assigned colour value
8
Iterated Function Systems for Real-Time Image Synthesis
determined by one of the colour models described in the previous section. The Horizontal×Vertical (H×V) resolution describes a total amount of pixels in the image [23,25,26,33]. It starts from as little as 90×140 pixels and a 1-bit colour depth for mobile phones and can grow up to a 100,000×100,000 32-bit CMYK image for laser scans used in DTP applications [34,35,36,37,38]. A similar raster implementation is used in the IFS fractal models proposed in Chapter 6. The print and press industries usually decribe digital images by their size in inches/millimeters along with the density of the raster given in dots per inch (DPI). This model is useful in offset-based printing of digital images. Three-dimensional raster images are constructed from voxels (volumetric pixels) that represent single points in a 3D space [27,33,39]. Volumetric graphics is resource-demanding and presents several challenges to computer graphics industry. The visualization of volumes requires extended colour models to properly handle spatial relations. The alpha channel (RGB+ALPHA) introduces transparencies in the volumetric image model but demands more bits per voxel. With the more popular 64-bit PCs, new game consoles and gigabytes of memory, volumetric graphics will be as popular as flat imaging. Application areas include both scientific visualizations and advanced visual simulations used in gaming technologies. 3D iterated function systems can be straightforwardly implemented in volumetric CG applications. In contrast to raster imaging, which operates on raw image data, vector graphics is based on abstract mathematical models of image components. To view such models, abstract sets need to be rendered to raster images. Vector graphics has its origins in computational geometry and the visualization of mathematical models [27,33]. Differential geometry, Euclidean models and even more complicated n-dimensional curves are used to descibe object geometry. All model parameters are stored and manipulated separately from the rendering. The vector of parameters defines the output image. The preview used in modeling is usually supported by a fast, lowquality visualization. The final rendering is far more complex and uses different imaging and shading techniques, including ray tracing, radiosity and physical modeling for animations. The IFS techniques proposed in the monograph can be treated as additional tools extending the bundle of mathematical models available for 3D design. Vector graphics relies heavily on interpolating functions, which can estimate midpoints to a given set of smooth objects. Fractal interpolators could extend vector graphics with natural-looking irregular sets. The main advantage of vector representation is the unlimited resolution of the final rendering, which makes vector graphics the most flexible tool for designers. The graphs of linear, polynomial and Bezier interpolators are the basic elements of hierarchical graphical structures that are common parts of Graphical Users’ Interface (GUI), digital typography (TrueType Fonts) and popular Flash animations [40,41]. The Graphical Kernel System (GKS), approved by the International Standards Organization (ISO), and the industryrecognized Open Graphics Language (OGL) are based on vector models. Similar concepts can be used in three dimensions. Triangular meshes, spline and Bezier patches are computationally efficient elements of any 3D computer-aided design system. Real-time rendering of 3D scenes is required in digital cinema, in applications of digital cultural heritage and in gaming and entertainment [42–50].
Image Models for Fractals
9
Vector graphics describes geometrical properties of objects with mathematical models. Fractals are represented by non-differential models and tend not to have any tangents. The classic vector models need tangents to properly determine light-surface interactions. Chapter 6 presents various enhancements of the IFS model to facilitate the embedding of fractal models into vector-oriented 3D design systems. The visualization of the surface under certain lighting conditions is crucial for the realism of computer-generated scenes. In order to visualize more appealing objects, several techniques mixing vector and raster image models are used. Flat cosine, the Goraud and Phong shading are based on relatively simple colour models. The Warn model adds calculation for multiple light sources, and the texture mapping offers placements of raster images onto the modeled surface [27]. Textures can be extracted from reallife images (IBR methods), pre-processed, painted manually or generated procedurally (by the so-called shaders) [27,33]. The interaction between light and the surface of real objects is very complex. There have been many attempts to simplify this phenomenon and to describe it in terms of numerical processing [24,27,44,51–62]. The methods of ray tracing, radiosity and environment mapping try to mimic natural light and surface interactions [63–67]. However, they are computationally expensive and far from applications to real-time CG systems. Gaming and visualization use less complex ‘fake’ models that are visually close to physically correct simulations [27]. Computer graphics applications store several channels of information for each object. Geometry data are accompanied by the image texture (which itself can be multi-layered), the alpha channel for the transparency of the texture, bump and normal mapping channels depicting surface irregularity in terms of the displacement of normal vectors. The specular map, the reflection map, the environment map, translucency and Fresnelform channels can be incorporated into model description [25,27,33,67–71]. Each channel can be described and stored either as raster data or as a set of parameters for procedural generation. The fractal techniques proposed in the monograph can be extended with multi-channel models; directions for development are presented in Chapter 7.
2 Fractal Models for Image Synthesis – a Survey Fractals are usually perceived to be graphic objects with intricate shapes. They are very different from the classic Euclidean geometry figures such as triangles and nurbs. However, they do not have a precise definition that includes all interesting cases. Fractals can be described by a list of characteristics. When referring to fractal objects, most researchers typically define them as things that • have a ‘fine’ structure; we can zoom in any region of a fractal and still observe fascinating complex details [4,72–75]; • show some form of self-similarity, mostly approximate or statistical. Fractals provide a repeated graphical content that is easy to recognize and is visually appealing; • are too irregular to be described by the classic Euclidean geometry, both globally and locally. The lack of tangents presents a serious drawback for differential geometry-based analysis and modeling; • usually have a non-integer ‘dimesion’ (defined in some way). Such a dimension is greater than the fractal topological dimension. Unlike the widely known Euclidean dimension (0 for a point, 1 for lines and curves, 2 for filled circles and 3 for cubes and other volumetric objects), the fractal dimension is not necessarily an integer [4,5,6,72,76–80]; • are usually defined in a very simple way. Most fractals have relatively simple models that exploit recursive or iterative rendering schemes [78,79,81–84]. Since Mandelbrot coined the term fractal in the 1980s, fractal geometry has received increased attention in the areas of science, arts and entertainment industry [4, 13–20,74–76, 85–94]. We can control the overall appearance of fractal objects. Fractals are parametrized models that usually give in the output highly complex raster images. Fractal models have been applied to mimic a vast amount of natural phenomena. They are also used in off-line graphic applications to model artificial terrain geometry, clouds, water, vegetation, fur and various surface textures [13–17]. Although known mostly from appealing colourful abstract patterns, fractal geometry is used in procedural shaders that form the basic tools for photo-realistic computer graphics systems. Image compression is another field of research and development exploiting fractal properties of pictures depicting natural scenes. A fractal object is usually generated by an iterative application of a specific transformation function to points within a region of a two- or three-dimensional space. The transformation function can be also applied to a specific point set. We can apply it to an initial set of graphic primitives, such as particles, curves and time-dependent functions, texture images, surfaces or volumetric entities. Fractals may be defined in terms of geometric transformations or they can be built from non-linear coordinate transformations. In general, there are two kinds of fractal generation procedures: the deterministic and stochastic (random) ones. Theoretically, fractal objects have infinite details, but
12
Iterated Function Systems for Real-Time Image Synthesis
for practical reasons the iterative process of their rendering using a personal computer has to be terminated in a finite time and a finite image resolution. Therefore, CG fractals actually have finite dimensions and scales. This influences the amount of details depicted in the final graphical display of the fractal image. We cannot simply display detail variations that are smaller than the size of a pixel. Even if we consider supersampling techniques (popular in ray tracing), we calculate a limited finite set of sub-pixel samples to determine the pixel value. The number of colours assigned to each element of a fractal is also limited to the colour depth of image representation (see Chapter 1). 2.1 Classification of Fractal Models All fractals have common features of a non-integer dimension, an intricate geometric structure and the lack of differential equations for their description. Two kinds of generation procedures result in two large groups of fractal objects: deterministic and stochastic ones. Both represent complex geometry, but the latter challenge us with the problem of consistent and easily repeatable results. Self-similarity is another key feature of fractals. Purely self-similar fractal objects have parts that can be seen as a scaled-down version of the entire object. It is possible to find all sub-parts scaled or only selected elements of the fractal. In nature, it is quite hard to find purely self-similar objects. Broccoli and cauliflower are the most exceptional examples of such real-life fractals. If random variations are introduced into scaled-down parts, then the resulting object is a statistically self-similar fractal. Such fractals are closer to the natural diversity of the object structure and are commonly used to model plants, trees and other branching objects like coral reefs. The so-called self-affine fractals have parts that are constructed with different scaling parameters in different coordinate directions. It is also possible to apply random variations in order to obtain statistically self-affine objects. Terrain geometry, virtual planets, clouds and various image textures are usually modeled with statistically self-affine fractal design methods. Invariant fractal sets are usually constructed with non-linear transformations. The most popular fractal image icons are the Mandelbrot and Julia sets. They are self-squaring fractal objects, an interesting subclass of invariant fractal sets. A number of the polynomial and trigonometric functions can also be used to deliver a wide range of visually striking fractals. From the author’s observation, the most visually interesting forms are relatively smooth and have recognized symmetries in their amorphous shapes. Self-inverse fractals are another type of invariant fractal sets. They are formed with repeatedly applied nonlinear inversion operations. The initial points in the image space are transformed into the output fractal object. 2.2 Fractal Geometry Models Natural objects can be photo-realistically modeled with a number of fractal geometry methods. The iterative procedure, rather than differential geometry equations, is used to model intricate shapes. Fractal modeling for computer graphics has matured over
Fractal Models for Image Synthesis – a Survey
13
the recent years and is well covered by books and research papers. In the following sections, only the most representative cases are reviewed. 2.2.1 Geometric Construction of Self-Similar Fractals The problem of a geometric construction of fractals was approached from two directions: a deterministic one and non-deterministic one. Both methods start with a given geometric shape, usually called the initiator. The sub-parts of the initiator structure are then replaced, according to the production rules, with a pattern called the generator. The classic fractal shapes such as the Koch curve and the Sierpiński triangle are very good examples of the deterministic method (Fig. 2.1). We can also use generators with multiple disjoint components. Compound deterministic generators are used to model plants. The iterative procedure of fractal construction can be encoded in an abstract form. Lindenmayer and Prusinkiewicz developed a selfrefining code (the L-system, or the PL-system) that depends on the specification of plant topology [62,95–97]. The definition of the L-system does not specify the data structure for the representation of axial trees. In a typical case, the L-system starts with a relatively simple initiator structure and a limited set of production rules. Models of plans are constructed through a graph-rewriting mechanism. A rewriting rule or a production rule replaces the edge specified as the production predecessor by an axial tree called the successor. The starting node of the predecessor is identified with the successor’s base and the ending node is identified with the successor’s top (Fig. 2.2).
Fig. 2.1. L-system representing the Sierpinski triangle.
14
Iterated Function Systems for Real-Time Image Synthesis
Fig. 2.2. Sample tree production with the initiator and the first step of the refinement procedure.
There are several classes of L-systems (Fig. 2.3). In the case of context-free rewriting, the label of the replaced edge determines the production rule to be applied. A context-sensitive production requires the context or the neighbouring edges to be tested as well. A rewriting system can operate in either a sequential or a parallel manner. The former type of rewriting is found in Chomsky grammars [97–99]. Parallel rewriting systems are commonly recognized as L-systems. Particularly, a set of edge labels is called the alphabet and is denoted by V, while an initial tree ω is called the axiom (the initiator).
Fig. 2.3. Classes of L-systems.
A set of production rules D defines transformations and displacements of the successor structures according to the predecessor structure. If, for a given edge label and any associated context, there exists exactly one applicable production, then the L-system is deterministic, otherwise it is non-deterministic. Non-deterministic L-systems provide useful tools for modeling various organic structures (Fig. 2.4). The L-system is usually modeled as a list representation with a tree topology. Other models include LOGO-like bracketed strings [95,96,100]. In such a case, a tree with an edge label is
Fractal Models for Image Synthesis – a Survey
15
represented by a string over the alphabet V, where the symbols ‘[ ]’ denote brackets. A simple L-system may be presented as ω:S; p1=S->S[S]S[S][S]; p2=S->SS, where p1 and p2 are production rules belonging to D. The process of construction is implemented as operations on strings. Some researchers define deterministic fractal plants in terms of lengths, sizes and orientations of plant components [59,60–62,99–103]. Some trigonometric transformations and non-linear functions can be used to model natural looking plants that vary in shapes and sizes. Ecological models assume the influence of the environment on the growth of plants (Fig. 2.5). Real plants grow according to some natural cycles of evolution (day cycles, lunar cycles or season cycles). It is possible to define the L-system representing a plant as a time-dependent model [104,105]: ⎧ V (t ) t ∈ (0, T ], k = 0; ⎪ (1) i k ⎛ ⎞ Z (t ) = ⎨ ⎜ ⎟ V ( t ) D ( t ( l 1) T ) V ( t iT ) t ( kT , ( k 1) T ], k 1, 2,... ∪ − − − ∈ + = ⎪ ∪ ∪ ∏ gl # i ⎠ i=1 g # i ∈G # i⎝ l=1 ⎩
where Z(t) is a time-dependent L-system; V(t) is a certain shape defined by the alphabet at the specific moment t; g # i = ( g1# i , g 2# i ,..., gi# i ) is a string defined by the alphabet V(G#i); Dgl # i is a matrix of l production rules that defines the placement of segments at the beginning of each T cycle of growth.
Fig. 2.4. Sample tree-like shape rendered with a non-deterministic L-system.
16
Iterated Function Systems for Real-Time Image Synthesis
Such a model can be used to design dynamically changing plant structures with a cycled growth process. The model is implemented in the self-congruent iterated function systems discussed in Chapter 3.5. Constructive solid geometry (CSG) can be applied to the geometric construction of statistically self-similar fractals [106–108]. CSG PL-systems define a valuable set of graphical primitives, geometric transformations and Boolean operators. Once a set of fractal plants has been created, we can design complete scenes with artificial vegetation. Multiple object instancing incorporating CSG-PL plants has proven to be handful in digital landscape design, game industry and digital movie pictures. Some theoretical models have evolved to commercial fractal plant modeling packages like X-Frog [109–111]. The resulting objects are very life-like, but their rendering takes a considerable amount of time and memory, thus making real-time interactions between the model and the designer impossible.
Fig. 2.5. Tree models renedered under the influence of ecological rules.
Fractal Models for Image Synthesis – a Survey
17
2.2.2 Affine Fractals and Fractal Terrains We can model visually attractive terrains, clouds and whole planets with affine fractal models. The background model is usually based on the fractional Brownian motion fBm [4,72,76,112]. An extension of the standard Brownian motion (a random walk of a physical particle) is done with an additional parameter defining the fractal dimension of the path structure. A one-dimensional fBm can be used to interpolate fractal curves. A two-dimensional array of fBm elevations over a triangle regular mesh results in either a map of clouds or the surface of a mountain (Fig. 2.6) [113,114].
Fig. 2.6. Pattern of clouds and sample fractal mountains obtained with fBm synthesis.
When the initial mesh is a subdivided sphere, we can model the whole fractal planets [115]. By adjusting the fractal dimension of the fBm modeler, we can vary the roughness of the surface (Fig. 2.7). Starting from D = 2.0 for flat surfaces, the fractal dimension can take values up to 3.0 for chaotic structures that do not resemble the known terrain structures. The original fBm terrain synthesis is based on a Fourier series that is the sum of cosine and sine terms with varying parameters. For computer graphics applications, the fast Fourier transform (FFT) is used for better performance [116]. The rendering process, however, is very slow for large areas of the modeled terrains. More efficient terrain generating algorithms have been proposed to solve that problem. The random mid-point displacement method (MDM) was developed to quickly approximate fBm models for artificial terrain and clouds. The MDM is commonly used in many commercial terrain-modeling packages [117–120]. It is also possible to create terrains that approximate real geological structures. One way is to use control surfaces and a composition of parametrized functions. The IFS-based terrain modeling described in Chapter 6 is based on the Cartesian product of fractal interpolators. In order to obtain more realistic-looking terrains, random cuts, spherical subdivision, evolutionary and plate tectonics methods have been proposed [121,122]. A Gaussian distribution of random parameters is necessary to finely approximate the fBm model.
18
Iterated Function Systems for Real-Time Image Synthesis
Fig. 2.7. Different irregularity of fractal-engineered terrains.
It is very likely to observe artifacts in simple terrains generated with the standard fractal modeling methods. Visual artifacts, in the form of regular creases, are results of
Fractal Models for Image Synthesis – a Survey
19
either the regular underlying triangle mesh or an inadequate choice of model parameters. In order to enforce more irregularity in the model, we can use irregular meshes, control surfaces and hexagonal mesh tiles [115,116]. Artificial terrains can be post-processed with averaging filtering, erosion models and hydrology models. 2.2.3 Self-Squaring and Self-Inverse Fractals Another popular method for generating fractal objects is to iteratively apply a transformation function to points in a complex space. The most representative one is the complex squaring function f(z) that operates with the calculation of z2+c. Complex function equations can be applied to sets in R2, R3 and R4. In all cases, a repeated application of a self-squaring function will result in either an escape to infinity or convergence to a finite limit point called the attractor. The initial values of the function f(z) determine the existence or lack of finite points. When the application remains on the boundary of some object, it defines the so-called Julia sets.
Fig. 2.8. Mandelbrot and Julia sets.
In general, we can locate fractal boundaries by testing the behaviour of the model for a selected set of positions in either the Z or the C space. Very famous fractal shapes are obtained from the Mandelbrot and Julia sets (Fig. 2.8) of the complex values Z that do not diverge under the squaring transformation [4,72]. In order to display escape-time fractals, we have to map pixel colours according to the rate of divergence of the corresponding points in the complex plane (for flat images).
20
Iterated Function Systems for Real-Time Image Synthesis
Fig. 2.9. Sample generalized quadratic escape-time fractal.
Fig. 2.10. Sample quaternion Julia set.
A generalized set of quadratic equations can be treated as a generator of an infinite variety of fractal images, including spirals (Fig. 2.9). The ‘production’ of fractals can be fully automated [123]. In order to represent escape-time fractals in higher dimensions,
Fractal Models for Image Synthesis – a Survey
21
researchers have introduced the volumetric Mandelbrot and Julia sets (Fig. 2.10) defined with quadratic polynomials in quaternions [124–128]. Rochon proposed a cummutative generalization of complex numbers called bicomplex numbers to render volumetric escape-time fractals such as the Mandelbrot set and filled Julia sets [129].
Fig. 2.11. Quadratic 3D escape-time fractal.
Fig. 2.12. Sample scene composed with 3D escape-time fractals.
An extension of a generalized quadratic mapping to the 3D and 4D spaces results in a variety of volumetric escape-time fractals characterized by smooth and balanced shapes (Fig. 2.11). Such fractal solids are similar to amorphous shapes very often met in natural conditions (boulders, gravel, etc.).
22
Iterated Function Systems for Real-Time Image Synthesis
A CG application that generates self-squaring volumetric fractals requires considerable computation resources. It takes time to evaluate the iteration complex function and to test the divergence of points in the R3 and R4 spaces. In order to display already rendered volumetric fractals, we need either to apply voxel representation or to convert the volume data set to the corresponding isosurface. The set of voxels presents several challenges for illumination modeling and data storage. Decent-quality colour images need at least 1000×1000×1000×32 bits (RGBALPHA), which equals four gigabytes per one fractal representation. This is hard to deliver in real time. The isosurface model is more appropriate, since the same quality of image can be limited down to 100,000 vertices. The mesh can be easily shaded and ported to any 3D modeling environment (Fig. 2.12, and Fig. Plate 1), but we still face some problems with the texturing of such fractal objects [130,131]. A number of geometric inversion transformations can be applied to create intricate shapes. The procedure starts with an initial set of points in two or in three dimensions. Non-linear inversion operations are applied to transform the points into a fractal structure [33]. We can create various fractal shapes starting with sets of CG primitives such as lines, circles, spheres or with any arbitrary shapes in the 3D space. 2.2.4 Shape Grammar for Fractal Shapes Shape grammars are sets of production rules that can be applied to any initial image to add details that correspond to the original shape. This feature comprises the statistical self-similarity of the object, which is a key feature of any fractal. Usually, shape grammar transformations are applied to a collection of Euclidean shapes. They alter their geometry or change other surface characteristics like colour, bumps or the alpha channel (Chapter 1). Again, like in the L-systems mentioned earlier, given an initial object and a set of alternative production rules we can create selfsimilar shapes (Fig. 2.13). We can experiment with the iterative process of modeling [132,133]. The user controls the design process. Simple randomness, when introduced, does not yield interesting results. Some researchers have combined shape grammars with Genetic Programming (GP) algorithms [91,134]. The selection of required features, the cloning and multiplication of production rules with introduced random mutation can lead to unexpected results. This was a basis for many interactive artistic CG installations [88,89,91].
Fractal Models for Image Synthesis – a Survey
23
Fig. 2.13. Sample object generated with mutations.
2.2.5 Particle Systems and Fractal Structures Particle systems are widely used in computer graphics for modeling dynamical behavior of a large number of relatively simple objects [135–139]. Fluid flow, explosions of bonfire, gas and smoke are usually based on particles. Random processes, usually with the Gaussian distribution, are used to generate large numbers of particle objects within a well-defined region of space. Over time, the parameters of particle objects such as location, direction, velocity, mass, elasticity and others are modified according to the pre-defined “environment” conditions (like the gravity field or the speed of wind). At some random time, each object is deleted or a new particle is introduced. Particle shapes may be represented by pixels, voxels, CG primitives (Fig. 2.14) or any arbitrary meshes. A particle system as a set of separated elements can be attached to polygonal meshes. All elementary particles change their attributes according to external forces. When attached to some pre-defined structure, particles possess a certain topology (Fig. 2.15). Each particle node of the structure is connected to a limited number of the neigbouring particles. The system is ‘elastic’ and the movement of particles is usually limited by ‘springs’ constraints with material-dependent features. Such a system is called the mass-spring system [33,135].
24
Iterated Function Systems for Real-Time Image Synthesis
Fig. 2.14. Particle system visualized with fractal volumetric CG primitives.
Fig. 2.15. Particle system attached to a spring-controlled mesh.
Fractal Models for Image Synthesis – a Survey
25
It can be rigid (the so-called rigid body) or elastic (the soft body). The latter one is used to simulate cloth, fur and other elastic structures [68]. Such a class of particles shows fractal properties under cerain conditions. The size and shape of particles may vary randomly or may be expressed as a function of time. Other parameters such as colour or transparency can vary randomly or according to some pre-defined function. When the paths of particles are stored, we can apply CSG operations or shape extrusion in order to model “elastic” structures (Fig. 2.16). This technique is very popular in 3D shape construction. 3D design environments offer a set of extrusion tools that help designers to create complex amorphous shapes with procedural rendering. Particle paths can originate within a primitive shape and might be textured with several layers, including the image texture, bump maps, transparency and specular channels. A complete artificial scenery can be modeled with particle-based grass, particle mountains and particle clouds [137].
Fig. 2.16. Particle trajectories that are linked with CSG primitives.
2.2.6 Diffusion-Limited Aggregation We can find many fractal structures that are formed from the aggregation of particles including sediments, moss and coral reefs. The research area covers chemistry (polymers), materials science and biology [76,140–143]. The modeling process is based on the fBm of particles in either the 2D or the 3D space.
26
Iterated Function Systems for Real-Time Image Synthesis
Fig. 2.17. Sample dendrites generated with the DLA.
Fig. 2.18. Volumetric structure generated with the DLA in the 3D space.
Fractal Models for Image Synthesis – a Survey
27
Diffusion-limited aggregation (DLA) is not hard to model numerically. First, an initial structure is placed within a specified region of space. The initial structure, unlike in particle systems, does not perform any movement. The next step is to generate a number of particles in the surrounding space (usually in a distance not larger than 500 times the size of a particle) [144]. In order to obtain better results, we need to use the Gaussian distribution of particle placements. All generated particles can move according to fBm paths. There are two possible cases: A particle either leaves the aggregation area or moves constantly inside the region. Eventually, the particle gets close to the initial structure, sticks to it and becomes its integral part. The particles that left the region of interest are simply cancelled. The process continues until the last particle leaves the region or becomes a part of the cluster formed from the initial structure and all aggregated particles (Figs. 2.17 and 2.18). The rendering process may take a long time to complete the scene. Therefore, some optimizations can be applied to speed up the process of cluster construction. We can enforce particles to move in a specified direction with greater probability than in other directions. We can adjust the minimum distance of the movement. We can allow particles to get closer to the initial structure, thus making a dense fractal structure. DLA is used in computer graphics to model cluster-like structures: moss, lightings and cracks in stones [144]. We can also analytically solve Laplace’s density equation for electrolytes in order to visually simulate DLA structures [145]. 2.2.7 Cellular Automata Cellular automata (CA) methods have been developed to perform the simulation and analysis of complex interactions through relatively simple rules of inter-cell interactions.
Fig. 2.19. Sample image generated with cellular automata.
28
Iterated Function Systems for Real-Time Image Synthesis
Fig. 2.20. Sample ecological model generated with cellular automata.
They are discrete dynamical systems whose behaviour is completely specified in terms of the local relation. The CA space is represented by a uniform grid with each site or cell containing a limited number of information. The time of simulation advances in discrete steps, and the rules of transformation are usually expressed with a simple recipe. Given a suitable recipe, a whole hierarchy of structures and phenomena is modeled. There are various types of cellular automata including: • Totalistic cellular automata. They are one-dimensional CAs (S,δ) where some function f:N→N defining δ exists, where δ(s1, s2, s3) = f(s1+ s2+ s3). S is a finite set (the CA space) and δ is the local transition function for δ(s, …, s) = s [146–149]. • Linear cellular automata. They fulfill the superposition principle. Linear CAs are usually represented by space-time diagrams, and their global function is an endomorphism. The simulation procedure is based on a limited region of space that forms a mesh of cells. A number of objects is placed either randomly (with a given distribution) or manually. Each cell is empty or occupied by an object. In the simplest case, the cell is emptied or filled with a selected object with some probability p. The final structure is obtained after several iterations, where each cell of the mesh is checked (Fig. 2.19). The structure depends on the probability p. For p = 0 we obtain an empty space, and for p = 1 we get a completely filled space. For 0 < p < 1 we get various structures with the density growing with p. At some critical value pc ≈ 0.59 we can observe a rapid formation of clusters of the occupied cells. The process is called percolation and is described in the literature [150]. More complex models can be constructed with CA. When we permit interactions between cells we obtain simulations (Fig. 2.20) of ecological models [151,152]. Cellular automata models can be used for texture generation, image refinement and a simple placement of other CG models in space according to the rules of ecology. CA application areas include the simulation and analysis of microwave propagation and the
Fractal Models for Image Synthesis – a Survey
29
distribution of plants in ecological models, astrophysics and cosmology models [153–161]. Yang used cellular automata in image processing and refinement [162]. 2.2.8 Strange Attractors for Fractal Models Dynamical systems and non-linear systems have been under constant development over the recent decades. The mainstream of applications is placed in control systems and control theory [163]. The experiments of Lorentz, Henon and other researchers led to the definition of the butterfly effect [164]. Small variations in the initial conditions of a non-linear model result in huge and dynamic transformations in the concluding events.
Fig. 2.21. Lorentz ‘butterfly’.
Fig. 2.22. Sample strange attractors.
Deterministic chaos, chaos game and chaos theory are focused on the investigation of such non-linearities [165–167]. Lorentz used a sensitive set of different
30
Iterated Function Systems for Real-Time Image Synthesis
back-propagation equations to obtain a simulation model [168,169]. If we plot model trajectories in the 3D space, the Lorenz ‘butterfly’ is clearly visible (Fig. 2.21). The model never exactly repeats itself, and a weaving object is formed from trajectories that do not intersect each other. The motion seems to be random, but it is actually purely deterministic, with changes introduced by floating-point rounding errors. Strange attractors (named after their intrigue shape) (Fig. 2.22) are used to model non-linear graphics objects and for pattern generation [92].
3. Iterated Function Systems – the Model Iterated function systems theory defines mathematically some concepts of chaos and irregularity. The research done mainly by Barnsley led to significant new methods for image understanding [21,72,73,170,171]. Other researchers followed those ideas and focused on special characteristics of IFS fractals such as measures over IFS attractors [8,9,12,22]. IFS description provides a potential new method for researching the image shape and texture. It forms, through a set of simple geometric transformations, a basic set of tools for interactive image construction. This chapter covers mathematical background of iterated function systems. The n-dimensional IFS model is introduced as a basis for CG applications described in this monograph. Several extensions to the classical IFS are discussed as well. Recurrent iterated function systems, partitioned iterated function systems, polar iterated function systems, selfcongruent IFSs and super IFSs are addressed in a concise form. 3.1 Background Iterated function systems are based on the mathematical foundations laid by Hutchinson [22,72]. IFS fractals have an elegant recursive definition: A fractal is constructed from a collage of transformed copies of itself; it is inherently self-similar and infinitely scalable. The transformation is performed by a set of affine maps. An affine mapping of the plane is a combination of a rotation, scaling, a sheer and a translation in R2 (Fig. 3.1). 2
2
Any affine transformation ω : R → R of the plane has the form
⎛ x′⎞ ⎛ x ⎞ ⎛ a11 a12 ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟+⎜ ⎟ ⎜ ⎟= ω⎜ ⎟=⎜ ⎝ y′⎠ ⎝ y ⎠ ⎝ a21 a22 ⎠⎝ y ⎠ ⎝b2 ⎠ where ( x, y )( x′, y′) ∈ R The matrix
2
(2)
are any points on a plane.
⎛ a11 a12 ⎞ ⎜ ⎟ ⎝ a21 a22 ⎠
(3)
is a combination of a rotation, rescaling and a sheer, usually described by linear equations. They can be also described by other, non-linear equations [172]. The vector
⎛ b1 ⎞ ⎜ ⎟ ⎝b2 ⎠ defines the translation part of the transformation.
(4)
32
Iterated Function Systems for Real-Time Image Synthesis
Since the mapping is usually done on points with Cartesian coordinates, we can put the matrix (Eq. 2) in the form
⎛ M x cos θ x −M y sin θ y ⎞ ⎜ ⎟ ⎝ M x sin θ x M y cos θ y ⎠
(5)
where Mx, My are magnification (scaling) factors applied to the X and Y axes; θ x , θ y refer to the rotation of the axes. According to the Hutchinson model, there might be several functions ωi defined in a compact metric space F [22,72].
Fig. 3.1. Geometric transformations implemented in the IFS model.
Definition 1 Let (F, d) be a complete metric space. Let ωi : F→F be a collection of mappings ( ωi ; i = 1,2,…, N). Then Ω = {F,( ωi ); i= 1, 2, ..., N}
(6)
is called the iterated function system. The functions ωi need to be affine and contractive. An affine transformation ωi is contracting if there is a number si where 0≤ si < 1 so that the distance between any two points (x1,y1) and (x2,y2) on the plane is contracted by at least a factor si .
Iterated Function Systems – the Model
33
Definition 2 Let (F, d) be a complete metric space. Let ωi : F→F be a collection of mappings ( ωi ; i = 1,2,…,N). Then a mapping ωi is called contractive if there exists a positive real number 0 ≤ si < 1 such that
∀ ( x, y ) ∈ F , d( ωi (x), ωi (y)) ≤ si d(x,y)
(7)
For a contracting transformation described by Eq. 2 and acting on a plane R2, the contraction ratio of the affine transformation is given by
s = α+ β+ ( α− β ) + γ 2 2
where
2 α = ( a112 + a21 ) / 2, β = ( a122 + a222 ) / 2, γ = a11a12 + a21a22
(8)
(9)
We can say that an iterated function system on the plane is given by a finite collection of contractive affine transformations acting on a metric space. There are no particular conditions imposed upon the maps. A set of affine transformations (Eq. 6) is accompanied by respective contraction factors (si; i = 1,2, …, N). An essential feature of an IFS is its unique attractor set A. A is a fractal, which is closed and bounded [22,72]. Theorem 1 Contractive mapping fixed-point theorem. Let (F, d) be a complete metric space. Let ωi : F→F be a collection of mappings ( ωi ; i = 1,2,…, N). Then Ω = {F,( ωi ); i = 1, 2, ..., N} has a unique fixed point called the attractor A. Definition 3 Let Ω = {F,( ωi ); i = 1, 2, ..., N} be a hyperbolic IFS with contraction factors (si; i = 1,2, …, N). An IFS Ω is hyperbolic when all transformations ωi are contractive, i.e. all 0 ≤ s i < 1. The contraction ratio of Ω is the minimum of all contraction ratios si : s = min(si; i = 1,2, …, N)
(10)
Definition 4 If an IFS Ω = {F,( ωi ); i = 1, 2, ..., N} is contractive, there exists a unique set N
A = ω( A) = ∪ ωi ( A) i=1
called the fixed point (the attractor) of Ω .
(11)
34
Iterated Function Systems for Real-Time Image Synthesis
Fig. 3.2. IFS model for the Sierpinski gasket and the associated attractor.
The uniqueness of an attractor A (Fig. 3.2) for contractive iterated function systems is a result of the contractive mapping fixed-point theorem for the mapping ωi acting on a space (P(F), dH), which is contractive according to the Hausdorff distance dH [22,173,174]. Definition 5 The Hausdorff distance between two subsets A and B of F is defined by
d H ( A, B) = max(max(min d ( x, y)), max(min d ( x, y))) x∈ A
y∈ B
y∈B
x∈ A
(12)
The iterated function system can be treated as a subset of general dynamic systems, which can have fixed points usually called strange attractors (Chapter 2.2.8). If we keep the contraction rations si close to 1.0, we can observe that the IFS behaves like a classic non-linear system. Definition 6 An iterated function system Ω on a plane is given by a finite collection of contractive affine transformations ωi : R2→ R2 for all ( ωi ;i = 1,2,…, N). An IFS with probabilities is an IFS such that each ωi is assigned a probability pi with p1+p2+…+pN = 1: Ω = { R2,( ⎤ i , pi); i = 1, 2, ..., N}
(13)
Iterated Function Systems – the Model
35
Fig. 3.3. Sample visualization of measures over the Sierpinski gasket from Fig. 3.2.
An IFS with probabilities determines a unique normalized measure, i.e. a unique image on the plane (Fig. 3.3) called the invariant measure of the IFS [8,9,22,72]. Therefore, we can say that the IFS encodes this measure or image. The existence and uniqueness of the invariant measure are shown in [72]. The average contraction condition allows us to obtain attractors for a nonhyperbolic IFS: Definition 7 Let the iterated function system Ω = { R2, ( ωi , pi); i = 1, 2, ..., N} be a non-hyperbolic IFS with probabilities. Let the IFS have contraction factors (si;i = 1,2, …, N). The IFS model is contractive and posseses a unique fixed point called its attractor A when the average contraction condition is obeyed:
s1 p1 i s2 p2 i...i sN pN < 1
(14)
A specific class of iterated function systems contains the so-called condensation sets. Definition 8 Let (F, d) be a complete metric space and let C ∈ H ( F ) . Define a transformation ω0 : H(F)→H(F) by ω0 (B) = C for all B ∈ H ( F ) . Then ω0 is called a condensation transformation and c is called the associated condensation set. The condensation transformation is a contraction mapping ω0 : H(F)→H(F) on the metric space (H(F),dH) where the contractivity factor is equal to 0 (Fig. 3.4). This transformation possesses a unique fixed point called the condensation set [22].
36
Iterated Function Systems for Real-Time Image Synthesis
Fig. 3.4. IFS fractal with a condensation set.
Definition 9 Let the iterated function system Ω = {R2,( ωi ); i = 1, 2, ..., N} be a hyperbolic IFS. Let the IFS have contraction factors (si;i = 1,2, …, N) 0.0 ≤ si < 1.0. Let ω0 : H(F)→H(F) be a condensation transformation. Then Ω = {R2,( ω0 , ωi ); i = 1, 2, ..., N} is called a hyperbolic IFS with condensation and is usually denoted by the symbol IFSC. Theorem 2 Let the iterated function system Ω = {F,( ωi ); i = 1, 2, ..., N} be a hyperbolic IFS with a condensation set C with contraction factors (si;i = 1,2, …, N) 0.0 ≤ si < 1.0. Then the transformation H(F)→H(F) defined by N
W ( B ) = ∪ ωi ( B ) ∀B ∈ H ( F )
(15)
i=0
is a contraction mapping on the complete metric space (H(F),dH) with contraction factors: (16) h (W ( B) ,W (C )) ≤ sih ( B, C) ∀B, C ∈ H ( F ) Its unique fixed point A ∈ H ( F ) obeys N
A = W ( A) = ∪ ωi ( A) i=1
(17)
Iterated Function Systems – the Model
37
and is given by
A = lim ω0 n ( B) for n→∞
B ∈ H (F )
(18)
Condensation transformations can be found useful in modeling some structures of plants or can give an illusion of perspective to IFS fractals (Fig. 3.5). However, their manipulation is not very intuitive and causes problems in the application of the collage theorem (Chapter 4).
Fig. 3.5. Sample IFS fractal with a condensation set that mimics perspective projection.
3.2 n-Dimensional Iterated Function Systems The classical iterated function systems operate on a plane. However, modern computer graphics models are often described in abstract n-dimensional vector spaces including a three-dimensional image space (space coordinates) and, usually, a threedimensional colour space (for RGB models). To evaluate those representations in fractal image modeling, we can introduce the n-dimensional iterated function system (the nD IFS), which can serve as a basic model for several CG applications. The nD IFS will consist of affine transformations acting in the Rn space. Analogously to the IFS on a plane (Eq. 2), each affine transformation
ω : R n → R n of the nD space has the form
38
Iterated Function Systems for Real-Time Image Synthesis
⎛ x′⎞ ⎛ x ⎞ ⎛ a11 a12 " a1n ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ a2 n ⎟⎜ y ⎟ ⎜b2 ⎟ ⎜ y′⎟= ω⎜ y ⎟=⎜ a21 a22 + ⎜ # ⎟ ⎜# ⎟ ⎜ # % # ⎟⎜ # ⎟ ⎜ # ⎟ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎝ n′⎠ ⎝ n ⎠ ⎝ an1 an 2 " ann ⎠⎝ n ⎠ ⎝bn ⎠
(19)
n
where ( x, y,..., n) ∈ R is any point in the nD space. The matrix
⎛ a11 a12 " a1n ⎞ ⎜ ⎟ a2 n ⎟ ⎜ a21 a22 ⎜ # % # ⎟ ⎜ ⎟ ⎝ an1 an 2 " ann ⎠
(20)
is a combination of different operators. All of them act in the space of the image (x,y), where we can easily recognize rotations, rescaling and a sheer (as in Eq. 2). The remaining n-2 spaces have meaning that depends upon the application (see Chapter 6). The vector (21) (b1, b2, …., bn) determines the translations on a plane and defines the basic values for the other components. Definition 10 Let (Rn, d) be a complete metric space. Let ωi : Rn → Rn be a collection of mappings ( ωi ; i =1,2,…, N) described by Eq. 14. Let all ωi have associated probabilities pi, where p1+p2+…+pN = 1. Then Ω={ Rn,( ωi , pi); i = 1, 2, ..., N}
(22)
is called an nD iterated function system. Definition 11 A mapping ωi : Rn → Rn from a metric space (Rn,d) is called contractive if there exists a positive real number 0 ≤ si < 1 such that
∀ ( α1 , α2 ) ∈ R n , d( ωi (α1), ωi ( α2)) ≤ si d(α1, α2)
(23)
where (α1, α2 ) are points in Rn and d is a distance measured in the nD space. It is extremely hard to keep all si factors below 1 for an n-dimensional IFS model. The entire problem of si estimation is much more complicated for the nD case (contrary to the 2D case described by Eq. 7). Naturally, we can try to construct a model
Iterated Function Systems – the Model
39
based on Cartesian-like coordinates (Eq. 4) and keep all Mx, My, …, Mn magnification factors below 1. The problem is still not trivial for nD IFS cases. The proof that a hyperbolic IFS posseses a fixed point falls beyond the scope of this monograph. For practical applications, we can use the average contraction condition: Definition 12 Let the iterated function system Ω = {Rn,( ωi , pi); i = 1, 2, ..., N} be a non-hyperbolic IFS with probabilities. Let the IFS have contraction factors (si; i = 1,2, …, N). The IFS is contractive and posseses a unique fixed point called its attractor A when the average contraction condition (Eq. 14) is obeyed. The non-hyperbolic nD IFS has an attractor even for the cases when some contraction ratios si > 1. If only one (sj, j = 1,2, …, N where j i) is small enough, sj 0 . Then {ωj, pij;i,j = 1,2, …, N} is called a recurrent IFS. A recurrent IFS encodes N images on X, which can be superimposed to produce a single image. Suppose that for N copies of the unit square X, denoted by Xxj with
40
Iterated Function Systems for Real-Time Image Synthesis
j= 1,2, …, N, for each j we obtain an image μj. In vector notation we can encode an
( )
N-image by μ= μ j
j
= ( μ1 , μ2 ,..., μN ) , where μ is called a vector RIFS
image [173].
Fig. 3.6. Interactive manipulation of the RIFS fractal.
Each point in the RIFS attractor has one or more unique addresses associated with it. These addresses can be used to parametrize the attractor. An RIFS attractor whose points have unique addresses is necessarily disconnected. Not all disconnected attractors have points with unique addresses, though. It is possible to compute the address of any point belonging to the attractor. We have to create a hierarchy of bounding disks for the RIFS attractor. Each application of the Hutchinson operator to the bounding disks creates up to N times smaller bounding disks that tightly bound the attractor. By establishing a hierarchy of the bounding disks, it is possible to restore the address of the selected point P belonging to the attractor. The RIFS model permits a direct manpulation of the fractal (Fig. 3.6). There are several advantages of such a representation. The most interesting one is the possibility to write a finite IFS rendering algorithm (see Chapter 5). 3.3.2 Partitioned Iterated Function Systems Partitioned iterated function systems (PIFSs) are utilized in open-source fractal image compression schemes [177–182]. Definition 14 Let (F, d) be a complete metric space. Let D ⊂ F be a set of domains. Let W: D→F be a set of contractive transformations. Then Ω = {F,( ωi ); i = 1, 2, ..., N} where ωi ∈ W is a partitioned iterated function system.
(25)
Iterated Function Systems – the Model
41
By the contractive mapping fixed-point theorem (Theorem 1), Ω has a unique fixed point A, called the attractor of the PIFS. To solve the image encoding problem, we have to find a PIFS such that its attractor is as close to the encoded image I ⊂ F as possible. Therefore, we require W to minimize the distance between the fixed point A and the encoded image I. 3.3.2.1 Image Coding Definition 15 Let I be an image to be encoded by the PIFS. A set R of nonoverlapping range cells R = (r1, r2, ..., rN), ∀ ri ∩ rj = ∅ is called the range pool of i≠ j
I: N
I = ∪ ri
(26)
i=1
Definition 16 Let I be an image to be encoded by the PIFS. A set D of overlapping domain cells D = (d1, d2, ..., dN) is called the domain pool of I: N
I = ∪ di
(27)
i=1
A set W consists of contractive affine transformations ( ωi ; i= 1, 2, ..., N), which for each range cell map on it the corresponding domain cell:
ωi : di →ri for i = 1, 2, ..., N
(28)
For a compact representation, W is usually restricted to a limited class of transformations [178,181]: ri = ωi (di) = siφ(di) + oi
(29)
where φ is a real value of the spatial contraction function which contracts the domain cells to the size of the range cells, si is a real value of the contraction function for image measure ( 0 ≤ si < 1 ) and oi is a real value of an offset factor that determines the translation. The triplets (φ, si, oi) are called PIFS transform parameters. The general imageencoding problem can be intuitively described as follows: Step 1 Partition the image I into non-overalapping range cells R (Definition 15) that tile the whole I; Step 2 For each range cell ri ∈ R , find a domain cell d i ∈ D (Definition 16) and transform the parameter triplets (φ,si,oi) such that the distance d(ri, siφ(di) + oi) is minimized; Step 3 Save the transformation parameters (φ,si,oi).
42
Iterated Function Systems for Real-Time Image Synthesis
The process of image coding results in a set of contractive affine transformations W such that its attractor A is a close approximation to the image I. Thus, W defines a lossy code for the image I [177]. Fractal encoding is a complex process because of the searching part of the algorithm (Step 3). The fractal image compression scheme was introduced to encode grayscale images. In most cases, textures are colour images written in a format based on the RGB colour space. To take advantage of human insensitivity to colour changes, we can convert a texture to the YUV colour space. The YUV colour space is composed of three channels: the luminance channel Y and two chrominance channels: U (hue) and V (saturation). The chrominance channels store information about colour, and it is possible to compress them with little to no visible degradation. The overall scheme for fractal image texture compression consists of the following steps: Step 1 Convert the texture colour space to the YUV colour space; Step 2 Average the chrominance channels (hue, saturation) to one half; Step 3 Set the minimum quad tree depth qmin , the maximum quadtree depth
⎡1,..., qmin ⎤ qmax and the search region depth qsearch ∈⎣ ⎦ (Fig. 3.7, Fig. 3.8); Step 4 For each component Y, U’, V’, use the quadtree partitioning method and the region search strategy; Step 5 Save the header information: the quadtree depth, the number of transformation for each component, texture resolution, …; Step 6 Save the quantized transform parameters with the quadtree information for each component using a variable-length code. The independent processing of each YUV component makes it possible to utilise parallel processing during the process of texture compression and decompression.
Fig. 3.7. Quadtree partitioning.
Iterated Function Systems – the Model
43
Fig. 3.8. Decomposition of part of the Lenna image.
Attempts to improve searching algorithms focused on domain classification and feature extraction [171,178]. The local self-similarity of images can be exploited to improve the efficiency of domain searching mechanisms. The nearest-neighbour search strategy accompanied by a quad tree image partitioning can increase the overall performance of fractal image compression [179]. 3.3.2.2 Image Decoding The most efficient image decompression scheme is the hierarchical decoding introduced by Bahrav [177]. He stated that the PIFS can be decoded not into a single image space but into separate decoding spaces, yielding different attractors in each space. The collection of fixed points is called a pyramid of PIFS attractors [181]. The general idea of the hierarchical PIFS decoding algorithm can be described in two steps: Step 1 Compute either iteratively or directly (with the deterministic iteration algorithm) the top-level fixed point; Step 2 Advance from the coarser to the finer (higher) resolution until the required size of the rendered image (the attractor A) is achieved. The hierarchical method is one order of magnitude less computationally expensive than the iterative method based on the deterministic iteration algorithm (Chapter 5). Fractal image compression is based on geometrical relations in images. The input data for the fractal decompression scheme come from the presented fractal compression scheme. We can decompress texture blocks whose size depends on the search region size used during the compression. The decompression scheme utilises the hierarchical decompression method. In the first step, transformations for a given texture block (the range block and the domain block size) are scaled by a factor
44
Iterated Function Systems for Real-Time Image Synthesis
1/ 2max (where 2max × 2max is the size of the biggest range block) in order to
approximate the top-level fixed point of the PIFS pyramid (these step can be omitted if we perform this calculation before saving the coefficient to the file). At the top level, we apply the transformation only once to the level gray texture in order to 1/ 2max
. Then we double the resolution by multiplying approximate the fixed point f the transformation by a factor equal to 2, and then we apply the transformation. The process is repeated
log 2 (2max ) times.
The overall decompression process for a given image texture block may be written in the following steps: for each YUV component (assuming that the U, V components are averaged to one half): max
– optional; Step 1 Multiply the transformation by a factor of 1/ 2 Step 2 Apply the transformation to the top level; Step 3 Multiply the transformation by 2; Step 4 Apply the transformation; Step 5 Repeat Steps 3 and 4 until the required resolution is achieved (Fig. 3.9); Step 6 For the U, V components, multiply the transformation by 2 and apply the transformation.
Fig. 3.9. Several steps of the decoding image Lenna (sampled with the Dellanuay triangulation).
Fig. 3.10. Sample images encoded with the PIFS.
Compared to two popular lossy image compression schemes: DCT (JPEG) and the wavelet-based one (JPEG 2000), PIFS images do not display block artifacts or blur in
Iterated Function Systems – the Model
45
close-ups and offer quite decent compression ratios and PSNR characteristics (Fig. 3.10, Table 1). Table 1. Performance of image compression methods. FCI – fractal compression of images *CR – compression ratio, PSNR – peak signal-to-noise ratio Image Leaf Sky Lenna
FCI CR 187.7:1 139.8:1 74.1:1
PSNR 33,8 32,4 26,7
JPEG CR PSNR 39.7:1 34,3 33.6:1 33,5 24.1:1 27,8
JPEG2000 CR PSNR 191.3:1 34,4 181.5:1 33,6 77.9:1 28,58
The artifacts in PIFS images are in the form of some fringes on high-contrast edges. This is visible for straight lines/contours and for high compression rates. For most natural images, those artifacts are not visible [181]. Unfortunately, the PIFS is an asymmetric encoding/decoding scheme, where the time and memory resources for image compression are much more extensive than for the decompression process (which is relatively simple). PIFS images have the special property of superresolution. It means that the PIFS encoded and decoded image can have resolution higher than the original image. This property can be treated as image-based modeling of the image texture, hence the more detailed description of the PIFS model in this section. 3.3.3 Polar Iterated Function Systems The main difficulty with iterated function systems arises when the contractivity factor s of the IFS is close to 1. The IFS becomes then a dynamical system. If the contraction ratio is larger than 1, the fixed point does not exist and we cannot obtain the image of the IFS attractor. There is no general analytic way to check the contraction of non-linear iterated function systems. Experimental tests require very heavy computations resulting in only an approximation to the s factor. In order to enforce the contraction of the non-linear IFS, the so-called polar iterated function systems have been proposed [183,184]. Definition 17 Let (F, d) be a complete metric space with a mapping as a collection of mappings ( ωi ; i = 1,2,…, N), where ωi : F→F is called locally contractive with respect to the point P if there exists positive real 0 ≤ si < 1 such that
∀M ∈ F , Pwi ( M ) < si PM
(30)
The smallest of numbers si is called the local contraction ratio of ωi . The local contraction does not imply the global contraction (as described by Definition 7).
46
Iterated Function Systems for Real-Time Image Synthesis
If we consider a locally contractive mapping ωi with a fixed point P, then the point can be represented by a pair (ρ, Θ) of coordinates centered on P: PM = ( ρ cos θ, ρ sin θ )
(31)
The local contraction condition becomes a contraction condition on the onedimensional function giving ρ. Definition 18 A polar IFS on a plane is a set of locally contractive transformations ( ωi ;i = 1,2 ,…, N) such that each ωi : R2→ R2, and ωi is defined by the polar coordinates Pi by two one-dimensional functions Fi and Gi:
⎛ t k ⋅ F ( ρ, θ ))+1⎞ ⎛ ρ⎞ ⎜ ρ h ( i i ⎟ ωi⎜ ⎟ =⎜ 2 ⎟ ⎝ θ ⎠Pi ⎜ ⎟ ( ) Gi ρ, θ ⎝ ⎠Pi
(32)
for some real number ki. The particular form of the function ensures the local contraction as
0≤
th ( ki ⋅ Fi ( ρ, θ ))+1 2
fk, where k is the smallest index that satisfies the condition δk ≠ f k . Then we can define the function φF : H → A . Definition 19 Let φF denote the codespace function [22]. Then φF : H → A is continuous onto a function defined by
φF (δ) = lim ωδ1 ωδ2 ... ωδk ( x)
(36)
k →∞
where x ∈ F .
The
set
of
codes
of
a
point
x∈ A
defined
by
φ F ( x ) = {δ ∈ H , φ F ( δ) = x} is compact and posseses a unique largest element −1
τ F ( x ) called the tops function [187].
Fig. 3.14. Illustration of colour mapping with the tops function.
The function τ F : A → H is shift invariant, and there are efficient algorithms for its approximation [187]. The tops function can be used to assign colour to IFS attractors [Fig. 3.14, Fig. Plate 2]. H can be referred to as the colour space. The function will assign to each point x in the A attractor a value of the ‘top’ code of this point ‘stolen’ by τ F ( x ) from the colour space. The colour-stealing algorithm is described in Chapter 5.1.2. The same function can be used to create morphings between IFS attractors. In certain situations, the transformation φG τ F : AF → AG is a homeomorphism. It means
Iterated Function Systems – the Model
51
that φG τ F is a continuous transformation from AF onto AG , and its inverse transformation denoted by τ F
φG is also continuous.
Let V denote the closure of a subset V ⊂ H with respect to some metric dH. Let
EF ( δ) = { f ∈ τ F ( A) : φ F ( f ) = φ F ( δ)} for all δ ∈ F
(37)
Let S F = {EF ( δ) : δ ∈ H } . Then we call a collection of subsets SF the code space structure of the IFS Ω. The fractal homeomorphism theorem includes the situation where two iterated function systems have the same code space [187]. Such a situation is called a homeomorphism of τ F φG . It is possible to create linear continuous transitions between F and G (Fig. 3.15, Fig. Plate 3,4). The method can be used to warp and distort digital images encoded with IFS fractal tops (Fig. 3.16), and rendered with a random iteration algorithm with colour stealing (Chapter 5.1.2) [189]. Superfractals may establish a common ground for both random and deterministic fractal models [190]. Superfractals are a class in themselves and are associated with the underlying hyperbolic iterated function systems. They possess a logical structure called V-variability’ for V = {1,2,3, …} that permits both the extraction of measure and the visualization of IFS attractors. ’
Fig. 3.15. Morphing between two IFS attractors.
52
Iterated Function Systems for Real-Time Image Synthesis
Fig. 3.16. Homeomorphism illustrated by two images encoded by the IFS.
Superfractals provide better control over iterated function systems and may be implemented in morphing, animation and procedural texture generation [189]. Considering the hyperbolic IFS with the probabilities Ω = {F,( ωi , pi); i = 1, 2, ..., N} (Definition 6, Chapter 3), we can define a superfractal as a collection of IFS models: Definition 20 Let (H(F), dH(F)) be a metric space that consists of non-empty compact subsets of F with the Haussdorff metric. Then a selection of hyperbolic IFS
ΩS = {H ; Ω1 , Ω2 , Ω3 ,..., ΩM ; P1 , P2 , P3 ,.., PM }
(38)
where
Ωi = {F , ( ωim , pim ) ; i = 1, 2, 3,..., N }
(39)
is called the super IFS.
Ωi : H → H is a function defined by Ωi ( B ) = ∪ Ωim ( B ) for all B ∈ H for m
each n ∈ {1, 2, 3,..., M } . Ωi : H → H is then a strict contraction mapping that acts
Iterated Function Systems – the Model
53
on higher-order spaces such as H(F). For H ( F ) = H ( F )× H ( F )×... , where V
V −times
V
V = {1,2,3, ...}, fractals are called V-variable fractals and can be denoted by Ω S . The attractor AΩ (Fig. 3.17) of Ω S is a set of sets and is called a superfractal [190]. AΩ has elements that may be extracted by random techniques blended with the deterministic iteration algorithm (Chapter 5.2.2). For B0 ∈ H , we can define a
{ }k=0 by
sequence Bk
∞
Bk+1 = Ωδk ( Bk ) for k = 0,1,2,3,…
(40)
where δk is chosen equal to n with the probability pn. This choice is made independently of all other choices. Each transformation Ω δk is strictly contractive on H(F) with respect to the Hausdorff metric. The
{ }k=0
elements of the sequence Bk
∞
tend to approximate AΩ more and more
accurately with an increasing number of iterations. The asymptotic distribution of Bk depends on the probability measure P (Fig. 3.17). Each iterated function systmem is defined by contractive mappings, and a superfractal has an unlimited number of associated images. It is possible to use this property to create synthetic textures. V-variable fractals may find applications in biological modeling. It is possible to create a brand of selected phenotypes of ‘plants’ and re-create specimens that are individuals but have a recognizable structure (Fig. 3.18) [190].
Fig. 3.17. Two IFS attractors and a superfractal related to their V = 1 superfractal (N = 2, M = 2).
54
Iterated Function Systems for Real-Time Image Synthesis
Fig. 3.18. Breed of attractors that belong to the same ‘phenotype’ of superfractals.
4. Inverse Problem – the Collage Theorem The inverse problem for iterated function systems can be stated as follows: For a given initial image I, we have to find a contractive IFS with the attractor that reproduces this image. From the practical point of view, we rather want the IFS attractor to be as close as possible to a given image for a pre-defined distance function. Since fractal sets generally contain an infinite number of points with a very complex organization, it is not possible to specify exactly where each point in it lies. The approximating set is defined by relations between pieces. The pieces are small copies of the original image of the attractor. The collage theorem (Theorem 3), introduced by Barnsley, is a very useful tool for the simplification of the inverse problem for two-dimensional black-and-white iterated function systems [72]. The collage theorem has been addressed by other researchers as well [191–193]. Theorem 3 Let (F, d) be a complete metric space. Let ωi : F→F be a contractive mapping. Let ε > 0 be given. Let the image I ⊂ F. Choose an IFS Ω = {F,( ωi ); i = 1, 2, ..., N} with contraction ratios 0 ≤ si < 1 so that N
d H ( I , ∪ ωi ( I )) ≤ ε
(41)
i=1
where dH (I, A) is the Hausdorff distance between the image I and the IFS attractor A. Then
d H ( I , A) ≤
ε (1− s)
(42)
If we can make small copies of some initial object I and find a set of transformations – contraction mappings on a space within which the object lies with a minimal overlapping of affine maps, then we can approximate that image with a corresponding IFS set. We must find the reduction factor and translation for each copy. Also, the angle of rotation (if necessary) has to be specified. We also have to decide whether or not the copy is a reflection of the original (Fig. 4.1). In order to get an accurate union or collage, we have to try to minimize the Hausdorff distance between the original object and all copies that are overlaying it. We should minimize the overlapping of the copies and the total number of IFS transformations.
56
Iterated Function Systems for Real-Time Image Synthesis
Fig. 4.1. Construction of the attractor, A – original shape; B, C – scaled and oriented copies.
There are some difficulties with the collage theorem: The fitness depends on the contractions (si; i = 1,2, ..., N) for each mapping ωi . If some transformations are poorly contractive (si is close to 1), the term given by Eq. 42 may become extremely large. The bound seems to become meaningless. The contractivity factor can be easily kept below 1.0 for the 2D IFS consisting of only linear functions. For the nD IFS and the non-linear IFS, the contractivity factor may not be uniform. That makes it impossible to estimate [186].
Fig. 4.2. Hausdorff distance can be counter-intuitive; here dH [ (a),(b)] = d H [ (a '),(b ')] .
The Hausdorff distance is often counter-intuitive. For visually different objects, we can obtain a similar dH value (Fig. 4.2) [183,184]. Computing the Hausdorff distance is also very time-consuming. It is possible to consider other fitness functions like the Euclidean distance between two shapes (or their centres) [186].
Inverse Problem – the Collage Theorem
57
Fig. 4.3. RBG image of the maple leaf, separated channels and the collage theorem applied to one of them.
Fig. 4.4. Reconstruction of the maple-leaf shape.
The collage theorem was originally proposed to solve an inverse problem for binary images on a plane. It presents a challenge to develop a colour version of image-attractor pairs. One way is to process each channel separately and then overlay RGB/HSI components as interpretations (Fig. 4.3) of channel data [194–196]. We can extend the IFS model with transformations in the colour space [197]. The task of
58
Iterated Function Systems for Real-Time Image Synthesis
finding a collage of full-colour image components becomes increasingly difficult, then. The problem is even more complicated for nD iterated function systems. It is extremely hard to find an appropriate set of IFS transformations that are a good approximation to the original image. This is particularly visible in the modeling of plants, where the continuous process of plant growth has no representation in the IFS model [104]. Genetic programming algorithms based on Euclidean metrics were proposed to solve that problem [183,184,186]. It is also possible to find a collage manually. This requires some skills and training in spotting self-similarities in images. To develop a manual IFS designer, we need some interactivity in the application. We can play with iterated function systems either to find a reproduction of the original image (Fig. 4.4) or to create some unique “hand-made” structures (Fig. 4.5). Condensation sets need, however, special attention in the process of IFS construction. The following Theorem 4 tells us that we can continuously change the attractor of the IFS, by adjusting the parameters in the transformations [72]: Theorem 4 Let (F, d) be a metric space. Let ωi : F→F be a contractive mapping. Let ε > 0 be given. Let Ω = {F,( ωi ); I = 1, 2, ..., N} be a hyperbolic IFS with contraction factors 0 ≤ si < 1. For i = 1, 2, ..., N, let ωi depend continuously on a parameter k ∈ K ,where K is a compact metric space. Then the IFS attractor Ak ⊂ F depends continuously on k with respect to the Hausdorff distance dH (d).
Fig. 4.5. Sample abstract IFS shape and an IFS attractor with the condensation set.
Small changes in the parameters describing each IFS transformation wi will lead to small changes in the corresponding attractor (Fig. 4.6). This feature allows us to
Inverse Problem – the Collage Theorem
59
model interactively n-dimensional IFS fractal shapes. We will not lose control over the attractor if we apply small changes to some initial model. Iterated function systems are purely deterministic; therefore, each time we render a given set of IFS parameters we will obtain an identical or statistically similar (for the random iteration algorithm) object. Moreover, we can smoothly interpolate between attractors or dynamically create IFS fractals [198]. It is also possible to generate a time series of different attractors that simulate the growth of plants [105]. Both theorems form a background for interactive image synthesis based on iterated function systems that is discussed in this monograph. Chapter 6 presents sample implementations of nD IFSbased image construction.
Fig. 4.6. Small changes in IFS parameters yield small changes in the attractor.
5. IFS Rendering Algorithms The previous chapter described several representations of iterated function systems. Assuming that the average contractivity is obeyed, all of them should result in a constant point called the attractor of the IFS. There are a number of methods for rendering IFS attractors. The simplest approaches are easy to implement, but are often inaccurate and inefficient. The most widely known procedure is the probabilistic method (the random iteration algorithm) introduced by Barnsley and Demko [21]. The method roughly approximates the attractor very rapidly but requires a considerable amount of time to be completed. The method has been recently developed into the colour-stealing random iteration algorithm that offers an IBR-based colour mapping at IFS attractors [189]. Barnsley developed the deterministic iteration algorithm (DIA) operating on the graphic screen content [72]. The DIA method can be adapted to render a wide variety of superfractals [190]. Dubuc and Elqortobi recognized that only new points of the attractor are necessary to iterate the IFS fractal [199]. Monro and Dudbridge developed the minimal plotting algorithm [200,201]. They proposed grayscale IFS rendering based on the constant mass algorithm [201]. Another algorithm is known from dynamical systems and self-squaring fractals. The escape-time algorithm, to be applied to a general class of IFSs, needs some improvements [72]. Chen applied a vector of IFS transformations that can be generated by the string-rewriting algorithm [202]. The recursive method was proposed to keep the consistency of the rendered volumetric IFS [203]. Bell proposed another recursive, fast and accurate IFS rendering algorithm. It is called the tesseral synecdoche algorithm [204,205]. The accurate fractal rendering algorithm [201] and the model for the evolution of the selfcongruent IFS offer quite interesting applications in the field of fractal modeling [104]. Considering recurrent iterated function systems and partitioned iterated function systems, several measure-based algorithms were developed. The grayscale photo-copy algorithm and the vector recurrent probabilistic domain algorithm are the most representative cases [173]. This chapter covers the most important IFS rendering algorithms. Pseudo-code description is provided along with a discussion on implementation issues. The chapter is concluded with a performance analysis of four selected rendering algorithms applied to volumetric iterated function systems. 5.1 Random Iteration Algorithms
5.1.1 Classic Random Iteration Algorithm The random iteration algorithm (RIA) provides a simple method for a quick construction of the IFS attractor [21,72]. It relies on the generation of a sequence of points qn;
62
Iterated Function Systems for Real-Time Image Synthesis
n=0,1,…, max_no_of_iterations that correspond to an IFS with probabilities (Definition 6, Chapter 3.1). Initially, a point q0 is chosen. It is either arbitrarily defined or chosen from a unit square. Each next point is picked from the set { ω1 ( qn−1 ) , ω2 ( qn−1 ) ,..., ωN ( qn−1 ) }, where the probability of the event qn = ωi ( qn−1 ) is pi. Elton showed that the points progressively approach the attractor, regardless of the starting point [201]. Usually, we ignore the first iterations (min_no_of_iterations), assuming that the remaining points are very close to the final attractor. The best solution is to start iteration from the fixed point of one of IFS transformations. Fixed points are always part of the IFS attractor. The RIA can be described by the following pseudo-code: Choose the initial point q0 For i=1 to max_no_of_iterations do Begin Choose k randomly from the range(1,2,…,N) Apply q=wk(q0) Apply q0=q If i>min_no_of_iterations then Plot q End for i. The points q, and q0 may be described on a plane by the pair (x0,y0) and (x,y), which may be either real coordinates or integer values for on-screen rendering. The transformation ωk can be put in the form described by Eqs. 1 and 4. When max_no_of_iterations is sufficiently large, the points rendered by the RIA approximate the IFS attractor (Fig. 5.1).
Fig. 5.1. Various stages in the RIA construction of the attractor (1,000, 10,000 and 1,000,000 iterations).
IFS Rendering Algorithms
63
A variation of this algorithm counts how many points do fall inside each pixel. At the end of rendering, this count, when suitably weighted, can give an image of the measure μ of each (Fig. 5.2) pixel [198]. In order to use the random iteration algorithm properly, we have to fix two numbers: min_no_of_iterations and max_no_of_iterations. The first parameter defines how many initially rendered points are skipped, and the number 100 is more than enough for practical cases. The second parameter determines the total number of the points rendered. For the IFS with probabilities, the parameter depends on the structure of the fractal and the resolution of the view-port. In order to simplify the numerical version of the RIA, all probabilities pi are assigned the same value and are not included in calculations. For such cases, the number of iterations giving a decent quality of the fractal image is usually seven to eight times the number of pixels (for the typical disjoint and non-overlapping IFS fractals).
Fig. 5.2. Grayscale representation of measures on the Sierpinski type of the IFS attractor.
If we assume that the view-port has a horizontal×vertical (H×V) resolution, then the total number of points necessary to render the IFS attractor will be roughly max_no_of_iterations = H × V × 8
(43)
If we want to zoom in on the image of the IFS attractor or collect a measure μ over each pixel in the image, we need to multiply this value by the ZOOM and PEPP factors. ZOOM is the zooming factor (Fig. 5.3) and PEPP defines the maximal number of points expected per one pixel: max_no_of_iterations = H × V × 8 × ZOOM × PEPP
(44)
64
Iterated Function Systems for Real-Time Image Synthesis
Fig. 5.3. Zooming applied to the RIA – the rendered IFS attractor.
It is also possible to estimate the total number of iterations with the help of the Euler constant for large image resolutions [203]. If we consider an idealized case where all pixels have equal probabilities to be visited and the attractor is a jousttouching or disjointed IFS fractal, then the total number of points can be calculated as max_no_of_iterations = (H × V)ln(μ × (H × V))
(45)
where μ is the Euler constant 1.78107 for large (H × V). The parameter max_no_of_iterations can reach enormous values for extensive zooming and great depth of colour per pixel. The RIA is not suitable for the nD IFS because at each iteration the RIA generates a slightly different set of points, thus causing IFS image inconsistency. All images of IFS attractors generated by the RIA are statistically self-similar, but the local values of the IFS attractor are different. We obtain a fuzzy image of a volumetric attractor then (we have to remember that for real-time CG applications we have to re-render each image a given number of framesper-seconds, fps). It is possible to modify the RIA to cope with the problem of condensation sets [72]. Different contraction rations si for IFS functions ωi influence the IFS attractor. Some parts of the attractor may be difficult to reach when larger parts are accompanied by IFS codes with smaller si. A good choice is to make the probability pi proportional to the Jacobean of ωi (according to Eq. 46):
M x( i ) cos θ (xi ) −M y(i ) sin θ (yi ) J ( ωi ) = ( i ) M x sin θ (xi ) M y( i ) cos θ (yi )
(46)
The Jacobean defines the ratio by which ωi contracts the areas of a unit square. For similarity transformations, J(ωi) gives probabilities proportional to M (i) [201].
IFS Rendering Algorithms
65
5.1.2 Colour-Stealing Random Iteration Algorithm The random iteration algorithm can be applied along with the tops function (Chapter 3.3.5) to improve colour assignment to IFS attractors. The CS-RIA approach is a simple method for a quick construction of full-colour IFS attractors [187]. The process is a class of image-based rendering methods. The colours assigned to the IFS attractor are derived from real-life or synthetic digital pictures. The CS-RIA starts with two iterated function systems with an identical number of codes. The random iteration algorithm (Chapter 5.1.1) is applied simultaneously to both IFS sets. One of the IFS modules generates a sequence of points that lie in the reference image. The other IFS part renders the image of the attractor on the viewport with points that are coloured according to the colour values addressed by the first IFS (Fig. 5.4, Fig. Plate 2). The procedure of colour ‘stealing’ acts upon a reference digital image. Two points q0, qr are initialized. They can be chosen arbitrarily or from a unit square. Then the same random sequence is applied to both points q0, qr, one acting on the target image,
(
)
the other on the reference picture. The nth point q0n = ωi q0n−1 is assigned a value
(
)
extracted from the image pixel pointed by qrn = ωi qrn−1 . The transform ωi is chosen randomly.
Fig. 5.4. Illustration of the colour-‘stealing’ procedure.
The pseudo-code of the CS-RIA can be described as follows: Choose the reference image j R
66
Iterated Function Systems for Real-Time Image Synthesis
Choose the initial points q0,qr For i=1 to max_no_of_iterations do Begin Choose k randomly from the range(1,2,…,N) Apply q=wk(q0) Apply q1=wk(qr) Apply q0=q Apply qr=q1 If i>min_no_of_iterations then Begin Plot q(get_pixel_colour_at(qr(jR))) End End for i. The points q, qr and q0, q1 may be described on a plane by the pairs of (x,y), (xr,yr) and (x0,y0), (x1,y1) that are integer values for operations on the reference image and on-screen rendering. The transformation ωk can be put in the form described by Eqs. 2 and 5. When the parameter max_no_of_iterations is sufficiently large, then the points rendered by the CS-RIA approximate a fully coloured IFS attractor. For the view-port of the (H×V) resolution and the reference image with the resolution equal to or higher than (H×V), the IFS attractor will be quite decently approximated after max_no_of_iterations = H × V × 8
(47)
If we want to zoom in on the image of the IFS attractor, we need to multiply this value by the ZOOM factor. ZOOM is the zooming factor that redefines the maximal number of iterations max_no_of_iterations = H × V × 8 × ZOOM
(48)
(for additional 4-times zooming, ZOOM > 4). In comparison with the RIA, there is no further need to add a factor corresponding to measure collection. The extensive zooming in on the IFS attractor introduces visible ‘flattening’ of colour range. It is a result of the approximation of colour from lower-resolution reference images. A solution to this problem may be either the application of a very high resolution of reference images or the use of one of the filtering methods known in the texture mapping. A bilinear, trilinear or MIP-mapping, when applied to the CS-RIA, should enhance the visualization of fully scaled IFS attractors. The colour-stealing random iteration algorithm may be applied to render some models of the nD IFS provided that the number of iterations is satisfactory. The colours and structure of the atrractor should be well defined for a much larger (than in Eq. 47) number of iterations. Post-processing such as anti-aliasing can be used to elevate small differences in the attractors. By the estimation of the Jacobean (Eq. 46), it is possible to determine the probabilities pi for ωi that can be practical for IFS attractors with condesation sets. The CS-RIA offers the mapping of colours with a high degree of continuity [190]. IFS fractal colours are ‘stolen’ and wrapped with a very intuitive feeling of harmony when the reference image has continuous variations of colour shades. The method can be used to map
IFS Rendering Algorithms
67
textures and to create animations similar to colour cycling known from visualizations of escape-time fractals. CS-RIA colouring can be applied to superfractals as well [190]. 5.2 Deterministic Iteration Algorithms
5.2.1 Classic Deterministic Iteration Algorithm The deterministic iteration algorithm (DIA) follows almost directly the intuitive definition of iterated function systems as a set of copies of itself. It iterates on sets of points rather than on single separated pixels. The standard implementation of the screen-rewriting DIA was proposed by Barnsley [72]. The algorithm is also presented under the name of the grayscale photo-copy algorithm [206]. Given an IFS with probabilities (Definition 6), the DIA applies the Markov operator which, given any image I as the input, produces a new image M(I) as the output. If the image I with the (H × V) resolution is a non-empty digitized picture where most or all pixels qx,y (0 < x < H, 0 < y < V), we have I(qx,y) ≥ 0 with H
V
∑∑ I ( q ) =1
(49)
x, y
x=1 y=1
Then the new image M(I) is obtained by
(
)
N
(
)
M I ( qx , y ) = ∑ pi I ω−k 1 ( qx , y ) where
i=1
(50)
ω−k 1 is the set of all pixels which are mapped to qx,y by ωi.
Then the unique fixed point (the attractor) A = I* of M satisfies M(I*) = I*
(51)
The sequence of iterations of the Markov operators I, M(I), M2(I), …, Mn(I),… always approximates the attractor I* for any initial image I [173]. It can be said that for n large enough, the image generated by a successive series of operations is visually close to the attractor of the IFS. The deterministic iteration algorithm can be described by the following pseudo-code: Choose the initial non-empty set of points q0 Choose the initial cleared set of points qb For i=1 to max_no_of_iterations do Begin For j=1 to N do Begin For each point q that belongs
68
Iterated Function Systems for Real-Time Image Synthesis
to the image q do Apply qb=(qb)OR(wi(q)) Plot qb End for q End for j Apply q0=qb Clear qb End for i. The point q may be described either on a plane by a pair of real values (x, y) or in any n-dimensional space. For a 3D representation, an image q will be described by voxels (x, y, z). After max_no_of_iterations, we can observe the formation of the IFS attractor. In most practical cases, the initial set of points q0 is taken to be a uniformly gray image. We assume that the domain of the image is a unit square, and 0 denotes black and 1 denotes white. Usually, two buffers (the domain and the target one) are assigned to hold successive iterations of qi-1 and qi. Theoretically, we would need two frame stores of infinite resolutions. For practical reasons, two discrete approximations (usually with the size of H × V) are used. The target buffer is set to 0 first, then all pixels are scanned in the domain buffer. For all pixels that are not black, the coordinates ωi(q) are calculated and the corresponding pixels in the target image/buffer are set to q.
Fig. 5.5. Several steps of the DIA approximating the Sierpinski triangle.
The iteration of the DIA is computationally expensive and requires a significant amount of memory. This is particularly visible in a volumetric representation of
IFS Rendering Algorithms
69
iterated function systems. There is no criterion that defines the value of max_no_of_iterations. This parameter depends on image resolution and has to be fixed in advance by the trial-and-error method. After six or seven iterations (Fig. 5.5), interesting images are obtained. Barnsley in its implementation of the DIA suggested 100 iterations with manual stopping when necessary [72]. Practically, with the DIA it is not possible to render magnified (zoomed-in) fragments of IFS fractals. 5.2.2 Deterministic Iteration Algorithm and Superfractals The deterministic iteration algorithm constructs the IFS attractor by a sequence of operations on image buffers. It strictly follows the intuitive definition of iterated function systems as self-similar structures that are built from even smaller copies of themselves. The DIA method is purely deterministic and renders IFS structures quite effectively. Superfractals display an interesting composition of both deterministic and random behaviour. They are thoroughly described in the excellent book [190]. The deterministic iteration algorithm for superfractals (DIA-S) is based on the idea of V-variable fractals (Chapter 3.3.5) and exploits both a random choice of IFS codes with the DIA operation on image buffers. The method operates on several digital image buffers. For two IFS codes Ω0(ω00, ω01), Ω1(ω10, ω11), the procedure of rendering will require four images: two non-empty target images and two cleared buffers. The DIA-S can be described intuitively in four main steps: Step 1 Pick a random index i that selects the IFS Ωi code, say i = 0, and Ω0 is chosen. Apply ω00 to one of the target images (that is also chosen randomly) and transform its content to the first image buffer. Then apply ω10 from the IFS Ω1 to one randomly chosen target image and blend the result with the image in the first buffer. The first image buffer contains the union of both transformed images. Step 2 Choose a random index i that selects the IFS Ωi code, say i = 1, and Ω0 is chosen. Apply ω11 to one randomly chosen target image and transform its content to the second image buffer. Then apply ω01 from IFS Ω0 to, again, one randomly chosen target image and blend the result with the image in the second buffer. The second image buffer contains the union of both transformed images. They are processed by the complementary IFS codes that were not used in Step 1. Step 3 Transfer the content of the image buffers to the target images. Copy the content of the first buffer to the first target image and copy the second buffer to the second target image. Clear the image buffers. Step 4 Repeat Step 1 many times until the attractor reaches the so-called stationary state.
70
Iterated Function Systems for Real-Time Image Synthesis
Fig. 5.6. Several steps of the DIA-S approximating the superfractal.
Figure 5.6 illustrates a few chosen steps of the DIA-S rendering procedure. The system reaches its stationary state after approximately 20 iterations. The images are diverse but have similar visual characteristics. The distribution of stationary images corresponds to the stationary state distribution [190]. The sequence of iterations renders diverse forms of the superfractal with the blend of both the random and deterministic procedures. The deteriministic iteration algorithm for superfarctals can be desribed in a pseudo-code: Choose two initial non-empty sets of points qr0,qr1 Choose two initial cleared buffers qb0,qb1 For i=1 to max_no_of_iterations do Begin Choose a random index k from the range (0,1) For each point q that belongs to the image qrk do Apply qb0 = (qb0)OR(w00(q)) Apply qb0 = (qb0)OR(w10(q)) End for q Choose a random index k from the range (0,1) For each point q that belongs to the image qrk do Apply qb1 = (qb1)OR(w01(q)) Apply qb1 = (qb1)OR(w11(q)) End for q
IFS Rendering Algorithms
71
Plot qb0; Plot qb1 Apply qr1=qb1; Apply qr1=qb1 Clear qb0; Clear qb1 End for i. The initial four sets of points qr0, qr1 and qb0, qb1 may be described either on a plane by a pair of real values (x, y) or in any n-dimensional space. For a 3D representation, the image q will be described by the voxels (x, y, z). After max_no_of_iterations, we can observe the formation of the superfractal attractor. However, the next iterations will result in slightly different results. The breed of superfractals will reach the ‘stationary’ state represented by the same resolution of attractors but with different shapes. As in the classic DIA algorithm, the initial set of points q0 is usually taken to be a uniformly gray image. We usually assume that the domain of the image is a unit square, and 0 denotes black and 1 denotes white. Each two images (buffers and a target one) are assigned to hold successive iterations of qi-1 and qi. Theoretically, for a given example, we would need four frame stores of infinite resolutions. Discrete approximations (usually with the size of H × V) are satisfactory for computer-generated images. The iteration of the DIA-S is computationally expensive and requires a significant amount of memory resources. It would be much more demanding for volumetric super IFS models. Considering flat images, it usually takes approximately 20 iterations to reach the ‘stationary’ state of superfractal images. For practical reasons, the DIA-S method cannot be used to render magnified parts of superfractal attractors. The deterministic iteration algorithm for superfractals can implement the colour-stealing mapping [189,190]. 5.3 Minimal Plotting Algorithm Both the random iteration algorithm and the deterministic iteration algorithm require a considerable amount of time to approximate the IFS attractor. It was recognized that a more efficient rendering technique can iterate only new points of the attractor [199]. Monroe and Dudbridge implemented the IFS rendering algorithm based on a data structure consisting of a graphic screen buffer and a dedicated queue [200]. The socalled minimal plotting algorithm (MPA) performs a minimal number of arithmetic operations when rendering a picture of the IFS attractor. The MPA assumes that to view a fractal on a screen, only a representative set of points belonging to the attractor is required. Such a set is finite and therefore can be constructed in finite time. The graphic algorithm uses only one frame store for the picture of size H × V and a queue of pixel addresses, which in typical cases needs less memory than one frame store [201]. During the rendering process, the MPA recovers a pixel from the frame buffer. The minimal plotting algorithm can be described by the following pseudo-code: Find the fixed points of all wi (i=1,2, …, N) Plot pixels qi corresponding to the fixed points Initialize a queue with the addresses (qi) of these pixels
72
Iterated Function Systems for Real-Time Image Synthesis
Repeat Take pixel_address q from head_of_the_queue For j=1 to N do Begin Round wi(q) to_the_nearest_pixel p If p has_not_already_been_plotted then Begin Apply Plot p Add pixel_address p to Back_of_the_queue End if End for j Until queue is empty. The function Round ωi(q) to_the_nearest_ pixel p needs further explanation. The authors of the MPA rendering scheme assume that pixel coordinates are integers located at their centers in the image space [201]. All calculated values are rounded to these centers. The pixels have equal aspect ratios and the maximum error introduced by the rounding operation is the half diagonal of the pixel square δ (Fig. 5.7). The distance ρ from a pixel p to the attractor A can be defined by the equation
ρ( p, A) = min d ( p, q ) q∈ A
(52)
where d (the distance) is usually an Euclidean metric.
Fig. 5.7. Rounding to the nearest pixel.
Theorem 5 The proximity theorem. Let (F, d) be a metric space. Let ωi : F→F be a contractive mapping. Let δ > 0 be given. Let Ω = {F,( ωi ); i = 1, 2, ..., N} be a hyperbolic IFS with contraction factors 0 ≤ si < 1. For all pixels p generated by the minimal plotting algorithm, we have
ρ( p, A) ≤
δ 1− s
(53)
where s is the maximum contraction factor of all IFS mappings s = max(si;i = 1,2,…, N).
IFS Rendering Algorithms
73
A proof of Theorem 5 can be found in [201]. The proximity theorem guarantees a finite termination of the minimal plotting algorithm. The pixels stored in the frame buffer are visited only once. The MPA’s rendering is invariant. Transformations applied to any pixel given other pixel coordinates. If we have the maximum number of pixels equal to H × V, then the minimum number of plot operations is the same (H × V). The MPA recovers pixels from the frame store and operates on a queue, hence the overhead for queue access (writing and reading operations). The MPA shares a similar defect with the deterministic iteration algorithm described earlier, since it operates on pixels. The rendering of a magnified part of the IFS attractor is impossible from the practical point of view. We can change the metric given in Eq. 53, but this results in inordinate amounts of memory consumed for a queue. The best rendering case is when the screen bounds the whole attractor of the IFS. We assume that IFS components are linear and non-overlapping. Non-hyperbolic and non-linear iterated function systems can have some transformations that do not have constant points. Theoretically, it is possible to develop an n-dimensional version of the minimal plotting algorithm for a limited set of IFSs. 5.4 Constant Mass Algorithm The constant mass algorithm (CMA) was proposed as an extension to the deterministic iteration algorithm [21,72]. The main idea is to produce a measure of the fractal’s density in each pixel. The random iteration algorithm can be developed into a grayscale version, applying measure collection for all image pixels. If we extend the total number of iterations by PEPP (Eq. 44, Chapter 5.1), we can collect a histogram of the frequency with which a pixel is visited. After normalization, we can use this measure to represent either the grayscale or palette-colour fractal images. Choosing the probabilities pi for the IFS mappings ωi , we can re-distribute the measure of the fractal, thus changing its appearance. The CMA works for the IFS with probabilities. It assigns a total value of measure per an IFS fractal and assumes any initial distribution governed by associated probabilities. The mass assigned to each pixel is re-distributed by the ωi mappings at each stage of the iteration process. This re-distribution depends on the probabilities pi. If all probabilities sum up to 1.0, then the iterations of the CMA do re-distribute it over the IFS attractor preserving its total sum. The pseudo-code of CMA can look like Choose a set of points q0 Assign the same gray_scale_value to all pixels in the rendering of q0 For i=1 to max_no_of_iterations do Begin Clear gray_scale_buffer qi For j=1 to N do
74
Iterated Function Systems for Real-Time Image Synthesis
Begin For each point q that belongs to the image q(i-1) do Apply q=pj×gray_scale_value_of_pixel(q)+ wj(q) End for j End for i. The re-distributed mass is normalized for all pixels, and the image of the IFS attractor can be displayed either in grayscale or in palette-colour modes. max_no_of_iterations determines the total number of calculations necessary to obtain the IFS attractor. It depends on the structure of the IFS attractor and can be evaluated experimentally. Usually, it takes the value of 20 (for a sample 256 × 256, Horizontal × Vertical image resolution) [201]. It is possible to trace the changes in the values of mass assigned to pixels. This helps to set up a threshold that will terminate the algorithm when only a few pixels change their values. The CMA has the same defect as all image-based rendering algorithms for iterated function systems. Zooming operations cannot be applied, then. We can only render nonoverlapping hyperbolic iterated function systems. It is possible to construct an n-dimensional version of the constant mass algorithm, although it does not seem to offer an efficient way of rendering fractal volumes. 5.5 Escape-Time Algorithm The escape-time algorithm (ETA) is a widely known method for rendering selfsquaring non-linear fractals (Chapter 2.2.3). A similar idea of recursive calculations for each point in the attractor area can be exploited for iterated function systems. We check whether all calculated values remain within some bounded area. It means that they are a part of the attractor. Otherwise, the maximum number of iterations defines a bounding box of the attractor. Inside the bounding box we can define a measure for the distance to the attractor A, where larger counts correspond to smaller distances. Barnsley presented a simple escape-time algorithm for a dynamical system closely related to the iterated function system [71]. He assumed that we clearly define subdivisions of space containing each part of the IFS attractor. It is possible to develop a generalized version of that algorithm. Definition 21 Let Ω = {F,( ωi ); i = 1, 2, ..., N} be a hyperbolic IFS with contraction factors 0 ≤ si < 1. Let us consider the dynamical system (R2:f) where each fi: R2→ R2 is defined by
fi = ω−i 1 ( x, y ) for i = 1, 2, ..., N
(54)
This dynamical system is closely related to the IFS Ω and is usually called a shift dynamical system [71]. We can clearly observe that fi are inverse transformations of
IFS Rendering Algorithms
75
the ωi mappings and are obviously not contractive. The ETA calculates a series of values of fi applied to each point on the screen related to the set of functions f. We can plot an approximation of the IFS fractal based on the distance from the attractor. The pseudo-code of the ETA is as follows: Choose a set of dynamical systems f related to the IFS codes w Choose the initial set of points q0 For each q that belongs to q0 do Begin Apply q1=q For i=1 to max_no_of_iterations do Begin Choose the transformation index j based on the norm delta;Apply q2=fj(q1) If q2<max_distance then Begin Apply q1=q2; Apply Plot q2 End Else Apply i=max_no_of_iterations End for i End for q. The initial set q0 may be either a set of points corresponding to the view-port of a given resolution H×V image or a volumetric set of voxels in a 3D space. max_no_of_iterations defines the fidelity of the escape-time algorithm. The higher the value, the better the resolution of the attractor (Fig. 5.8) is obtained. max_distance is the upper bound for the calculations, which sets the value for checking out the escape to infinity. The norm delta helps us to choose an appropriate transformation fi. For an overlapping IFS or not clearly defined regions occupied by the IFS attractor, we face the problem of which functions fi to choose from. Here the norm delta is introduced with the help of the Euclidean or linear metric [207]. For qi(xi,yi)=fi(q(x,y)), we can estimate delta_Euclidean Δ =
( xi − x )
2
+( yi − y )
2
(55) or delta_linear
Δ = xi − x + yi − y
We can arbitrarily choose all functions fi that give the maximum delta (quickly escaping ones) or that return the minimum of all delta values:
Δ = max i ( Δ1 , Δ 2 ,..., Δ N ) or
Δ = min i ( Δ1 , Δ 2 ,..., Δ N )
(56)
76
Iterated Function Systems for Real-Time Image Synthesis
We can apply the ETA to all linear and non-linear iterated function systems. The escape-time algorithm takes a considerable amount of time to render the IFS attractor. The method is purely deterministic and can be applied to zoom in on small parts of IFS fractals. It is quite easy to develop it to the n-dimensional version of iterated function systems. It is also possible to apply several improvements over the rendering process [208].
Fig. 5.8. ETA applied to render the IFS.
5.6 String-Rewriting Algorithm Fractals are self-similar by nature. This also holds for iterated function systems that define fractals to be made up of a number of scaled copies of themselves. Each such copy is a result of the ωi mapping applied to individual points or sets of points in the image space. For an IFS consisting of N transformations, in the deterministic iteration algorithm, each mapping is addressed. Each smaller/transformed copy can be identified with the index i of the ωi mapping that transformed the larger part of the IFS attractor into it. Then we have a string of function identifiers ( ω1 , ω2 ,..., ω N ). Each of the N copies can be further broken into further N smaller copies. We can identify the function related to those copies with a two-character string ( ω1ω1 , ω1ω2 ,..., ω1ω N , ω2 ω1 ,..., ω N ω1 ,..., ω N ω N ). In general, subsets of an IFS attractor can be identified with a string of all transformation identifiers. This is the
IFS Rendering Algorithms
77
idea that can lay the foundations for the string-rewriting algorithm that can be associated with the 3D IFS structure introduced by Chen and Bi [202]. In order to generate a final string determining all IFS transformations, we can use two string buffers and string operators. The pseudo-code for the string-rewriting algorithm can look as follows: Choose an initial String_B=null Choose an initial String_A={w1,w2,…,wN} For i=1 to max_no_of_iterations do Begin Apply Get L=string_length (String_A) For j=1 to L do Begin Apply Get STR_J=j-th string_item from String_A For k=1 to N do Begin Apply Create new-string=w@string(k)@STR_J Apply add new_string_item to String_B with a separation character End for k End for j End for i. All string_items can be separated by characters or blank spaces. @ is a string concatenator; string (i) returns a string representation of the variable i. For instance, we can apply the *.csv format (comma separated variables). String_A=String_B means that String_B overwrites String_A. The entire rendering process is recursive. The tesseral synecdoche algorithm (described in the following Chapter 5.7) handles string representation in the recursive manner. The idea of the string-rewriting algorithm has several advantages over the previously presented algorithms. We store function identifiers instead of points or sets of points. The number of iterations max_no_of_iterations determines the levels of the subdivision process. For N sufficiently large, we should remember that even for small max_no_of_iterations we can obtain an enormous length of the final string. Once calculated, the functions can be applied (according to the order of indexes) to any objects in any space including a 3D volume and CSG primitive elements. If we apply the final string to transform voxels in a 3D space, we obtain a vector of voxel addresses determining their position. We can then sort all voxels in order to eliminate redundancy. This is very useful for pre-processing during the visualization process, which is particularly helpful in the case of overlapping IFS attractors. Since we store mapping identifiers, they can address the n-dimensional IFS as well.
78
Iterated Function Systems for Real-Time Image Synthesis
5.7. Tesseral Synecdoche Algorithm The tesseral synecdoche algorithm (TSA) is closely related to the tesseral amalgamator introduced by Bell and Holroyd [205]. The tesseral amalgamator was designed to discover the ways to tessellate space hierarchically. The idea was used in the TSA in order to provide a faster and more accurate way of approximating of IFS attractors [204]. Let us say that we have N affine transformations that define the iterated function system. All transformations are stored in the array TA. The first index i identifies the mapping ωi . The second index j gives six terms of the transformation ωi along with the probability pi stored as the seventh element. We consider a binary flat representation of the IFS (as described by Eq. 2, Chapter 3.1). The rendering procedure is recursive, depends on probability and works on a string containing tesseral addresses of the current pixel [204]. Here is the pseudo-code of the recursive procedure rendering the TSA for points on a plane q(x, y): Create an array TA containing N functions describing IFS Choose an initial String t=null Choose an initial pixel value q0(x,y) Choose max_no_of_recursions l Set the current recursive level lv Choose the probability below which a branch of the recursion is pruned pv Choose the current probability p Procedure TSA (q0(x,y),lv,l,pv,p,t) Begin If pl then go to end_of_the_procedure For i=1 to N do Begin Apply t= t@string(i) Apply p1=p×TA(i,6) Apply q1=wi(q0) If q10 then call TSA(q1,lv,l,pv,p1,t) End for i end_of_the_procedure Apply Plot q1 End. In the above procedure, we have several functions similar to those used in the string-rewriting algorithm: @ is a string concatenator; string (i) returns a string representation of the variable i; means not_equal_to. The recursive tesseral synecdoche algorithm should start with a fixed point q0(x0,y0), but it can be also any point on a plane. We can run initially the TSA rendering algorithm with the following parameters: TSA ((0,0),10,0,0.0000001,1.0,””). If all points of the IFS attractor are to be visited, then pv should be set to zero. We have to remember that, as in string-rewriting, a large number N and max_no_of_recursions
IFS Rendering Algorithms
79
can result in an enormous length of the string created by the TSA. The TSA is a possible output of the random iteration algorithm. The synecdoche algorithm plots an attractor of a dynamical system, and its applications can be much broader than the rendering of iterated function systems. The TSA provides means for the insertion of non-scaling parameters into the model of the IFS. We can extend the array of the parameters TA with, for instance, identifiers of CSG primitive elements. We can link the level of recursion with the TA array as well. This would introduce scale-related rendering of IFS attractors. 5.8 Recursive Rendering Algorithms From the definition of iterated function systems we can clearly observe the recursive process of IFS attractor construction. The idea of recursive rendering is used in the string-oriented tesseral synecdoche algorithm described earlier. Two other recursive rendering algorithms are introduced in this chapter. They quickly and efficiently approximate IFS attractors. The methods can be easily applied to n-dimensional iterated function systems, including operations on constructive solid geometry primitives. There are two variations of recursive rendering algorithms: those applied to point sets and those applied to the vector representation of an object. 5.8.1 Point Recursive Rendering Algorithm The point recursive rendering algorithm (PRR) is a simple and purely deterministic algorithm. The method is so efficient that it is possible to render in real time almost all representations of n-dimensional iterated functions systems. For a given class of disjoint or just-touching IFS attractors, the PRR algorithm quickly approaches the non-redundant set of points in the nD space [203]. The pseudo-code of point recursive rendering algorithms for a two-dimensional IFS can be listed as follows: Choose an initial pixel value q0(x0,y0) Choose max_no_of_recursions L Procedure PRR(q0(x0,y0),L) Begin For i=1 to N do Begin Apply q1= wi(q0) If L==0 then Apply Plot q1 Else call PRR(q1,L-1) End for i End. The PRR algorithm can start with a fixed point q0 (in any nD space). It can be any other point, since all transformations lead eventually to the attractor of the iterated function system described by ωi codes.
80
Iterated Function Systems for Real-Time Image Synthesis
We can plot only points corresponding to the deepest addresses (Fig. 5.9) rendered in the recursive manner. We can run initially the PRR with the parameters PRR ((0,0),10). In contrast to the tesseral synecdoche algorithm, the PRR one does not operate on strings of characters. None of the calculations considers the IFS with probabilities, or in other words, all probabilities are equal and sum up to 1. We can roughly estimate max_no_of_recursions L, for a given image resolution H × V.
Fig. 5.9. Levels of the recursive procedure.
For a given zooming factor ZOOM, we would need PIX pixels to depict the IFS attractor: PIX = H × V × ZOOM
(57)
Then for N affine mappings describing the IFS and L levels of recursions, we have
N L = PIX = H ×V × ZOOM
(58)
It means that L recursive renderings of N IFS functions will render PIX pixels. Then max_no_of_recursions L for a given IFS will take the value
L ≥ log N ( PIX ) =
log ( H ×V × ZOOM ) log( N )
(59)
The algorithm is efficient and stops rendering in finite time for all hyperbolic IFSs. There are some problems with condensation sets and with non-linear iterated function systems, where an unequal distribution of points is clearly visible.
IFS Rendering Algorithms
81
5.8.2 Vector Recursive Rendering Algorithm The rendering algorithms described in the previous sections operate on points or sets of points that may represent flat images or volumetric spaces. The image space consisting of pixels and the volumetric space constructed with voxels are natural visualization interfaces for fractals. The authors of the tesseral synecdoche algorithm suggested that it is possible to insert non-scaling parameters into IFS codes, thus making further developments possible [204]. The vector recursive rendering (VRR) algorithm combines the idea given in point recursive rendering with the representation of a vector in space. The vector can be described either by a coordinate (location in space) and angles (its orientation in space) or by two coordinates of two points in space that can define its location and direction [209]. The main idea is to transform not one or many points in space, but exactly two points that define the vector. The recursive process changes both the location and orientation of a pair of points (coordinates). Since hyperbolic iterated function systems contract all points, the pair defining a vector needs rescaling after each mapping. The vectors are quite easy to calculate and, once obtained, they can be attached to any vector CG model (including CSG primitives). The vector recursive rendering algorithm on a plane can be described as follows: Choose two initial pixel values q0(x0,y0),q1(x1,y1) Choose max_no_of_recursions L Procedure VRR(q0(x0,y0),q1(x1,y1),L) Begin For i=1 to N do Begin Apply q2= wi(q0) Apply q3= wi(q1) If L==0 then Apply Plot_line(Normalize(q2,q3)) Else call VRR(q2,q3,L-1) End for i End. The VRR algorithm works in the same way as the PRR algorithm. It terminates when the current level of recursion is equal to 0. We can initially run the vector recursive rendering algorithm with the parameters VRR((0,0), (1,1), 10). It is also possible to extend this representation to any vector in an n-dimensional space. The VRR algorithm approaches the IFS attractor very fast and in finite time. We can estimate max_no_of_recursions L for given IFS codes, but its sense is a bit different for vector objects. The main difference from PRR is that we do not operate on points in space but on a vector to be attached to any CG object (a circle, a triangle, a cube or a CSG solid). All CG objects have sizes larger than one pixel, therefore it is enough to apply only several of the first steps of the recursive algorithm in order to obtain interesting results [210]. There is a problem with the simplest implementation of the VRR algorithm (without a normalization process). We know that hyperbolic IFSs are contractive, thus all points get closer with each recursive mapping (Chapter 3, Definition 2). We have
82
Iterated Function Systems for Real-Time Image Synthesis
to implement a normalization process (denoted in a pseudo-code by Normalize) in order to achieve a uniform size of vectors. We can introduce a scaling factor sf that contradicts the contraction of two points in space (q0, q1). sf is used to normalize the vectors at each level of recursive rendering.
Fig. 5.10 Illustration of operations performed on points to obtain a re-scaled vector.
For q0 represented by the pair (x0, y0) and q1 represented by the pair (x1, y1) on a plane (coordinates of pixels on a plane), we can apply the distance d calculated from the Euclidean metrics:
d = sf
( x1 − x0 )
2
+( y1 − y0 )
2
(60)
where sf is a scaling factor larger than 1. In order to plot a scaled vector (Fig. 5.10), we use two points: a base point q0 (x0, y0) and a directional point qh (xh, yh). We need to calculate the vector direction where, for the parameter a,
a=
y1 − y0 x1 − x0
(61)
we calculate the qh (xh, yh) coordinates:
xh = x0 + d ⋅( cos (tg −1 (a )))
(62)
yh = y0 + d ⋅(sin (tg −1 (a ))) Considering the simplest implementation, we can plot lines (Plot_line(q0,qh)) that depict “normalized” vectors. The normalization process is not exactly correct, since it can bring surprising results for non-hyperbolic and non-linear iterated function systems. The vector recursive rendering algorithm is very fast and can be applied to any set of vector graphics primitives.
IFS Rendering Algorithms
83
5.9 Image-Based Rendering Algorithm The currently available graphic cards provide hardware-accelerated texture mapping operations. Graphic manipulation primitives that are supported by hardware acceleration include rotation, scaling and translation, which can be also found in iterated function systems. Wijk and Saupe proposed the image-based rendering (IBR) algorithm for real-time rendering of IFS fractals [198]. We take q0 to be a filled unit square with the maximum brightness. The square corresponds to the image area used for the rendering process. We create a sequence qk of images transformed by all ωi components:
⎛ N ⎞ qk = min⎜1, ∑ sci ωi ( qk−1 )⎟ for k = 1,2, … ⎝ i=1 ⎠
(63)
where k is limited by max_no_of_iterations that can be calculated for a given image resolution H × V, and sci denotes a weight factor for the mapping ωi . For all sci = 1, the rendering results in an image of the IFS attractor with probabilities. We assume that contraction factors si > 0 for all ωi . If we choose si = pi/Di, where Di is the area of a unit square transformed by ωi , the image of the measure μ is obtained. Di can be calculated for each ωi (for the IFS described by Eq. 2, Chapter 3.1):
Di = a11a22 − a12 a21
(64)
We apply ωi transformations to the complete image textures. The image-based rendering algorithm can be described in the pseudo-code Choose the initial image buffer q0(H,V) Fill it with white (1.0) Choose max_no_of_iterations L For i=1 to L do Begin Apply copy q0 to texture memory Apply fill buffer q0 with black (0.0) For j=1 to N do Begin Apply the calculation of the quadrilateral R=wj(•) Apply render R Apply scale R with scj Apply map R with the image q0 End for j End for i.
84
Iterated Function Systems for Real-Time Image Synthesis
The algorithm converges quickly to the IFS attractor. For a given image resolution H×V (where H = V), the IBR algorithm approaches the size of a pixel after
L=
−log ( H )
log ( max i=1,2,..., N Di )
(65)
L (max_no_of_iterations) iterations (Fig. 5.11) This value can be calculated before the image rendering starts. The diameters of copies shrink at each iteration (for the hyperbolic IFS) and eventually converge to 0 [196]. The image-based rendering algorithm is very efficient. IFS attractors can be generated in real time. The method is originally based on the OGL (Open Graphic Language) graphic cards. It is also possible to exploit similar in meaning DirectX functions and implement the IBR algorithm on graphic cards compliant to this standard. The IBR algorithm has some drawbacks. For highly disconnected IFS fractals, the image is dark and can black out very rapidly. For the IFS with condensation sets, images tend to be mapped to an infinitely thin line or an infinitely small point. There is also a problem with zooming in on smaller parts of the IFS attractor. The mass governed by μ is transported outside the visible image area, and the fractal simply disappears after a few iterations. It is possible to apply the IBR algorithm to separate channels (for instance, RGB colour components) in order to obtain colour images. The IBR method is based on a hardware-accelerated texture mapping, thus it is not suitable for n-dimensional IFS models.
IFS Rendering Algorithms
85
Fig. 5.11. Few chosen steps of the IBR method applied to squares.
5.10 Accurate Fractal Rendering Algorithm The accurate fractal rendering algorithm (AFRA) is based on the restricted version of the minimal plotting algorithm discussed in an earlier section (Chapter 5.3). The original MPA is easy to implement, but the arbitrary choice of gray values can cause problems near high edge values. Normally, the rendering of two image blocks should give the same results if they are identical. This is not the case in the MPA acting on tiles with a high fractal index. The AFRA method was proposed to approximate a limited set of grayscale fractals better [200]. The model is restricted to the case of a fractal composed of rectangular blocks denoted as tiles. A simple case of a four-tile fractal centered at the origin is illustrated in Fig. 5.12. Then for each pixel with the center (i, j), the grayscale value p(i, j) is calculated as a mean value of the IFS function over the pixel:
p (i , j ) =
∫
i+1/ 2
i−1/ 2
∫
j+1/ 2 j−1/ 2
f ( x, y ) dxdy
(66)
For rectangular blocks considered in the AFRA, the parent blocks have areas rescaled with the Jacobean J(tk) when transformed by tk:
86
Iterated Function Systems for Real-Time Image Synthesis
∫∫ (
tk q0 )
f ( x, y ) = J (tk )∫∫(q ) f (tk ( x, y )) dxdy =J (tk ) ∫∫(q ) ν k ( x, y, f ) dxdy 0
0
(67)
Fig. 5.12. Tiling scheme in which each tile is within its parent.
Then for all four tiles that cover the parent block (Fig. 5.12): 4
∫∫
q0
∑ J (t ) d ∫∫ k
f ( x, y ) =
k
k =1
q0
dxdy (68)
4
1− ∑ J (tk ) ck k =1
defines exactly the integral of the fractal function over a parent block.
∫∫
q0
dxdy is
just the area of the block g(x,y). Then f integrates over each tile tk ( q0 ) :
∫∫
q0
{
f = J (tk ) ck ∫∫q f + d k ∫∫q dxdy 0
0
}
(69)
The method may be carried onto sub-tiles until the level of individual pixels is
( ( ( (
reached after M transformations t k t k t k 3 ... t k 1
2
M
( q )) ...))) 0
(Fig. 5.13). M is chosen
IFS Rendering Algorithms
87
such that the number of sub-tiles approximately matches the number of pixels in the rendered image. M will be the nearest integer to log 4
∫∫
q0
dxdy .
The process or rendering evaluates the integrals of f over all tiles
( ( ( (
t k t k t k 3 ... t k 1
2
M
( q )) ...))) . The procedure is exact for the square q0 with the sides 0
being a power of 2. Such exactness is not guaranteed for a general rectangle.
Fig. 5.13. AFRA tiling scheme applied successively to the image block.
The pseudo-code for the accurate fractal rendering algorithm applied to 8×8 pixel blocks could be desribed as Choose the initial image block q0(8,8)=64 pixels Integrate the fractal function over q0 //Eq. 68 Fill it with white (1.0) Choose max_no_of_iterations L For k1=1 to 4 do Begin Integrate tiling under transformation k1//Eq. 69 For k2=1 to 4 do Begin Integrate tiling under transformation k2//Eq. 69 For k3=1 to 4 do Begin Integrate individual pixels under k3//Eq. 69 End for k3 End for k2 End for k1.
88
Iterated Function Systems for Real-Time Image Synthesis
The model redistributes the mass over all pixels (as it is done by the MPA) and is very accurate for square tile images. For the 8×8 case, M that denotes max_no_of _ iterations is equal to 3. The AFRA method cannot implement zooming. As in all fractal imaging methods, it is possible to render the IFS to any resolution, even higher than the original encoded image. Considering restricted appliactions, it is possible to employ the AFRA model in the nD IFS. 5.11 Rendering of Self-Congruent IFSs
The self-congruent IFS model described briefly in Chapter 3.3.4 blends the classic iterated function systems with time-dependent models of plant structures known in Lsystems. The process of cyclic rendering defines the moments of time where new segments are added to the current model. The iterative rendering procedure can be depicted in the following diagram (Fig. 5.14). Processor1 defines the shapes of the segments (initiators) used in the construction of the attractor. The data are transferred to Processor2 in selected moments defined by the growth cycle T. Processor2, based on the description of the growth model, transforms the shapes with IFS functions (Fig. 5.15). The process transforms the initiator according to processing rules that can be defined as IFS codes. Such a representation can be used to simulate the cyclic processes of growing fractal structures.
Fig. 5.14. General architecture of the self-congruent IFS model.
IFS Rendering Algorithms
89
Fig. 5.15. Data flow diagram for Processor2.
5.12 Recurrent IFS Algorithms
Two algorithms were developed to handle the rendering of recurrent iterated function systems (described in Chapter 3.3.1). The vector recurrent grayscale photo-copy algorithm and the vector recurrent probabilistic domain algorithm are rendering algorithms that produce good quality images of RIFS attractors in finite time [173,175,176]. The vector RIFS (VRIFS) is used mainly in image compression and decompression schemes; therefore, its description given below is very general with no pseudo-code listings. First, we have to define the vector recurrent IFS (as an extension to the RIFS described in Chapter 3.3.1). A VRIFS encodes and decodes N images Ij* on N different unit squares Xj; for j = 1, 2, …, N. Definition 22 Assume that we have N unit squares Xj; j = 1, 2, …, N. For each pair i,j = 1, 2, …, N, let ωij : X i → X j ,1 ≤ n ≤ N ij be a collection of fine mappings, n
each assigned a probability weight pijn > 0 such that Nij
∑p n=1
ijn
=1
(70)
For each pair i, j = 1, 2, …, N, let pij mean an irreducible-row stochastic N×N matrix. Then Ω( ωij ; pij ; pij ;1 ≤ i, j ≤ N ,1 ≤ n ≤ N ij ) is a vector recurrent iterated n
n
function system on the unit squares Xj [173,175].
90
Iterated Function Systems for Real-Time Image Synthesis
5.12.1 Vector Recurrent Grayscale Photo-Copy Algorithm
The algorithm generates N images Ij* for j = 1, 2, …, N. For a vector notation I = ( I j ) j = ( I1 , I 2 ,..., I N ) , let qkl × j be the pixel qkl on the unit screen Xj. Any image Ii on Xi induces an image Mij(Ii) on Xj defined by Nij
M ij ( I i )(qkl × j ) = ∑ pijn I i ( ω−ijn1 ( qkl × j ))
(71)
n=1
It is possible to define the vector recurrent Markov operator M that takes a vector
image I to a vector image M ( I ) , with its jth component ( M ( I ) ) j given by N
( M ( I )) j ( qkl × j ) = ∑ pij M ij ( I i )( qkl × j )
(72)
i=1
We start with any vector image
I , M (I ), M
2
I
and then generate the sequence
( I ) ,..., M ( I ) . For n sufficiently large, n
M n ( I ) approximates
the VRIFS attractor I* (Fig. 5.16). This algorithm works in the same way and has the same limitations as the deterministic iteration algorithm [173].
Fig. 5.16. Vector of four images generated by a recurrent IFS.
IFS Rendering Algorithms
91
5.12.2 Vector Recurrent Probabilistic Domain Algorithm
It is also possible to create a vector recurrent random iteration algorithm based on the principles of the random iteration algorithm described earlier in this chapter [173]. For the vector recurrent IFS given in Definition 22, the algorithms generate N images. We assume that p(mj)j is the unique probability vector associated with the irreduciblerow stochastic matrix pij. We have
rij =
mi p m j ij
(73)
which is the inverse transformation matrix. We consider N trees [173]. Their root at the level 0 is the image screen Xj. The root is given the weight mj. On the level 1, a typical node is ωi1 jn1 X i1 for i1 = 1,2, …, N and n1 = 1, 2,..., N i1 j . Similarly, we
will
have
further
nodes: generally, on the level t, the node ωi1 jn1 ωi2i1n2 ...ωit−1it−2 nt−1 ωit it−2 nt−1 X it is given a weight m j rji1 ri1i2 ...rit−1it pi1 jn1 pi2i1n2 ... pit it−1nt .
The vector recurrent probabilistic domain algorithm reaches the leaves of the jth tree and for each pixel qkl×j it sums up the weights of the leaves that are assigned to the pixel:
I *j (qkl × j ) =
∑
ωi1 jn1 ωi2i1n1 ... ωit it−1nt ⊆qkl
m j rji1 ri1i2 ...rit−1it pi2i1n2 ... pit it−1nt
(74)
The rendering algorithm performs the smallest number of computations in order to approximate the RIFS attractor [173]. 5.13 Performance
Good performance is a desired feature of real-time computer graphics applications. The time needed to generate IFS attractors should be as short as possible to handle an interactive construction of fractals. The total time of rendering is hard to calculate since it depends on many factors, including the representation of the digital image (image resolution, numbers of layers etc.), the properties of the graphic card, the configuration of hardware and the operating system, and the programming environment. The underlying idea of the IFS rendering algorithm may be either implemented in a straightforward manner or highly optimized, which also influences the time needed to complete an image of the IFS attractor on the computer screen. We can analyse a class of the IFS rendering algorithms described in the previous sections as soon as we provide some common ground for comparisons. We can compare, for instance, the total number of iterations necessary to obtain a good visual quality of the IFS attractor. The values discussed in this section are estimated from the analysis of the pseudo-code or suggested by the authors of their original representations, published in the corresponding papers. The total number of iterations includes loops and read/write operations. Conditional operations and stack operations, which are usually included in estimating the so-called cyclomatic complexity, are not considered in this discussion.
92
Iterated Function Systems for Real-Time Image Synthesis
Only straightforward implementations without optimizations are taken into account in the analysis. The number of iterations is by no means the time of rendering since, as has been mentioned before, several other factors influence the frame-rate of the final rendering. Almost all IFS rendering algorithms can be developed into the parallelprocessing version [211]. There are several method-specific implementation issues. String-based rendering algorithms require access to a queue. Image-based rendering algorithms need to define separate image areas to render in a parallel manner, which is relatively simple. For recursive rendering algorithms, we can spread renderings starting from a certain level of the recursion tree. The random iteration algorithm can be split into several rendering engines and their output can be composed into one final image. The performance of four volumetric implementations of IFS rendering algorithms is presented at the end of this chapter. The performance is described by the time of rendering measured in seconds. The number of voxels in the IFS attractor is similar in all cases, and the test software/hardware platform is specified. 5.13.1 Number of Iterations
We can compare the total number of iterations (NoI) for binary and grayscale/ pseudo-colour images displayed by an eight-bit (256 levels) view-port with a given resolution (H × V). If we assume that the approximation to a modern screen resolution is H = 1000 pixels and V = 1000 pixels, then we can roughly estimate the number of iterations necessary to fill the screen with the image of IFS fractals. We consider loops and R/W operations. The overhead for stack operations and logical operators is not considered in the estimations given below. Let us say that we have an iterated function system with probabilities that is nonoverlapping, consists of linear equations, does not posses condensation points and is totally contractive (hyperbolic). The IFS Ω = {F,( ωi , pi); i = 1, 2, ..., 5} N = 5. We assume that the image of the IFS attractor fits the viewing window. The image may be either binary (black-and-white) or monochrome/pseudo-colour (based on the colour palette). No zooming is applied. ● The random iteration algorithm is a simple yet effective rendering method that can be applied to any model of iterated function systems. Each time we render the IFS attractor, it is statistically “the same” but locally shows stochastic variations visible in grayscale/pseudo-colour image models. Flat images of the IFS attractor specified above would need at least NoI = 8 × H × V = 8,000,000
(75)
iterations to represent a decent quality of the rendering. ● The colour-stealing random iteration algorithm shares the efficiency with the classic RIA.The main improvement is in the IBR-colour assignment to the attractors of iterated function systems. Therefore, the same number of iterations NoI = 8 × H × V = 8,000,000 is enough to render a full colour image of the IFS.
(76)
IFS Rendering Algorithms
93
● The deterministic iteration algorithm applies N mappings to all pixels (H × V) stored in two buffers. max_no_of_iterations necessary to complete the attractor may take the values of 10 (the value obtained by the author during experiments) and even 100 (as is suggested in the literature [72]). The DIA would need a least NoI = 10 × N × H × V × 2 = 100,000,000
(77)
iterations to represent an IFS attractor, where the factor 2 stands for image buffer R/W operations. ● The deterministic iteration algorithm for superfractals applies IFS mappings to pixels (H × V) stored in several buffers. Two iterated function systems, each with two codes (Chapter 3.6), need four image buffers and totally four transformations to choose from. max_no_of_iterations necessary to reach the ‘stable’ state of the attractor should be greater than 20. Then the DIA-S method would need at least NoI = 4 × 4 × H × V × 20 = 320,000,000
(77)
iterations to represent an attractor of the super IFS. This is not an efficient rendering scheme, but we have to remember that it can be used to generate a variety of fractal shapes. ● The minimal plotting algorithm operates only on pixels and a queue of pixels stored in a separated buffer. The algorithm performs only the necessary operations and seems to be one of the best solutions for the case considered in this section. If we assume that a queue may take 1/10 of the image size, we would need no more than NoI = 0.1 × N × H × V = 500,000
(78)
operations to complete the image. Even if we multiply it by the factor 2 for queue operations, we still need no more than 1,000,000 iterations for the best quality of the image. ● The constant mass algorithm extends the deterministic iteration algorithm, thus it shares its drawbacks. In order to render the grayscale/pseudo-colour image of the assumed IFS attractor, we would need NoI = 20 × N × H × V = 100,000,000
(79)
iterations. The factor 20 was suggested by the authors of the CMA algorithm [200,201]. ● The escape-time algorithm is known from visualizations of self-squaring fractals and other dynamical systems. It is possible to create a shift dynamical system that corresponds to the IFS. It would consists of N of would need
ω−1 functions. For a given case we
NoI = 256 × N × H × V = 1,280,000,000
(80)
94
Iterated Function Systems for Real-Time Image Synthesis
iterations for a grayscale/pseudo-colour image of the IFS attractor. The ETA seems to deliver the worst performance out of all IFS rendering algorithms considered in this monograph. ● The string-rewriting algorithm operates rather on function identifiers than on points in the image space. For functions applied to the flat image (pixel coordinates), we would need NoI = 2 × N8 = 781,250
(81)
iterations for eight recursive levels. The factor 2 stands for the applications of IFS functions (with identifiers listed in the queue) to pixels on a plane. The method seems to be comparable with the MPA rendering method. ● The tesseral synecdoche algorithm is based on the recursive call of the main rendering procedure. From Eq. 45 we can estimate the level of recursive iterations L necessary to complete the rendering. Its value would oscillate between 8 and 9 for a 1000×1000 image resolution. We can take 8, as in the previous case. Then for the TSA rendering we would need only NoI = 2 × N8 ≈ 800,000
(82)
iterations to complete the attractor. ● The point recursive rendering algorithm, constructed using the same rules of recursive calculations, would need exactly NoI = N8 = 390.625
(83)
iterations to complete the rendered fractal. In contrast to the TSA, it does not need to operate on a queue of functions. It seems to be the fastest method, but we have to remember that recursive calls require heavy stack operations, which are not considered in this calculation. ● The vector recursive rendering algorithm operates on two points and needs normalization at each new position estimated. The normalization procedure involves trigonometric calculations, which are time-consuming. We should remember that the VRR algorithm is constructed to work with CSG image primitives. Let us say that VRR is applied to filled circles with the diameter equal to 10 pixels. Then the total number of iterations necessary to complete the image of the IFS attractor would be NoI = 4 × N5 ≈ 12,000
(84)
This method seems to be the fastest of all, but we have to remember that we approximate the IFS attractor with small filled circles, not with pixels. ● The image-based rendering algorithm would need only a few iterations to complete the approximation of the IFS fractal. The method is fast since it is based on hardware-accelerated image manipulation. Nevertheless, we would need
IFS Rendering Algorithms
NoI = ( H T ×VT )×
−log ( H ×V )
log ( max i=1,2,..., N Di )
95
(85)
iterations. If we assume that maxi=1,2,…,N Di is 0.025, which is a possible situation for a hyperbolic linear IFS, we have to perform NoI = 4 × 500 × 500 = 1,000,000
(86)
calculations, where ( H T ×VT ) = (500×500) is the size of the image texture used in the algorithm. We have to remember that the texture mapping is hardware accelerated and we apply it to all N mappings at least four times. Therefore, we would need only NoI = 4 × N = 20
(87)
iterations of the image-based rendering algorithm to obtain a good approximation of the IFS attractor. Considering real-time applications for flat images, the last method is definitely the fastest one. ● The accurate fractal rendering algorithm operates on tiles of pixels and distributes measure on sub-tiles. The process is similar to the CMA; the model is restricted to rectangular blocks of IFS codes. Its efficiency would be similar and limited by the calculation of integrals over the pixels and tiles, i.e. NoI = 2M ≈ 780,000
(88)
iterations. For smaller blocks implemented in image compression schemes, the AFRA model can perform real-time decoding of fractals – an encoded stream of digital video [200,201]. ● The self-congruent model of iterated function systems exhibits performance closer to that of Lindenmayer systems than those of other IFS models. The data structure grows exponentially with time and the modeling of complex systems takes a considerable amount of time and memory to complete the rendering. ● Rendering algorithms for recurrent iterated function systems are a class in themselves. Since their main application area is image compression and decompression, they cannot be compared with the previously discussed IFS rendering algorithms. The vector probabilistic domain algorithm is similar to the recursive rendering algorithm and therefore we can expect similar performance results. The vector recurrent grayscale photo-copy algorithm has the same limitations as the deterministic iteration algorithm, thus their performance will be comparable. The process of image compression and decompression applied to partitioned iterated function systems is highly sophisticated and asymmetrical. The process of domain and region identification and encoding is much longer than that of decoding. Since image compression/decompression schemes are beyond the scope of this monograph, their performance is not discussed.
96
Iterated Function Systems for Real-Time Image Synthesis
5.13.2 Sample Comparison of Four Volumetric IFS Renderers
The previous section considered the estimation of the efficiency of the discussed IFS rendering algorithms. The efficiency was measured in terms of selected operations necessary to complete the image of IFS attractors. The performance was limited to a case study of simple implementations of binary and grayscale/pseudo-colour images. The time of rendering is critical for an interactive design of fractals. It depends on many factors, including the underlying rendering algorithm as well as hardware and software configuration. Since 3D graphics plays an important role in the currently used CG systems, this section presents the performance of four volumetric IFS rendering algorithms implemented in slightly optimized applications. Volumetric IFS rendering algorithms include the deterministic iteration algorithm, the random iteration algorithm, the point recursive rendering algorithm and the escape-time algorithm. Fractal volumes were implemented and tested for three-dimensional RGB colour iterated function systems [207]. The tests were performed for the linear hyperbolic IFS consisting of five affine maps. Fractal volumes were generated in the (H × V × Z) = (100×100×100) resolution, giving the total of 1,000,000 voxels. H is the horizontal and V is the vertical resolution, and Z is the depth resolution. The number of voxels occupied by the IFS attractor depended on the number of iterations or the level of recursive processing. Two cases were considered, one satisfying realtime rendering (the rendering of at least 10 frames per second), and the other – rendering with close to real-time performance. Considering small latency, which is necessary for interactive design, it should last no longer than one second. Table 2. Performance of 3D IFS rendering algorithms. DIA – deterministic iteration algorithm, RIA – random iteration algorithm PRR – point recursive rendering algorithm, ETA – escape-time algorithm Fractal model 3D RGB IFS 5 maps 3D RGB IFS 5 maps
No. of voxels
Time of rendering(s) DIA RIA
PRR
ETA
~420,000
22.49
0.83
0.56
41.49
~110,000
01.45
0.10
0.10
10.55
The rendering applications were implemented in the C++ programming environment using OpenGL procedures. The code of applications was compiled with speed optimization. All results presented in Table 1 were obtained on an AMD Duron 1.3 GHz PC with 256 MB SDRAM and a GeoForce 2MX32 graphic card with 32 MB memory. The PC was running MS WINDOWS XP. The escape-time algorithm used the Euclidean norm to choose the appropriate mapping in a defined volume region. The escape-time bound was limited to the value of 10. The deterministic iteration algorithm performed five levels of volume rewriting.
IFS Rendering Algorithms
97
Summing up the results, we can say that the fastest implementations are those applying the random iteration algorithm and the point recursive rendering algorithm. IFS fractal volumes consisting of fewer than 100,000 voxels were generated in less than 0.1 second, thus meeting the real-time criteria for CG applications [207]. The deterministic iteration algorithm and the escape-time algorithm were far less efficient in the case considered for testing. The DIA requires extensive R/W operations on a data structure representing a volume. The escape-time algorithm delivered the worst performance results. The reason behind this is the calculation of the Euclidean norm at each point in a three-dimensional space. The escape-time bound was small, and for better representations that need much larger values (usually around 1000 for 2D images), the ETA performance would be even worse. Only four of ten IFS rendering algorithms were considered in the tests. The TSA and MPA methods offer performance results similar to PRR, so we can expect it in 3D cases, too. The constant mass algorithm offers performance results close to those of the DIA. The fastest method in 2D cases, i.e. the image-based rendering algorithm, depends on hardwareaccelerated functions applied to flat texture maps. Therefore, it is not suitable for volumetric fractals.
6 nD Iterated Function Systems and Their Applications Iterated function systems are mainly known for their applications in image compression and decompression. For raster images representing natural scenes, the PIFS offers a high quality of pictures. It offers a unique feature of super resolution, where the decompressed image can be rendered to an image resolution higher than the original. The YUV colour model is a popular choice in such applications. The collage theorem provides some hints for interactive image synthesis. It is also possible to develop an IFS modeler based on those principles. Most IFS modeling environments rely on the RGB colour model for raster graphics with a variety of possible image resolutions starting from animated thumbnails and ending at ready-toprint, high-quality images [92]. The underlaying rendering engines are usually based on the random iteration algorithm described in the previous chapter. The twodimensional IFS model can be restricted to a simpler case of a fractal interpolator. We can interpolate irregular contours, fractal palettes of colour and whole terrains. Extending iterated function systems to n-dimensional IFSs results in a range of colour raster images and in volumetric fractal sets. The rendering process can be as simple and efficient as in 2D IFS cases. Unfortunately, the application of the collage theorem to nD IFS is not as straightforward as in the case of two-dimensional iterated function systems. The aim of this chapter is to present the development of nD iterated function systems for image synthesis. The application areas include shape modeling and interactive image manipulation. Shape modeling is usually associated with vector graphics. Therefore, vector IFSs are introduced in this chapter as well. 6.1 Two-Dimensional Iterated Function Systems
6.1.1 Implementation Let a two-dimensional IFS be a limited case of the nD IFS introduced in Chapter 3.2. Then for a compact metric space F = R2, we will have an IFS set Ω = {F,( ωi ); i = 1, 2, ..., N} consisting of N affine maps ωi . For simplicity, we do not consider the IFS with probabilities, or assume that all associated probabilities are equal and sum up to 1. Any affine transformation ω :F→F or ω :R2→ R2 has the form
⎛ x′⎞ ⎛ x ⎞ ⎛ a11 a12 ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟+⎜ ⎟ ⎜ ⎟= ω⎜ ⎟=⎜ ⎝ y′⎠ ⎝ y ⎠ ⎝ a21 a22 ⎠⎝ y ⎠ ⎝b2 ⎠ 2
where ( x, y )( x′, y′) ∈ R are any points on a plane.
(89)
100
Iterated Function Systems for Real-Time Image Synthesis
The matrix defined by a11, a12, a21, a22 and the vector consisting of b1, b2 can be constructed from both linear and non-linear functions. 6.1.2 Properties The 2D binary IFS is the most classic implementation of iterated function systems. If we assume that the matrix consisting of a11, a12, a21, a22 and the vector b1, b2 are defined by linear functions, then it is possible to estimate the contraction factor for each transformation (Chapter 3, Eq. 7). The IFS does not have to be hyperbolic, and some contraction factors may be close to or even higher than 1. For such cases we will obtain a non-hyperbolic IFS, but it may still possess a fixed point called its attractor, as long as the average contraction is obeyed (Chapter 3, Definition 7). It is also possible to introduce non-linearity into the IFS code. In a classic black-and-white iterated function system, the matrix described by a11, a12, a21, a22 represents the combination of a rotation, rescaling and a sheer on a plane. IFS parameters can be also represented by trigonometric functions (Chapter 3.1, Eq. 5). Such a representation is very helpful in the construction of the graphical user interface for the IFS modeler. We can perform rotations, skew and scaling and mirror operations in the same way as it is done in other CG modelers (Fig. 6.1). The vector defined by b1, b2 represents simple translations on the plane according to the origin of rendering area coordinates.
Fig. 6.1. Sample transformations on a plane: A – original, B – translation, scaling and rotation, C – skew, scaling and translation.
nD Iterated Function Systems and Their Applications
101
This simple yet effective model is very popular in IFS modeling and synthesis. Although there are possible non-linear extensions of that model, including the polar IFS (Chapter 3.3.3), even the simplest case is a background for several interesting implementations. 6.1.3 Applications 6.1.3.1 Black-and-White IFS Fractals The binary model discussed in the previous section can be rendered by any of the rendering algorithms presented in Chapter 5. Binary 2D IFS representation permits the construction of the classic fractal sets such as the Cantor set and the Sierpinski triangle (Fig. 6.2). The same method, when applied to non-hyperbolic iterated function systems, provides a basis for much more complex and elaborated shapes, including the Barnsley fern (Fig. 6.3). Rendering algorithms are so efficient that we can develop real-time applications even on mobile phones with the image resolution of 140 × 90 pixels. For printed billboards (with image resolutions up to 100,000 × 100,000 pixels), we should consider the most efficient IFS rendering algorithms such as the minimal plotting algorithm, or the point recursive rendering algorithm. Considering the fern depicted in Fig. 6.3, we would need approximately several billions of iterations of the MPA to deliver a good quality of the black-and-white image of billboard size.
Fig. 6.2. Sierpinski triangle represented by a binary IFS attractor.
102
Iterated Function Systems for Real-Time Image Synthesis
Fig. 6.3. Barnsley fern represented by a binary IFS attractor.
Screen resolutions for a typical PC are 1024 × 768 (SVGA) and higher. Therefore, we can apply any IFS rendering algorithm and still meet real-time criteria for interactive design application. We can use the black-and-white IFS model to quickly preview fractal shapes. The high speed of rendering supports interactive manipulation consisting of rotations, scaling and sheer transformations. This is accompanied by instant rendering of the IFS attractor. 6.1.3.2 Fractal Interpolation Graphics systems based on the traditional geometry are effective for delivering models of man-made objects. Differential geometry methods provide simple yet effective tools for image modeling. Straight-line segments, polygons, circles and ellipses on the plane and surface patches, triangle meshes and cubes in the 3D space can be the basic elements of very complex objects. Vector graphics considers the abstract model instead of a raster image. The model consists of the basic primitive elements organized in space by the underlying hierarchical structure. The basic elements are accompanied by interpolated structures. Interpolation techniques permit an interactive manipulation of model geometry (for instance, nurbs). By changing the properties of the model we can obtain different unique shapes. Graphs of linear, polynomial and Bezier interpolators form the basis of computer-aided design systems. The graph of fractal interpolation functions can be used to approximate the components of irregular contours such as the profiles of mountain ranges and horizons over forests. Fractal interpolators also provide a means for fitting experimental data
nD Iterated Function Systems and Their Applications
103
including a timeline series that are the basic elements of streamed media [27,72,112,212–218]. Definition
23
A
set
of
data
is
{ ( xi , Fi ) ∈ R , i = 0,1, 2..., N }, where 2
a
set
of
points
x
of
the
form
x0 < x1 < x2 < ... < xN−1 < X N . An
IFS interpolation function corresponding to this set is a continuous function
f⎡ ⎣ x0 , xN ⎤ ⎦→ R such that f ( xi ) = Fi , for i = 0,1,2,…,N
(90)
The points ( xi , Fi ) ∈ R are called IFS interpolation points. 2
The graph depicted in Fig. 6.4 represents the attractor of the IFS of the form {(R2,ωi), i = 1,2,3}, where all maps ω are affine. Let us consider the binary IFS of a special structure:
⎛ x′⎞ ⎛ x ⎞ ⎛ a11i ⎜ ⎟= ωi⎜ ⎟=⎜ ⎝ y′⎠ ⎝ y ⎠ ⎝ a21i
0 ⎞⎛ x ⎞ ⎛ b1i ⎞ ⎟⎜ ⎟+⎜ ⎟ a22i ⎠⎝ y ⎠ ⎝b2i ⎠
(91)
The transformations are constrained by the data according to
⎛ x0 ⎞ ⎛ xi−1 ⎞ ⎛ xN ⎞ ⎛ xi ⎞ ωi⎜ ⎟=⎜ ⎟ and ωi⎜ ⎟=⎜ ⎟for i = 1,2,…, N ⎝ F0 ⎠ ⎝ Fi−1 ⎠ ⎝ FN ⎠ ⎝ Fi ⎠
(92)
Then, for i ∈ {1, 2,..., N } , the transformation ωi is specified by five real numbers a11i,a21i,a22i,b1i and b2i that must obey four linear equations: a11ix0 + b1i = xi-1 a11ixN + b1i = xi a21ix0 + a22iF0 + b2i = Fi-1 a21ixN + a22iFN + b2i = Fi
(93)
Then we can choose one free parameter of Eq. 93. a22i is chosen for the vertical scaling factor [72]. Choosing a22i to be a free parameter allows us to change the vertical scaling of each IFS interpolation component.
104
Iterated Function Systems for Real-Time Image Synthesis
Fig. 6.4. Graph of the interpolation function consisting of three IFS maps.
Fig. 6.5. IFS interpolation for the graph depicted in Fig. 6.4.
Then for a22i as any real number we can find the remaining components in terms of the interpolated data and arbitrarily chosen a22i. a11i = (xi − xi-1)/(xN − x0) b1i = (xNxi-1 − x0xi)/(xN − x0) a21i = (Fi − Fi-1)/(xN − x0) – a22i(FN – F0)/(xN − x0) b2i = (xNFi − x0Fi-1)/(xN − x0) – a22i(xNF0 – x0FN)/(xN − x0)
(94)
nD Iterated Function Systems and Their Applications
105
Fig. 6.6. Behaviour of the correct IFS and one with displaced points in the interpolating graph.
The parameters of IFS interpolation determine a non-hyperbolic iterated function system on a plane. We have to assign some values to the vertical scaling factors. Since a22i can have both positive and negative values, we can not only control the degree of irregularity of the fractal interpolator, but also influence its shape (Fig. 6.5). When all values a22i are equal to 0, we obtain linear interpolation. The method is very flexible; however, we have to choose carefully all interpolation points in order to avoid the situations depicted in Fig. 6.6. 6.1.3.3 Fractal Palettes Computer-generated images of many Euclidean models can be easily distinguished as artificial because of their smooth appearance and bright colours. Rougher surfaces are more natural looking for objects representing walls, furniture and clothing. The texture mapping of texture images is one of the most important approaches applied to reduce this artificiality of computer-generated models. The texture mapping and the bump mapping, which makes a surface appear wrinkled or dimpled without geometrical perturbations, are the most commonly used CG techniques [68–70]. Procedural approaches can be used to map a 3D field for all points on the object surface [71]. There is also a possibility to displace all vertices by some random value, thus introducing surface irregularities (all values can be stored in the so-called displacement map for further references to that surface). We know that fractals have the special property of controllable roughness, which can be observed in fractal interpolation. Landindi was the first to report fractal lookup tables (LUTs) or fractal palettes, applying them as transform functions to digital pseudo-colour images [219]. The self-affine series used in fractal palettes had the effect of improving the local contrast in images. It is also possible to simulate the hand-drawing of a digital image. This effect can be used to enhance the process of visualization [220], as depicted in Fig. 6.7.
106
Iterated Function Systems for Real-Time Image Synthesis
Fig. 6.7. Sonar image of the sea bed and bathymetry data showing different levels of water above the seabed image (with the linear and fractal palettes applied).
The use of fractal palettes based on iterated function systems enhances poorly distinguished boundaries where image intensity varied suddenly but by small changes [220]. The same holds for the rendering of 3D models. Smooth objects with cosine-lit, Goraud or Phong shaders represent linear variation in the shading of their surfaces. The fractal palette, on the other hand, introduces variations in colour shadings. Any observed changes in object appearance when the palette is changed would be rapid. The fractal palette could enable a designer to experiment interactively with the surface appearance of individual objects displayed in a 3D scene [221]. The colour interpolation palette is fully deterministic for IFS interpolators. We can expect the shading process to be repeatable, then. For a given set of interpolation parameters we will obtain an identical visual output. The free parameters a22i determine the irregularity of interpolation, or the roughness of the IFS attractor. For all a22i = 0, the result is a piecewise linear shading, otherwise as | a22i | increases in magnitude, the roughness increases in amplitude. The random iteration algorithm was applied to generate IFS palette interpolators for ray-traced objects [221]. The model was based on the HLS colour space, with IFS interpolation changing the L (Lightness) component (Fig. 6.8).
nD Iterated Function Systems and Their Applications
107
Fig. 6.8. Fractal interpolation of the lighting/shading model applied to a sphere with different roughness factors.
108
Iterated Function Systems for Real-Time Image Synthesis
6.1.3.4 2.5D IFS Terrains A number of fractal models have been applied to the generating of artificial terrains. They require minimal memory storage and can render terrains to infinite resolutions [115,116,121,122,222]. Terrain synthesis algorithms are usually based on the fractional Brownian motion fBm (see Chapter 2.2.2), since it is a good model for a great many types of terrain. Fractal terrains, when computed from the commonly used triangle and quadrilateral meshes, possess some disturbing visual artifacts. They can be defined as visible stages of the grid, known as creases [223]. It is possible to generalize the method of recursive mid-point subdivision to polygons of order 3 to 6 and 8 [115,116]. Subdivisions based on hexagons, as recommended by Mandelbrot, have been recognized as best in minimizing the creases [115]. It is possible to create an artificial terrain based on the IFS interpolation techniques introduced in this chapter. If we extend the IFS interpolator from two to three dimensions, we can create IFS surface patches [220]. The interpolation is based on a simple model that can be rendered in real time. This permits interactive modeling of terrains, changing their shape and roughness for ‘terrain engineering’. Three-dimensional interpolation is an extension of the 2D IFS interpolator presented in the previous section. The process consists of three main steps (as illustrated in Fig. 6.9).
Fig. 6.9. 2.5D fractal interpolation method (regular meshes).
Step 1 Some interpolation data are necessary. We need height-field points either extracted from real data or randomly generated. At least 25 points are required for a regular grid. We need to determine the free parameters a22i at this step as well. Step 2 The ‘leading’ vectors are interpolated to a specified terrain resolution, for instance, 1000 points. Step 3 All vertical vectors are interpolated to any desired resolution, for instance, 1000 points. The process of interpolation continues until every point in the leading vectors is visited. This results in an interpolated 2.5D fractal surface consisting of 1000 × 1000 = 1,000,000 height-field points.
nD Iterated Function Systems and Their Applications
109
Fig. 6.10. Regular 2.5D fractal terrains with different roughness factors.
It is possible to estimate all IFS map parameters for a given set of input data points. We need to determine manually or set randomly all roughness parameters a22i. Changing their values, we can generate smooth and rough terrains to any desired resolution. The IFS terrain model is purely deterministic and context dependent. Each of the interpolated point depends to some extent on all other points in the IFS attractor. The images of terrains with varying roughness are shown in Fig. 6.10. We can clearly see the creases in regular-grid-based applications. Interesting landscapes can be generated with roughness factors that depend on direction. Artifacts are clearly visible, but they can be exploited to model lava flow and some cliff structures.
110
Iterated Function Systems for Real-Time Image Synthesis
Irregular grids can facilitate the generation of terrains in which particular features can be developed or the shapes of hills and valleys can be varied.
Fig. 6.11. 2.5D fractal interpolation method (irregular meshes).
Fig. 6.12. Irregular 2.5D fractal terrains with different roughness factors.
nD Iterated Function Systems and Their Applications
111
IFS interpolation is so flexible that we can apply it to points that do not uniformly occupy the space. For the irregular IFS terrain, we apply four steps of interpolation (Fig. 6.11). Step 1 (As in the regular IFS interpolator) We need some interpolation data. We start with height-field points either extracted from real data or randomly generated. We need to determine the free parameters a22i at this step as well. Step 2 The “leading” vectors in vertical direction are interpolated to a specified terrain resolution, for instance, 1000 points. Step 3 We interpolate the displacement of the ‘leading’ vectors in horizontal direction with exactly the same terrain resolution, for instance 1000, points. Step 4 All remaining vertical vectors are interpolated to any desired resolution, for instance, 1000 points. The process of interpolation continues until every point in the leading vectors is visited. This results in an interpolated 2.5D fractal surface consisting of 1000 × 1000 = 1,000,000 height-field points. This technique allows us to generate irregular IFS terrain models (Fig. 6.12). The method can be used to generate context-dependent inserts within already existing terrain datasets.
Fig. 6.13. 2.5D fractal interpolation method (circular grids).
With slight modifications of irregular grid IFS terrains, we can apply the model to circular grids: Step 1 Some interpolation data with a certain polar topology (Fig. 6.13) are introduced. We start with height-field points either extracted from real data or randomly generated. We need to determine the free parameters a22i at this step as well. Step 2 The “leading” vectors that form centered circles are interpolated to a specified terrain resolution, for instance, 6000 points ( > 2Πr ), where r determines the radii of the crater. Step 3 We interpolate the radial displacement of the “leading” vectors with exactly the same terrain resolution, for instance, 6000 points.
112
Iterated Function Systems for Real-Time Image Synthesis
Step 4 All remaining radial vectors are interpolated to any desired resolution, for instance, r = 1000 pixels (points). The process of interpolation continues for the whole circle (360 degrees) until every point in the outer ‘leading’ circle is visited. This results in an interpolated 2.5D fractal crater (Fig. 6.14). If we interpolate the leading circular vectors, we can create curved and radial terrain features such as cliffs and craters [224]. IFS craters and volcanoes are quickly ‘engineered’ with the IFS interpolator. However, the rendering process is not as simple and straightforward for large terrain resolutions. Rounding errors can appear in trigonometric transformations. This can lead to the inconsistency of the rendered lattice or to visual artifacts similar to creases on regular grids [169]. We can use postprocessing, for instance, bi-linear interpolations, to quickly fill in the gaps in the interpolated images of a terrain. IFS terrain interpolators are simple and flexible. Initial height-field values need to be specified along with roughness factors. This should be done prior to the final rendering of regular, irregular or circular grids. The model is purely deterministic; therefore, the resulting terrain models will always exactly reflect the initial modeling conditions [120].
Fig. 6.14. Sample irregular 2.5D fractal crater.
6.1.3.5 2D Vector IFS The vector recursive rendering algorithm introduced in Chapter 5.8.2 works on two points in the image space. Considering the 2D IFS, we can imagine the VRR algorithm transforming and normalizing a pair of points on a plane. Those two points can be used to create a vector. The rendered vector changes its position and orientation at each iteration level of the recursive procedure. We can attach the vector to other CG primitives on the plane, like a triangle, a square or a circle. We can apply it to put on a plane any wire-frame or contoured shape that can be designed in a 2D CAD system [209]. The simplest implementation of the 2D vector IFS is made of lines and circles,
nD Iterated Function Systems and Their Applications
113
where the vector determines the length and for circles – their centers and radii (Fig. 6.15, Fig. Plate 5). The triangle is a geometrical figure that has a clearly visible orientation, thus the vector obtained from the VRR algorithm can put it on a plane as well as change its direction. The vector can be attached to the base of a triangle (two vertices). The third vertex is constructed to be a part of an equilateral triangle. The vertex is plotted in the direction rotated by 120 degrees from the base vector. The vector direction a is calculated from Eq. 62 (Chapter 5.8.2). Then for two points: q0 represented by a pair (x0, y0) and q1 represented by a pair (x1, y1) we can calculate the third point q2 (x2, y2) (Fig. 6.16):
x2 = x1 + d ( cos (tg −1 (a ))+120D ) y2 = y1 + d (sin (tg −1 (a ))+120D )
(95)
where d (Eq. 95) is a side length of the triangle. After a few iterations of the vector recursive rendering algorithm, we can clearly see the structure of the underlying IFS attractor (Fig. 6.17).
Fig. 6.15. Sample 2D vector IFS attractor created with lines and circles.
114
Iterated Function Systems for Real-Time Image Synthesis
Fig. 6.16. Construction of the IFS and triangles.
Fig. 6.17. Several stages of the IFS+CSG implementing triangles.
nD Iterated Function Systems and Their Applications
115
Fig. 6.18. IFS+CSG implementing squares and filled squares.
We can implement the same rendering method for a simple square shape. Its construction will be similar to that of the equilateral triangle. Two points describing the vector (q0, q1) form one side of the square. The third vertex is calculated to be perpendicular to this side (or rotated by 90 degrees). The fourth vertex is calculated as perpendicular to the former (or again rotated by 90 degrees) (Fig. 6.18). The rectangle can be treated as a geometrical structure with a texture image, transformed and mapped on a screen. A similar method of interactive rendering of iterated function systems was implemented in the image-based rendering algorithm discussed in Chapter 5.9. 6.2 3D IFS 6.2.1 Implementation Let a three-dimensional IFS be a limited case of the nD IFS introduced in Chapter 3.2. Then for a compact metric space F = R3, we will have an IFS set Ω = {F,( ωi ); i = 1, 2, ..., N} consisting of N affine maps ωi . For simplicity, we consider an IFS without probabilities, or assume that all associated probabilities are equal and sum up to 1. Any affine transformation ω :F→F or ω :R3→ R3 has the form
⎛ x′⎞ ⎛ x ⎞ ⎛ a11 ⎜ ⎟ ⎜ ⎟ ⎜ ⎜ y′⎟= ω⎜ y ⎟=⎜ a21 ⎜ ⎟ ⎜ ⎟ ⎜ ⎝ z′⎠ ⎝ z ⎠ ⎝ a31
a12 a22 a32
a13 ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟ ⎜ ⎟ a23 ⎟⎜ y ⎟+⎜b2 ⎟ ⎟⎜ ⎟ ⎜ ⎟ a33 ⎠⎝ z ⎠ ⎝ b3 ⎠
(96)
where ( x, y , z )( x′, y′, z ′) ∈ R are any points in a volumetric space. The matrix defined by a11,a12,a13,a21,a22,a23,a31,a32,a33 and the vector consisting of b1,b2,b3 can be represented by both linear and non-linear functions. 3
116
Iterated Function Systems for Real-Time Image Synthesis
6.2.2 Properties The 3D IFS has two main interpretations. The most straightforward one is of the binary three-dimensional IFS representing volumetric fractal structures. We can also consider the factor z to be the parameter denoting the grayscale value for a twodimensional image of the IFS attractor. Pseudo-colour images can be addressed in a similar way, where z would determine the index of the colour palette assigned to a given IFS model. For a plain three-dimensional representation of iterated function systems, the matrix defined by nine parameters (a11,a12,a13,a21,a22,a23,a31,a32,a33) denotes a combination of a rotation, scaling and a sheer performed in a 3D space. It is a simple extension of the 2D model to a volumetric case. The vector defined by (b1,b2,b3) denotes translations in the X,Y and Z directions. The 3D IFS does not have to be hyperbolic, as long as the average contraction is obeyed. Considering an extended version of the 2D IFS, the z parameter can be associated with a grayscale value. The z parameter can be the index to any pseudo-colour palettes as well. Then the meaning of the matrix given in Eq. 96 will be different. The parameters (a11,a12,a21,a22) and (b1,b2) denote the classic affine transformations on a plane as in the 2D IFS case. a31 changes grayscale/pseudo-colour values along the X axis (a kind of linear shading). a32 determines similar changes in the Y direction (vertical shading). a33 denotes selfsimilarity in the colour function. a13 and a23 introduce the displacement of pixel positions according to the colour value (similar to colour bleeding). The parameter b3 is a basic colour value for the extended IFS model. Both interpretations of 3D iterated function systems offer several interesting applications. 6.2.3 Applications 6.2.3.1 2D + GrayScale/Palette IFS Fractals Typical grayscale images of iterated function systems are connected with a definition of mass or measure associated with the IFS attractor [72]. Even with a simple random iteration algorithm, we can assign some measure corresponding to the frequencies with which certain pixels in the image (occupied by the IFS attractor) are visited. We can collect the statistics over the entire image assigned to the rendering area. After the appropriated number of iterations (see Chapter 5.13), we can normalize the results and map them onto a grayscale or a pseudo-colour palette in order to display a measure over the IFS attractor. The method is slow but allows us to make interesting renderings of both monochrome and pseudo-colour IFS fractals (Fig. 6.19). The constant mass algorithm (Chapter 5.4) is another, improved method to obtain similar representations of IFS attractors. Similar results can be obtained with the 2D+grayscale model of iterated function systems. The most important parameter a33 determines the self-similarity of the grayscale/pseudo-colour values associated with the structure of the IFS attractor (Fig. Plate 6). We can define fully deterministic colour IFS fractals only by an adjustments of all a and b parameters. The model reflects all features of the
nD Iterated Function Systems and Their Applications
117
measure related to the 2D binary IFS [174,196]. The simple version of this model has found its place in the RIFS image encoding/decoding scheme [170,171]:
⎛ x′ ⎞ ⎜ ′ ⎟ ⎜ y ⎟= ⎜ index′ ⎟ ⎝ ⎠
⎛ a11 ⎜ ⎜ a21 ⎜a ⎝ 31
a12 a22 a32
0 ⎞ ⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟ ⎜ ⎟ 0 ⎟ ⎜ y ⎟ + ⎜ b2 ⎟ 0 ⎟⎠ ⎜⎝ index ⎟⎠ ⎜⎝ b3 ⎟⎠
(97)
where index denotes the grayscale palette entry or simply the grayscale value. a31 changes grayscale values horizontally. a32 determines similar changes in vertical direction. The parameter b3 > 0 is a basic grayscale value of a particular RIFS code. We have to remember that the image-based rendering algorithm (described in Chapter 5.9) also transforms grayscale images of textures into themselves according to the weight factor somehow related to the measure. The 3D IFS interpreted as a 2D IFS+grayscale can yield similar results. We can apply most of the IFS rendering algorithms discussed in the previous chapter to render grayscale IFS fractals. It is also possible to interpret RGB channels as separate grayscale images composed into one single true-colour image. This is particularly visible in image compression schemes, where the YUV colour model is used to separate and compress luminance and chrominance image information channels. There are no obstacles to model other multi-channel images in the same way (HSV, CMYK or YUV). Further extensions of the nD IFS model allow us to do it more efficiently (Chapter 7).
Fig. 6.19. Grayscale interpretation of the Sierpinski-like attractor.
118
Iterated Function Systems for Real-Time Image Synthesis
6.2.3.2 3D Binary IFS Fractals The 3D binary iterated function system is a straightforward extension of the binary 2D IFS model. The matrix and vector parameters (Eq. 96) denote geometric transformations in the three-dimensional space. We can apply a slightly modified version of IFS rendering algorithms to obtain a volumetric representation of iterated function systems. As a result of rendering, we will obtain a volume of voxels describing the 3D attractor of the underlying IFS codes. The binary 3D IFS allows constructing the classic fractal volumes such as the Sierpinski pyramid (Fig. 6.20) or the Menger cube. The same method can be applied to non-hyperbolic iterated function systems to generate more irregular and complex structures. The point recursive rendering algorithm, while applied to the 3D IFS, still delivers high-performance results. It is possible to render volumetric IFS attractors in real time [207,225]. The simplest version of this model can be used to quickly preview fractal shapes before further adjustments are performed in an interactive fractal shape modeler. We can apply the collage theorem and supporting ones to construct IFS volumes, although the process is not as intuitive as in the simpler twodimensional cases.
Fig. 6.20. Volumetric IFS representing the Sierpinski pyramid.
6.2.3.3 2D Vector IFS Fractals + Selection of CSG Primitives The flat representation of the vector IFS (Chapter 6.1.3.5) operates on two points transformed in the image space. They can describe a vector in the X,Y coordinates that changes its position and orientation at each level of the vector recursive rendering algorithm (Chapter 5.8.2).
nD Iterated Function Systems and Their Applications
119
Fig. 6.21. Set of two-dimensional graphics primitives indexed by Z.
The Z function could be an index pointing to any two-dimensional primitive such as a line, a circle, a triangle or an arbitrary flat shape (Fig. 6.21). If we consider texture maps to be graphic primitives, then the model can implement the image-based rendering algorithm (Chapter 5.9) to visualize IFS fractals. The embedded function of the CSG selection method is more visually appealing in three-dimesional applications and is discussed in the following sections.
6.2.3.4 3D Vector IFS Fractals + CSG Primitives We have already discussed the flat representation of the vector IFS (Chapter 6.1.3.5), which operates on two points transformed in the image space. Those points can be also transformed in the 3D space. They can describe a vector in the X,Y,Z coordinates that changes its position and orientation at each level of the vector recursive rendering algorithm (Chapter 5.8.2). As in the 2D case, we can attach the vector to any 3D CSG primitive element such as a sphere, a cube, a cylinder or a cone [71]. We can use any other vector geometry objects designed in a 3D CAD system [210]. The simplest implementation is made of spheres, with vectors defining their centres and radii (Fig. 6.22). Considering the cone primitive shape, we can use the vector either to determine its height and direction, or to define a bottom center and its radius (Fig. 6.23). The same holds for cubes. After a few initial iterations, the structure of volumetric IFS is approximated. The structure is built from the basic 3D elements. The method is so efficient that it can be easily used in any programming environment, including low-level OGL and DIRECT-X as well as high-level Java3D, C# and Xj3D [210]. The structure of a flat-shaded objects quickly approximates the IFS attractor. This feature makes it useful for interactive design of fractal models, based on the guessand-try procedure with an instant preview of the resulting fractal volumes.
120
Iterated Function Systems for Real-Time Image Synthesis
Fig. 6.22. 3D IFS+CSG implementing spheres.
Fig. 6.23. 3D IFS+CSG implementing cones.
nD Iterated Function Systems and Their Applications
121
6.3 4D IFS
6.3.1 Implementation
Let the four-dimensional IFS be a limited case of the nD IFS introduced in Chapter 3.2. For a compact metric space F=R4, we will have an IFS set Ω = {F,( ωi ); i = 1, 2, ..., N} consisting of N affine maps ωi . We may consider the IFS with probabilities in order to ensure the average contraction of the fractal model. For a simpler construction of IFS rendering algorithms, we may assume that all probabilities are equal and sum to 1. Any affine transformation ω :F→F or ω :R4→ R4 has the form
⎛ x′ ⎞ ⎛ x ⎞ ⎛ a11 ⎜ ⎟ ⎜ ⎟ ⎜ ⎜ y′ ⎟= ω⎜ y ⎟=⎜ a21 ⎜ z′ ⎟ ⎜ z ⎟ ⎜ a31 ⎜ ⎟ ⎜ ⎟ ⎜ ⎝G′⎠ ⎝G ⎠ ⎝ a41
a12
a13
a22 a32
a23 a33
a42
a43
a14 ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟ ⎜ ⎟ a24 ⎟⎜ y ⎟ ⎜b2 ⎟ + a34 ⎟⎜ z ⎟ ⎜ b3 ⎟ ⎟⎜ ⎟ ⎜ ⎟ a44 ⎠⎝G ⎠ ⎝b4 ⎠
(98)
3
where ( x, y , z )( x′, y′, z′) ∈ R are any points in a 3D space. The parameter G can have different, application-specific meanings. The matrix and the vector defined by Eq. 98 can be represented by both linear and non-linear functions. 6.3.2 Properties
The 4D IFS can be treated as an extended version of the binary 3D IFS occupying a volumetric space R3. It can be also treated as a 3D vector model with an embedded function indexing CSG primitives. Considering the former case, the matrix consisting of nine elements (a11,a12,a13,a21,a22,a23,a31,a32,a33) and the vector consisting of three elements (b1,b2,b3) define transformations in a three-dimensional space (as discussed in Chapter 6.2.). We can consider the function G to define grayscale values or, alternatively, the entry to the pseudo-colour palette. It is also possible to interpret the G value as the ALPHA (transparency) channel for volumetric iterated function systems, applied both to point and vector IFS models. In all cases, the parameters a14,a24,a34 define the displacement of voxels or CSG elements according to the local G value. The value of G’ and G depends on five parameters:
G′= a41 ⋅ x + a42 ⋅ y + a43 ⋅ z + a44 ⋅G + b4
(99)
Considering x,y,z to be coordinates in a 3D space, we can define the meaning of all parameters. a41,a42,a43 determine the local shading in horizontal, vertical and in-depth directions, respectively. a44 represents the self-similarity of grayscale/pseudo-colour or
122
Iterated Function Systems for Real-Time Image Synthesis
transparency over the IFS attractor. b4 determines the basic value either for a palette entry or for the ALPHA channel. For the vector IFS with the CSG index, Eq. 99 will have a different meaning. For x,y,z being coordinates in a 3D space, a41,a42,a43 determine the selection of 3D primitives according to the position in the volumetric space. a44 represents selfsimilarity in object distribution over the IFS attractor. b4 determines the basic shape index. As in the previous chapter, the 4D IFS does not have to be hyperbolic nor linear. 6.3.3 Applications
6.3.3.1 3D Grayscale/Palette Fractals For the binary three-dimensional implementation of the IFS, we can use almost all algorithms described in Chapter 5. However, extending the model with the embedded G function (Eq. 99) slightly changes the grayscale model. This may influence the constant mass algorithm. The image-based rendering algorithm does not work with volumes at all. The 4D IFS model has two possible raster interpretations of the G function. Therefore, we will have two classes of IFS attractors. The first one will define grayscale/pseudo-colour 3D IFS fractals, where PRR and VRR are implemented. The second one includes ALPHA-channel models of both volumetric and vector iterated function systems. Considering the first model, we can start with a quick preview of binary IFS attractors in order to determine its basic shape. Then, changing the values of the parameters defined by Eq. 99, we can add a texture to three-dimensional fractal structures (Fig. Plate 7). The same situation can be found in vector 3D CSG modeling. The first few iterations of the VRR algorithm permit brief modeling of the fractal structure. Then we can introduce colour variations and render it to a finer detailed version (Fig. Plate 8). Surprisingly, the ALPHA channel does not bring valuable visual clues during the rendering process. The reason behind this may be the complex structure of the IFS fractal, obscuring its local transparencies. The full-colour volumetric representation of iterated function systems with the ALPHA channel seems to be much more visually appealing than the grayscale version of the 3D IFS model. 6.3.3.2 3D Vector IFS with a Selection of CSG Primitives We can consider the embedded G function to be the index to a set of threedimensional vector primitives (Fig. 6.24). Then 4D iterated function systems act on volumetric vector models. Such an IFS would operate on a set of non-scaleable indexes. Selected shapes will be positioned in the three-dimensional space according to the structure of the IFS attractor (Fig. 6.25).
nD Iterated Function Systems and Their Applications
123
Fig. 6.24. Embedded G function and an index pointing to CSG primitive shapes.
Fig. 6.25. Sample renderings of the IFS attractor built with an embedded selection of vector graphics primitives.
The model can be applied to any 3D object (including volumetric primitives). It is also possible to introduce an arbitrary vector shape designed in the CAD environment [226,227]. It would be re-scaled and placed in the space of the IFS attractor. We can imagine a situation when the IFS attractor depicts the tree crown. When viewed from a distance, it can be rendered as the raster model. When the point of observation is closer to the attractor, the raster nodes can be replaced with properly selected and positioned models of leaves and flowers, and so on.
124
Iterated Function Systems for Real-Time Image Synthesis
6.4 5D IFS
6.4.1. Implementation
Let a five-dimensional IFS be a limited case of the nD IFS introduced in Chapter 3.2. Then for a compact metric space F = R5, we will have an IFS set Ω = {F,( ωi ); i = 1, 2, ..., N} consisting of N affine maps ωi ,where each ω :F→F or ω :R5→ R5. To ensure that the IFS obeys the average contraction factor, we may consider the IFS with probabilities assuming that all associated probabilities are equal and sum up to 1. Any affine transformation has the form
⎛ x′⎞ ⎛ x ⎞ ⎛ a11 ⎜ ⎟ ⎜ ⎟ ⎜ ⎜ y′⎟ ⎜ y ⎟ ⎜ a21 ⎜ r′ ⎟= ω⎜ r ⎟=⎜ a31 ⎜ ⎟ ⎜ ⎟ ⎜ ⎜ g′⎟ ⎜ g ⎟ ⎜ a41 ⎜ ⎟ ⎜ ⎟ ⎜ ⎝ b′ ⎠ ⎝ b ⎠ ⎝ a51
a12
a13
a14
a22
a23
a24
a32
a33
a34
a42
a43
a44
a52
a53
a54
a15 ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟ ⎜ ⎟ a25 ⎟⎜ y ⎟ ⎜b2 ⎟ a35 ⎟⎜ r ⎟+⎜ b3 ⎟ ⎟⎜ ⎟ ⎜ ⎟ a45 ⎟⎜ g ⎟ ⎜b4 ⎟ ⎟⎜ ⎟ ⎜ ⎟ a55 ⎠⎝ b ⎠ ⎝ b5 ⎠
(100)
( x, y )( x′, y′) ∈ R 2 are any points on the image plane and (r′, g′, b′), (r , g , b) ∈ R 3 are any coordinates in the RGB colour space. The matrix
where
and the vector defined by Eq. 100 can be constructed from linear and non-linear functions. 6.4.2 Properties
The 4D IFS can be treated not as a further extension of the 3D IFS model, but rather as a full-colour representation of the flat 2D IFS. This interpretation seems to fit all properties of the 5D IFS model. Considering the model described by Eq. 80, the matrix defined by (a11,a12,a21,a22) and the vector defined by (b1,b2) represent a classic IFS on a plane (Chapter 6.1.1). Therefore, they describe rotations, a sheer, scaling and translations on a plane. The remaining parameters will have different meaning. a13,a14,a15,a23,a24,a25 describe geometrical distortions of the IFS attractor induced by the local colour components. b3,b4,b5 determine the basic values for the RGB colour components. a31,a32,a41,a42,a51,a52 describe the local shading for the RGB colour components in the horizontal and vertical directions, respectively. a33,a44,a55 are responsible for the self-similarity of colour components over the IFS attractor. a34,a35,a43,a45,a53,a54 determine cross-dependencies between the colour components [197].
nD Iterated Function Systems and Their Applications
125
6.4.3 Application: 2D + RGB and 2D + HSI IFS Fractals
There are many possible colour-space models for the description of digital images (Chapter 1.1). The red green blue model of the colour space is most popular in computer graphics. Most visible colours can be obtained by mixing three components or colour channels. In order to get a full-colour image of the IFS attractor, we can mix separate grayscale channels, assigning them colour information. Similar results can be obtained with the 5D IFS represented as 2D IFS+RGB [197]. If the average contraction is obeyed, we can expect the five-dimensional IFS fractal to occupy both the 2D image space and the 3D colour space. A number of interesting IFS fractals can be created with the 5D IFS model (Fig. Plate 9). We can apply the MPA or PRR algorithms to perform rendering in real time. Unfortunately, the collage theorem seems to be helpful only in shape modeling of IFS attractors. An instant generation of fractals, however, permits interactive adjustments of colour component values. Nevertheless, true-colour IFSs are purely deterministic and rely on the classic geometrical transformations. All IFS attractors are fully scalable and transformable. The continuous dependence on real parameters (Chapter 4) permits animation and morphing between IFS attractors [105,198]. 5D IFS models have low storage memory requirements. We have to remember only the matrix and vector coefficients. The RGB model matches hardware displays and human eye perception. The classic RGB representation of IFS codes needs the conversion of real numbers associated with (r,g,b)(r’,g’,b’) to eight bits (256 levels) of RGB display components. To do so, we need to know the upper and lower bounds of the (r’,g’,b’) values generated by the IFS rendering algorithm. For a hyperbolic IFS, we can assume that all (x’,y’,r’,g’,b’) values are bigger than –1 and lower than 1. We have to estimate the minimum and maximum values for non-hyperbolic IFSs. Then we normalize the output according to the obtained values. minR and maxR (and other bounding values for the G and B components) can be quickly estimated after a few iterations of the PRR algorithm. Then we can store these values for a given IFS model and use them in the final rendering on the screen. Considering the eight-bit colour model, the simplest calculation of the Rdisplay screen pixel value will be
Rdisplay =
r′− min R
( max R− min R )
∗ 255
(101)
Similar equations can be applied to the green and blue components. We can use colour depth greater than eight bits for a better display and for printing by a simple adjustment of Eq. 101. The hue saturation intensity (HSI) colour space is a much more convenient model, as far as an interactive manipulation and design of colour images are considered. This model and its variations (the hue saturation value, hue lightness saturation) are very popular in digital painting tools. We can substitute the r,g,b parameters with the h,s,i parameters. Then, the 5D IFS model as a flat 2D IFS + HIS colour model will be described by
126
Iterated Function Systems for Real-Time Image Synthesis
⎛ x′⎞ ⎛ x ⎞ ⎛ a11 ⎜ ⎟ ⎜ ⎟ ⎜ ⎜ y′⎟ ⎜ y ⎟ ⎜ a21 ⎜ h′⎟= ω⎜ h ⎟=⎜ a31 ⎜ ⎟ ⎜ ⎟ ⎜ ⎜ s′ ⎟ ⎜ s ⎟ ⎜ a41 ⎜ ⎟ ⎜ ⎟ ⎜ ⎝ v′ ⎠ ⎝ v ⎠ ⎝ a51
a12
a13
a14
a22
a23
a24
a32 a42
a33 a43
a34 a44
a52
a53
a54
a15 ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟ ⎜ ⎟ a25 ⎟⎜ y ⎟ ⎜b2 ⎟ a35 ⎟⎜ h ⎟+⎜ b3 ⎟ ⎟⎜ ⎟ ⎜ ⎟ a45 ⎟⎜ s ⎟ ⎜b4 ⎟ ⎟⎜ ⎟ ⎜ ⎟ a55 ⎠⎝ v ⎠ ⎝b5 ⎠
(102)
where the matrix defined by (a11,a12,a21,a22) and the vector defined by (b1,b2) have the same meaning as in the 2D IFS+RGB model. The remaining parameters determine the HSI colour space components of the iterated function system on a plane. a13,a14,a15,a23,a24,a25 are still geometrical displacements of the IFS attractor induced by the local colour components. b3 determines a basic value for the hue colour component. b4 determines a basic value for the saturation colour component, and b5 determines a basic value for the intensity colour component (the brightness of the pixel). a31,a32 change hue in the horizontal and vertical directions (colour bleeding). a41,a42 change the saturation of colour in the X and Y directions, respectively. a51,a52 describe the local shading of the IFS attractor (changes in brightness) in horizontal and vertical directions, respectively. a33,a44,a55 are responsible for the self-similarity of the HSI colour components over the IFS attractor. a34,a35,a43,a45,a53,a54 determine cross-dependencies between the HSI colour components. The HSI values range between 0 and 1. Therefore, for a linear hyperbolic 2D IFS + HSI that covers the unit square, we can represent colours almost straightforwardly from the values obtained from the IFS rendering algorithm. For non-hyperbolic iterated function systems, we have to normalize the results to fit the range of the HSI colour model. The 2D IFS + HSI colour model offers a wide range of visually attractive fractals (Fig. Plate 10). The fractal images can have a rich texture and complex local shading that mimic the 3D structure. Other colour models can be applied to the 5D IFS model (CMY, YUV). Their meaning is not as straightforward as in the RGB and HSI cases. Other models are hard to manipulate and seem to bring no added features; therefore, their development is not considered in this monograph. 6.5 6D IFS
6.5.1 Implementation
Let a six-dimensional IFS be a limited case of the nD IFS introduced in Chapter 3.2. Then for a compact metric space F = R6, we will have an IFS set Ω = {F,( ωi ); i = 1, 2, ..., N} consisting of N affine maps ωi ,where each ω :F→F or ω :R6→ R6. Considering this model, we assume that the IFS obeys the average contraction factor. Any affine transformation has the form
nD Iterated Function Systems and Their Applications
⎛ x′⎞ ⎛ x ⎞ ⎛ a11 ⎜ ⎟ ⎜ ⎟ ⎜ ⎜ y′⎟ ⎜ y ⎟ ⎜ a21 ⎜ z′ ⎟ ⎜ z ⎟ ⎜ a31 ⎜ ⎟= ω⎜ ⎟=⎜ ⎜ r′ ⎟ ⎜ r ⎟ ⎜ a41 ⎜ g′⎟ ⎜ g ⎟ ⎜ a 51 ⎜ ⎜ ⎟ ⎟ ⎜ ⎜ ⎟ ⎟ ⎜ ⎜ ⎝ b′ ⎠ ⎝ b ⎠ ⎝ a61 where ( x′, y′, z′), ( x, y , z ) ∈ R
3
a12 a22
a13 a23
a14 a24
a15 a25
a32
a33
a34
a35
a42
a43
a44
a45
a52 a62
a53 a63
a54 a64
a55 a65
a16 ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟ ⎜ ⎟ a26 ⎟⎜ y ⎟ ⎜b2 ⎟ a36 ⎟⎜ z ⎟ ⎜ b3 ⎟ ⎟⎜ ⎟+⎜ ⎟ a46 ⎟⎜ r ⎟ ⎜b4 ⎟ a56 ⎟⎜ g ⎟ ⎜b5 ⎟ ⎟ ⎜ ⎟ ⎟ ⎜ ⎟⎜ ⎜ ⎟ ⎟ a66 ⎠⎝ b ⎠ ⎝b6 ⎠
127
(103)
are any points in the volumetric space and
3
(r′, g′, b′), (r , g , b) ∈ R are any coordinates in the RGB colour space. Alternatively,
⎛ x′⎞ ⎛ x ⎞ ⎛ a11 ⎜ ⎟ ⎜ ⎟ ⎜ ⎜ y′⎟ ⎜ y ⎟ ⎜ a21 ⎜ r′ ⎟ ⎜ r ⎟ ⎜ a31 ⎜ ⎟= ω⎜ ⎟=⎜ ⎜ g′⎟ ⎜ g ⎟ ⎜ a41 ⎜ b′ ⎟ ⎜ b ⎟ ⎜ a 51 ⎜ ⎜ ⎟ ⎟ ⎜ ⎜ ⎟ ⎟ ⎜ ⎜ ′ a a a ⎝ l ⎠ ⎝ l ⎠ ⎝ 61
a12
a13
a14
a15
a22 a32 a42
a23 a33 a43
a24 a34 a44
a25 a35 a45
a52 a62
a53 a63
a54 a64
a55 a65
a16 ⎞⎛ x ⎞ ⎛ b1 ⎞ ⎟⎜ ⎟ ⎜ ⎟ a26 ⎟⎜ y ⎟ ⎜b2 ⎟ a36 ⎟⎜ r ⎟ ⎜ b3 ⎟ ⎟⎜ ⎟+⎜ ⎟ (104) a46 ⎟⎜ g ⎟ ⎜b4 ⎟ a56 ⎟⎜ b ⎟ ⎜b5 ⎟ ⎟ ⎟⎜ ⎜ ⎟ ⎟ ⎜ ⎜ ⎟ ⎟ a66 ⎠⎝ al ⎠ ⎝b6 ⎠
( x′, y′), ( x, y ) ∈ R 2 are any points on the image plane and (r′, g′, b′), (r , g , b) ∈ R 3 are any coordinates in the RGB colour space, and (a′l )(al ) ∈ R determines the alpha channel (transparency) for the image of the IFS
where
attractor. The matrix and the vector defined by Eqs. 83 and 84 can be constructed from linear and non-linear functions. 6.5.2 Properties
The properties of the 6D IFS model will reflect two possible interpretations: a volumetric case depicted by Eq. 103 and a flat image described by Eq. 104. For the first case, the matrix defined by a11,a12,a13,a21,a22,a23,a31,a32,a33 and the vector consisting of b1,b2,b3 represent geometrical transformations in a 3D space. The remaining parameters will have a model similar to the 2D IFS+RGB, but they address three instead of two dimensions. a14,a15,a16,a24,a25 and a26,a34,a35,a36 are responsible for geometric displacements introduced by the local colour values. b4,b5,b6 determine the basic RGB values. a44,a55,a66 are responsible for self-similarity in colour over the IFS attractor. a41,a42,a43 and a51,a52,a53 and a61,a62,a63 denote shading variations of RGB in the horizontal, vertical and in-depth directions. The parameters a45,a46,a54,a56,a64,a65 are responsible for colour cross-dependencies.
128
Iterated Function Systems for Real-Time Image Synthesis
The flat representation of a 6D IFS (2D IFS+RGB ALPHA) will have a slightly different interpretation. Here we have a 2D image space (x,y), a 3D colour space (r,g,b) and 1D ALPHA/transparency values. Then the matrix defined by (a11,a12,a21,a22) and the vector defined by (b1,b2) have the same meaning as in the binary 2D IFS model. The values a13,a14,a15,a16,a23,a24,a25,a26 are, again, responsible for geometrical displacements induced by the local colour and ALPHA values. b3,b4,b5 determine the basic values of the RGB colour components while b6 determines a basic value of the ALPHA channel. a31,a32,a41,a42, a51,a52 are the local shadings of the RGB in the horizontal and in vertical directions, respectively. a61,a62 change the transparency of the IFS attractor. a33,a44,a55 are self-similarities in the colour of the IFS fractal while a66 defines the self-similarity of the ALPHA channel. a63,a64,a65 describe how the local colour influences the transparency of the IFS attractor, and a36,a46,a56 define how the transparency influences the RGB components. Other colour models can be applied as well. We can easily substitute r,g,b with h,s,i for other visual effects. The meaning of all matrix parameters will reflect the 2D IFS + HSI model described in Chapter 6.4.3. Vector parameters will define the basic values for the HSI model, then. 6.5.3 Applications
6.5.3.1 3D + RGB and 3D + HSI Volumetric IFS Fractals The (x,y,z) matrix defines the three-dimensional binary IFS over the volumetric data set. The remaining (r,g,b) parameters determine colour components in terms of the red, green and blue values. This is the simplest and the fastest interpretation of the volumetric colour IFS model [207]. We can apply most slightly modified IFS rendering algorithms to handle colour-coded voxels. However, for possible zooms, panning and the need for consistent data, the point recursive rendering algorithm seems to be the best choice. For a relatively small resolution of the volumetric output, we can achieve real-time rendering of fractal shapes. Among possible volumetric models we can find a colour version of the Sierpinski pyramid or the Menger cube (Fig. Plate11). Non-hyperbolic IFSs can bring us a variety of three-dimensional fractal structures (Fig. Plate 12). Their structure is fairly complex. The collage theorem suitable for 2D cases is not straightforward when applied to fractal volumes. We have to find self-similarities in the inner structure of complex objects, which seems to be a difficult task. We can construct a volumetric fractal with the HSI colour model instead of RGB parameters. This gives better control over the chosen colour and its shade variations over the IFS attractor (Fig. Plate 13). 6.5.3.2 3D + RGB and 3D + HSI Vector IFSs + CSG The same 3D IFS +RGB and 3D IFS + HSI models can be applied to CSG primitives, as long as we use the VRR algorithm (see Chapter 6.2.3) [210]. We can adjust the colours of the spheres, cones and cubes used in the construction of the IFS fractal. If
nD Iterated Function Systems and Their Applications
129
we keep the number of recursive levels small, we can quickly obtain a CSG approximation of the attractor. Since the basic elements are solids rendered with some shading, their appearance is quite different compared to volumetric 3D IFS +RGB (or 3D IFS + HSI) models (Fig. Plates 14, 15). Again, we start with the basic shape modeling, then we can adjust colour channels in order to get a full-colour representation of IFS fractals. 6.5.3.3 2D + RGB ALPHA IFS Fractals The 2D IFS + RGB ALPHA model is based on 6D iterated function systems. In its basic form, it can be treated as an extended version of the 2D IFS + RGB model described in Chapter 6.4. We can use both pixel-based IFS rendering algorithms and the VRR algorithm, which works with primitive colour and semi-transparent shapes on a plane (circles, squares and triangles). The ALPHA channel depends on seven parameters:
a′= a61 ⋅ x + a62 ⋅ y + a63 ⋅r + a64 ⋅ g + a65 ⋅b + a66 ⋅a + b6
(105)
This representation is similar to the definition of G given in Eq. 99. Considering x,y to be coordinates in the image space, we can define the meaning of all parameters. a61,a62 determine the local shading in the horizontal and vertical directions, respectively. a63,a64,a65 define the influence of the local colour values on the transparency. a66 represents the self-similarity of the transparency over the IFS attractor. b6 determines the basic value for the ALPHA channel. The IFS model based on RGB ALPHA is a natural implementation fully compatible with models handling semi-transparent image textures. For more intuitive colour manipulation, we can introduce the HSI instead of the RGB model. The transparency channel allows us to create several layers of IFS fractal images. It is possible to make collages consisting of real images and IFS attractors (Fig. Plates 16, 17, 18). 6.6 7D IFS
6.6.1 Implementation
Let a seven-dimensional IFS be a limited case of the nD IFS model introduced in Chapter 3.2. Then for a compact metric space F = R7, we will have an IFS set Ω = {F,( ωi ); i = 1, 2, ..., N} containing N affine maps ωi ,with each ω :F→F or
ω : R7→ R7. The IFS must obey the average contraction factor to ensure that this
model has an associated attractor. Any affine transformation has the form
130
Iterated Function Systems for Real-Time Image Synthesis
⎛ x '⎞ ⎛ x ⎞ ⎛ x ⎞ ⎛ b1 ⎞ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ y '⎟ ⎜ y ⎟ ⎜ y ⎟ ⎜b2 ⎟ ⎜ z ' ⎟ ⎜ z ⎟ ⎛ a " a ⎞⎜ z ⎟ ⎜ b3 ⎟ 17 ⎜ ⎟ ⎜ ⎟ ⎜ 11 ⎟⎜ ⎟ ⎜ ⎟ ' r r # % # = ω = ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ r ⎟+⎜b4 ⎟ ⎜ g '⎟ ⎜ g ⎟ ⎜ a " a ⎟⎜ g ⎟ ⎜ b ⎟ 77 ⎠ ⎜ ⎟ ⎜ ⎟ ⎝ 71 ⎜ ⎟ ⎜ 5⎟ ⎜ b '⎟ ⎜ b ⎟ ⎜ b ⎟ ⎜b6 ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎝ I '⎠ ⎝ I ⎠ ⎝ I ⎠ ⎝b7 ⎠ where ( x′, y′, z′), ( x, y, z ) ∈ R
3
(106)
are any components of the volumetric image 3
space while ( r′, g′, b′), ( r , g , b) ∈ R define coordinates in the RGB colour space. The parameter I defines the indexing function that acts on the set of computer graphics primitives. The matrix given in Eq. 106 can be constructed from both linear and non-linear equations. 6.6.2 Properties
The 7D IFS model is a sample case when the seven-dimesional space is shared among the image volumen, the colour model and the one-dimensional object code space. The model is similar to a great extent to the 6D IFS discussed in the previous section. The matrix defined by a11,a12,a13,a21,a22,a23,a31,a32,a33 and the vector consisting of b1,b2,b3 represent geometrical transformations in a 3D space. The remaining parameters address the popular RGB colour model, but they address three instead of two dimensions. a14,a15,a16,a24,a25, a26,a34,a35,a36 are responsible for geometric displacements introduced by the local colour values. b4,b5,b6 determine the basic RGB values. a44,a55,a66 are responsible for self-similarity in colour over the IFS attractor, while a41,a42,a43 and a51,a52,a53 and a61,a62,a63 denote shading variations of RGB in the horizontal, vertical and in-depth directions. The parameters a45,a46,a54,a56,a64,a65 are responsible for colour cross-dependencies. The main difference is in the I indexing function defined by the equation
I ' = a71 ⋅ x + a72 ⋅ y + a73 ⋅ z + a74 ⋅r + a75 ⋅ g + a76 ⋅b + a77 ⋅ I + b7 (107) The selection of CG primitives (including the elements of CSG) can be limited to the b7 parameter. Setting all a7j (j = 1,2, ..., 7) parameters to 0 would result in the assignment of the specific primitive shape to the whole parts-codes of the IFS attractor. The a77 parameter determines self-similarity in the distribution of various shapes along the structure of the attractor. By keeping that value close to 1.0, we can force a high diversity in the placement of CG primives in the space occupied by the volumetric IFS. a71,a72,a73 define shape distribution to be position-dependent. a74,a75,a76, while set to non-zero values, would enable colur values to influence the choice of CG primitives.
nD Iterated Function Systems and Their Applications
131
6.6.3 Application of 3D + RGB Vector IFS Fractals with CSG Selection
Although the 7D model can be interpreted in many ways, the sample application is the vector 3D, full RGB colour model with a selection of CSG primitives embedded in the IFS code. The (x,y,z) matrix defines the three-dimensional vector IFS set. The remaining (r,g,b) parameters determine colour components in terms of the red, green and blue values. The index I controls the choice of the CSG primitive to be coloured with the calculated RGB value. This is the simplest and the most straightforward interpretation of the volumetric colour IFS model [207]. We can apply the vector recursive rendering algorithm to handle the colour-coded vector attractor. Possible volumetric models include colour-coded versions of volumetric spirals (Fig. Plate 19). The non-hyperbolic IFS can bring us a variety of three-dimensional fractal structures (Fig. Plate 20). Their structure is fairly complex. The collage theorem suitable for 2D cases cannot be applied straightforward to fractal volumes. Again, we have to find self-similarities in the inner structure of complex objects, which sometimes seems to be a difficult task. We can construct a volumetric fractal with the HSI colour model instead of RGB parameters. This would give better control over the chosen colour and its shade variations over the IFS attractor.
7 Conclusions, Directions for Further Development Fractals used to be perceived to be a mathematical curiosity. Nowadays, they are an integral part of almost all computer graphics applications. The relatively simple idea of fractal modeling provides an infinite number of complex and amazing images. There is a wide literature that addresses the subject of fractal-based image synthesis. The main disadvantage of most of the published image generation methods is a long time of rendering and rather simple colour-space models. Very popular in 2D, fractals can hardly be found in three-dimensional representations. The computational complexity of popular fractal rendering algorithms prevents their application to realtime computer graphics. On the other hand, most fractal images are generated by random sequences. This reduces the interaction between humans and the computer to the choice of aesthetically pleasing images from a series of random renderings. In this monograph, the emphasis is put on iterated function systems, which are simple and purely deterministic. Such features are very attractive for research in interactive image analysis and synthesis. Both raster and vector graphics representations (introduced briefly in Chapter 1) are available for the exploration of fractal models. Fractal modeling for image generation has a long history. Chapter 2 presented a short summary of the most representative fractal geometry models used in many commercial and freely available graphic design environments. Lindenmayer systems, affine fractals, self-squaring models, shape grammar along with genetic programming, particle systems and springs, diffusion limited aggregation, cellular automata and strange attractors provide algorithmic background for many models implemented as shaders and modelers. Iterated function systems are particularly interesting, although their application to computer graphics is somewhat underestimated. The IFS model was popularized and greatly developed by Barnsley and Demko several decades ago. The model was orginally accompanied by a few rendering algorithms that permitted an easy implementation on almost any personal computer equipped with graphic display. This model was presented in Chapter 3 along with other IFS-related extensions. RIFSs and PIFSs are the most popular extensions to IFS theory. They are used in image compression and decompression schemes (Chapter 3.3.2). The fractal image compression and decompression process is very efficient but highly asymmetrical. Compression requires much more resources than the decompression process. Polar iterated function systems present an interesting challenge for an automated solution to the inverse problem (Chapter 3.3.3). Also the recent developments in self-congruent IFSs that try to blend iterated function systems with the time dependency and dynamics of Lindenmayer systems were discussed in Chapter 3.3.4. The fractal tops model, an interesting study of homeomorphism in fractals and V-variable fractals leading to super IFS, was presented in the monograph (Chapter 3.3.5). The n-dimensional IFS model was introduced in Chapter 3.2. The model is very flexible and opens paths to many extensions that can be added to the classic IFS model. The collage theorem (described in Chapter 4) laid foundations for an interactive fractal manipulation. Along with the supporting theorem, it gives the main user-centered tool for IFS-based image and object synthesis.
134
Iterated Function Systems for Real-Time Image Synthesis
The very first implementations of iterated function systems were slow and inefficient. There have been many improvements made over IFS rendering algorithms (the state-of-the-art in this field was presented in Chapter 5). Considering the recent improvements and purely deterministic character of some IFS rendering algorithms (the TSA, PRR, VRR and IBR), it is possible to render fractals in real time. A new way of assigning colours to IFS attractors was presented along with the respective colour stealing algorithm (Chapter 5.1.2). The overall performance of fractal rendering implementation depends on many factors; this issue was addressed in Chapter 5.13. The main problem in image synthesis is the intuitive user control over object construction. Since IFS models may employ the classic geometrical transformations, it is possible to create a user-friendly fractal design environment. Chapter 6 overviewed the implementation of the nD IFSs in various fields of real-time CG modeling. Binary flat image synthesis, true-colour volumetric datasets and fully scalable vector models were implemented. The developments described in this monograph broaden the application area of fractal modeling in interactive computer graphics systems. Both flat image and volumetric representations of the nD IFS were presented in the monograph. They were implemented in alpha versions of software applications which allowed rendering sample images depicted also in figure plates. Iterated function systems are so flexible that it is possible to develop far more complex modeling tools. The further development of nD IFS can be put in four mainstreams: the model, the implementation, the visualization and the animation/interactivity. The model. The n-dimensional model of iterated function systems extends the representation of the binary-image-oriented IFS. The more general case proposed in this monograph can handle the vector representation of fractal objects. Considering the recent developments in polar IFSs, self-congruent models and V-variable fractals, it is worth analysing further how to find a common area in these ideas. Polar IFSs open path to genetic programming methods to be applied in the construction of IFS images. The method can possibly be developed to handle the volumetric representation of fractal models and to help with the process of automated analysis and the reconstruction of three-dimensional shapes. It would be possible to approximate a given volume with a set of 3D IFS transformations (possibly applied to a chosen set of graphic primitives). Self-congruent models, while blended with iterated function systems, introduce the timeline and cycle development of fractal structures known from Lindenmayer systems. The idea of embedded dynamics and the time-controlled growth of fractal structures are much closer to natural phenomena than static models depicting only selected structures without the whole life-cycle context of ecology. SuperIFS, fractal tops and homeomorphism in fractals are very recent developments. They can play an interesting role in digital image manipulation [189]. The method is originally applied to flat raster data but may prove to be equally efficient in volumetric datasets. The colour-stealing algorithm introduces a technique similar to image-based rendering that can be extended with methods popular in the texture mapping, such as the MIPmapping, bi- and tri-linear filtering. Additionally, it opens a path for ‘stealing’ other
Conclusions, Directions for Further Development
135
features from real-life data such as specularity, transparency, translucency and so on, and maps it on intricate fractal structures. The implementation. The most natural development of the 6D IFS model is a 7D iterated function system. That model would be an extension of the 3D IFS + RGB with an additional transparency channel. That would permit alpha-blending of IFS attractors with other volumetric objects. If we consider vector representation based on CSG primitive elements, a number of extensions to this model is possible. We can embed in the IFS code the index to the list of CSG primitives to choose from. We can also describe other surface characteristics as in the classic Euclidean geometry 3D vector models. The address of the image texture, bump map characteristics, reflectance, translucency and Fresnel forms can be embedded in the IFS code as well. That would be particularly interesting for ray-traced images of volumetric IFS fractals. The sixdimensional model of a natural colour system, while embedded in the IFS, could provide a better selection of more life-like colours mapped at fractal structures. The visualization of IFS attractors covered by this monograph was a simple and straightforward implementation of the rendering algorithms described in Chapter 5. However, for volumetric IFS fractals we can add lights and shadows to give clues for a better perception of three-dimensional shapes. The shading of volumetric datasets can be quite simple when based on a simplified light attenuation model [202]. Fractals operate on real numbers; therefore, it is possible to use high-dynamic range techniques to better visualize subtle elements of such intricate structures. For ray-traced renderings, we need to know more about surface properties. We have to remember that the classic voxel-based implementations of CG do not have normals. Therefore, we need need to represent voxels with meta-balls or to find an iso-surface for a given set [226,227]. The construction process of the iso-surface could be very hard or even impossible for very often fragmented IFS fractals. The vector-based model provides us with a means for an accurate position and orientation of IFS attractor elements in a 3D space. Translucency may be another important parameter in highly realistic renderings of complex and “fragile” objects [70]. The translucency parameter can be relatively easily encoded in both the raster and vector 3D IFS models. The animation and interactive manipulation of IFS fractals. There have been many works on the animation and manipulation of flat IFS images [191–193,195,196]. Thanks to the collage theorem (Chapter 4), we can define flat shapes quite intuitively, as long as we can spot self-similarities in their structures. Theorem 3 (Chapter 4) helps with the creation of the linear and non-linear sequences of IFS animations. Any of IFS code components can be parametrized and related, for instance, to the timeline of animation. There are no reasons why those parameters would not work with continuous changes based on interactive user interface stimuli. Self-congruent models open an interesting extension to IFS modeling with time-oriented fractals. On the other hand, the polar IFS along with genetic programming and V-variable fractals permit automatic ‘breeding’ of different fractal ‘phenotypes’ and the selection of visually attractive ones, based on some pre-determined conditions [183,184,186]. It is possible to interfere with this process and to visualize the various stages of IFS shape development. The following is a concise summary of the contribution of this work to computer science. The monograph
Iterated Function Systems for Real-Time Image Synthesis
136
• • • • • • • • •
Proposes a generalized model, called the nD IFS, which creates possibilities for many interesting applications; Forwards a new paradigm for user-centered fractal modeling; Presents unique concepts of a vector-based IFS model and accompanying rendering algorithms; Introduces a recursive rendering scheme, which is very efficient and gives a purely deterministic output; Formulates and analyzes the problem of the efficiency of fractal image generation; Investigates possible applications of the IFS model to the visual simulation of many natural phenomena; Systematizes the problems of IFS-based image synthesis; Develops modeling schemes for terrain modeling, which facilitate contextdependent terrain engineering; Shows various models of IFS-based images and objects.
References 1. 2. 3. 4. 5. 6. 7. 8.
9. 10. 11. 12.
13. 14. 15.
16. 17. 18. 19. 20. 21. 22.
Kaandorp, J. A.: Fractal Modeling. Growth and Form in Biology. Springer-Verlag, Berlin (1994). Stevens, P. S.: Patterns in Nature. Little, Brown and Co., Boston (1974). Zimmerman, M. H. and Brown, C. L.: Trees – Structure and Function. Springer-Verlag, Berlin (1971). Mandelbrot, B. B.: The Fractal Geometry of Nature. Freeman Press, New York (1982). Mauldin, R. D. and Williams, S.C.: Haussdorff dimension in graph directed constructions. Trans. American Mathematical Society, 309(2) (1988) 811–829 Graf, S., Mauldin, R. D., and Williams, S. C.: The exact Hausdorff dimension in random recursive constructions. Mem. American Mathematical Society, 71(381) (1988). Edgar, G. A.: Integral, Probability and Fractal Measures. Springer-Verlag, New York (1998). Stefanlo, Ö.: Uniqueness of invariant measures for place-dependent random iterations of functions. Fractals in Multimedia, IMA Vol. Math. Appl., Springer-Verlag, New York (2002). Zähle, U.: Self-similar random measures. I. Notion, carrying Haussdorff dimension and hyperbolic distribution. Probab. Theory Related Fields, 80(1) (1988) 79–100. Lasota, A. and Yorke, J.: On the existence of invariant measures for piecewise monotonic transformations. Trans. American Mathematical Society, 186 (1973) 481–488. Hutchinson, J. E. and Ruschendorf, L.: Random fractal measures via the contraction method. Indiana Univ. Math. J., 47(2) (1998) 471–487. Geronimo, J. S. and Hardin, D. P.: An exact formula for the measure dimensions associated with a class of piecewise linear maps. Fractal Approximation, Constr. Approx., (3/5) (1989) 357–392. Bovill, C.: Fractal Geometry in Architecture and Design. Birkhauser, Boston (1996). Batty, M. and Longley, P.: The fractal city. Architectural Design, 67(9/10) (1997) 74–83. Vyzantiadou, M. A., Zioups, G. and Avdelas, A. V.: Fractal geometry and steel structures. Proc. 4’th Eurosteel Conference, Maastricht, Aaachen, Mainz, A (2005) 1, 8, 17–24. Aono, M. and Kunii, T. L.: Botanical tree image generation. IEEE Computer Graphics and Applications, 4(5) (1984) 10–34. Cohen, D.: Computer simulation of biological pattern generation processes. Nature, no. 216 (1967) 246–248. Hall’e, F., Oldeman R. A. and Tomlinson, P. B.: Tropical Trees and Forests: An Architectural Analysis. Springer-Verlag, Berlin (1978). Macdonald, N.: Trees and Networks in Biological Models. J. Wiley& Sons, New York (1983). Prusinkiewicz, P. and Krithivasan, K.: Algorithmic generation of South Indian folk art patterns. Proc. Intl. Conf. Comp. Graph., Singapore (1988). Barnsley, M. F. and Demko, S.: Iterated function systems and the global construction of fractals. Proc. Royal Soc., London, A399 (1985) 243–275. Hutchinson, J.: Fractals and self-similarity. Indiana Univ. J. Math. 30(5), (1981) 713–747.
138 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52.
References Fortner, B. and Meyer, T. E.: Number by Colours, A Guide to Using Colour to Understand Technical Data. Springer-Verlag, New York (1997). Hubel, D. H.: Eye, Brain and Vision. Scientific American Library, W. H. Freeman, New York (1988). Foley, J.D. et al.: Computer Graphics: Principles and Practice, 2nd ed., Addison-Wesley, Reading, MA (1990). Russ, J.C.: The Image Processing Handbook. CRC Press, Boca Raton, FL (1992). Heckbert, P.: Graphics Gems IV. Academic Press, London (1994). PNG; http://www.libpng.org/. Roelofs, G.: PNG – The Definite Guide. O’Reilley Media Inc., Sebastopol, CA (1999). Schwartz, M. W. et al.: An experimental comparison of RGB, YIQ,LAB, HSV opponent colour models. ACM Trans. Graphics, 6(2) (1987) 123–158. Wyszecki, G. and Stiles, W.S.: Colour Science. John Wiley & Sons, New York (1982). Scandinavian Colour Institute A.B.; http://www.ncscolour.com/. Hearn, D. and Baker, P.: Computer Graphics C – Version. Prentice Hall, Upper Saddle River, NJ (1997). Adobe Systems Inc.: PostScript Language Reference Manual, 2nd ed., Addison-Wesley, New York (1990). Ashri, R. et al.: Professional Java Mobile Programming. Wrox Press Ltd., Birmingham (2001). Java; http://www.java.sun.com/. Jungklaus, N.: 3D Laser scanning at Notre Dame Cathedral. Paris, Proc. EVA 2003 Conf., Berlin (2003) 137–142. Konica; http://konicaminolta.com/. Blundell, B. G. and Schwarz, A. J.: Volumetric Three-Dimensional Display Systems. John Wiley & Sons, New York (2000). Corel Inc.; http://www.corel.com/. Macromedia Inc.; http://www.macromedia.com/. Mortenson, M. E.: Geometric Modeling. John Wiley & Sons, New York (1985). Nikiel, S.: VR for stratigraphy of architectural artifacts. Proc. EVA 2005 Conf., Berlin (2005). Nikiel, S.: Bildung eines Virtuellen Wiederaufbaus mit dem Umgebungskontext. Proc. EVA 2004 Conf., Berlin (2004) 47–49. Nikiel, S: Blue-print based modeling of architectural artifacts. Proc. EVA 2003 Conf., Berlin (2003) 189–192. Nikiel, S.: Erstellung einer Internetbasierten Virtuellen Umgebung zur Darstellung das Palastes in Żagań. Proc. EVA 2002 Conf., Berlin (2002) 258–261. Nikiel, S.: V – office, a case study of the Internet-based 3D graphical user interface. Proc. PIONIER Conf., Poznań (2001) 203–206. Nikiel, S.: Virtual environments for distributed projects. Proc. SRE Conf., Zielona Góra (2000) 177–180. Nikiel, S.: VRML – a 3D environment for virtual classes. Proc. EUNIS Conf., Poznań (2000) 129–134. Nikiel, S.: Internet for scientific cooperation. Proc. ZielMAN Conf., Zielona Góra (1999) 45–47. Bishop, G. and Wiemer, D.: Fast phong shading. Proc. SIGGRAPH’86, Computer Graphics, 20(4) (1986) 103–106. Blinn, J. F.: Models of light reflection for computer synthesized pictures. CACM, 19(10) (1977) 542–547.
References 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78.
139
Campbell, G. T. and Fussel, D. S.: Adaptive mesh generation for global diffuse illumination. Proc. SIGGRAPH’90, Computer Graphics, 24(4) (1990) 155–164. Hall, R.: Illumination and Colour in Computer Generated Imagery. Springer-Verlag, New York (1989). Hart, J. C. and DeFanti, T. A.: Efficient antialiased rendering of 3-D linear fractals. Proc. SIGGRAPH’91, Computer Graphics, 25(4) (1991) 91–100. Hart, J. C., Sandin, D. J. and Kauffman, L. H.: Ray tracing deterministic 3D fractals. Proc. SIGGRAPH’89, Computer Graphics, 23(3) (1989) 289–296. Rushmeier, H. E. and Torrance, K. E.: Extending radiosity method to include specular reflecting and translucent materials. ACM Trans. Graphics, 9(1) (1990) 1–27. Nikiel, S. and Kupaj, M.: Photogrammetry in computer assisted modeling of architecture. PAR, no. 7.6 (2004) 112–115. de Reffye, P. et al.: Plant models faithful to botanical structure and development. Proc. SIGGRAPH’88, Computer Graphics, 22(4) (1988) 151–158. Fracchia, F. D., Prusinkiewicz, P. and de Boer, M.J.: Visualization of the development of multicellular structures, Proc. Graphics Interface (1990) 267–277. Meinhardt, H.: Models of Biological Pattern Formation. Academic Press, New York (1982). Oppenheimer, P.: Real-time design and manipulation of fractal plants and trees. Comp. Graph., 20(4) (1986) 55–64. Cochran, W. O., Hart, J. C. and Flynn, P. J.: On approximating rough curves with fractal functions. Proc. Graphics Interface’98 (1998) 65–72. Glassner, A. S.: An Introduction to Ray Tracing. Academic Press, San Diego, CA (1989). Lidley, C.A.: Practical Ray Tracing in C. John Wiley & Sons, New York (1992). Nakamae, E. and Tadamura, K.: Photorealism in computer gaphics – past and present. Computers & Graphics, 19(1) (1995) 119–130. Watt, A. and Watt, M.: Advanced Animation and Rendering Techniques. AddisonWesley, Workingham (1992). Kajia, J. T. and Kay, T. L.: Rendering fur with three-dimensional textures. Proc. SIGGRAPH’89, Computer Graphics, 23(3) (1989) 271–280. Perlin, K. and Hoffert, E. M.: Hypertexture. Proc. SIGGRAPH’89, Computer Graphics, 23(3) (1989) 253–262. Rushmeier, H. E. and Torrance, K. E.: Extending radiosity method to include specular reflecting and translucent materials. ACM Trans. Graph., 9(1) (1990) 1–27. Wyvill, G. B. and McPheeters, C.: Solid texturing of soft objects. IEEE Comp. Graph. and Appl., 7(12) (1987) 20–26. Barnsley, M. F.: Fractals Everywhere, 2nd ed., Academic Press, San Diego, CA (1993). Barnsley, M. F., Jacquin, A. et al.: Harnessing chaos for image synthesis. Proc. SIGGRAPH’88, Computer Graphics, 22(4) (1988) 131–140. Mandelbrot, B. B.: Fractals: Form, Chance and Dimension. Freeman Press, San Francisco, CA (1977). Feder, J.: Fractals. Plenum Press, New York (1988). Peitgen, H. O. and Saupe, D.: The Science of Fractal Images. Springer-Verlag, Berlin (1988). Edgar, G.: Measure, Topology and Fractal Geometry. Springer-Verlag, New York (1990). Falconer, K.: The Geometry of Fractal Sets. Cambridge University Press, Cambridge (1985).
140 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89.
90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104.
References Falconer, K.: Fractal Geometry, Mathematical Foundations and Applications. John Wiley & Sons, New York (1990). Nikiel, S.: Fractal dimension in image processing. Proc. Comp. Vision and Graph. Conf., Microcomputer School, Zakopane (1994) 269–276. Kifer, Y.: Fractals via Random Iterated Function Systems and Random Geometric Constructions. Fractal Geometry and Stochastics, Birkhauser, Basel (1995) 145–164. Peruggia, M.: Discrete Iterated Function Systems. A. K. Peters Ltd., Wellesley, MA (1993). Horn, A. N.: IFSs and the Interactive Design of Tiling Structures. Fractals and Chaos, Springer-Verlag, New York (1991) 119–144. Stefanlo, Ö.: Markov chains in random environments and random iterated function systems. Trans. American Mathematical Society, 353(9) (2001) 3547–3562. Fractals complex; http://www.hypercomplex.org/. Fractals intricate; http://www.xenodream.com/. Fractals 3D; http://www.3Dfractals.tk/. Kac, E.: Transgene Kunst, Life science. Ars Electronica’99, Springer-Verlag, Vienna (1999) 289–303. Mignonneau, L. and Sommerer, C.: Modeling emergence of complexity: The application of complex system and origin of life theory to interactive art on the Internet. Artificial life, Proc. 7th Intl. Conf. on Artificial Life, MIT Press, Cambridge, MA (2000) 547–554. Peitgen, H. O. and Richter, P. H.: The Beauty of Fractals. Springer-Verlag, Berlin (1986). Sims, K.: Artificial evolution for computer graphics. Comp. Graph., 25(4) (1991) 319–328. SPANKY Fractal Database; http://spanky.triumf.ca/. Sprott Webpages; http://sprott.physics.wisc.edu/. Wegner, T. and Peterson, M.: Fractal Creations. Waite Group Press, Mill Valley, CA (1991). Prusinkiewicz, P. and Lindenmayer, A.: The Algorithmic Beauty of Plants. SpringerVerlag, New York (1990). Prusinkiewicz, P., Lindenmayer, A. and Hanan, J.: Developmental models of herbaceous plants for computer imagery purposes. Comp. Graph., 22(4) (1988) 141–150. Chomsky, N.: Tree models for the description of language. IRE Trans. Infor. Theory, 2(3) (1956) 113–124. Rozenberg, G. and Salomaa, A.: The Mathematical Theory of L-Systems. Academic Press, New York (1980). Prusinkiewicz, P. and Hanan, J.: Lindenmayer systems, fractals and plants. Lecture Notes in Biomath., 79, Springer-Verlag, Berlin (1989). Abelson, A. and di Sessa, A. A.: Turtle Geometry, MIT Press, Cambridge, MA (1982). DeReffeye, P. et al.: Plant models faithful to botanical structure and development. Proc. SIGGRAPH’88, Computer Graphics, 22(4) (1988) 151–158. Fowler, D. R., Meinhardt, H. and Prusinkiewicz, P.: Modeling seashells. Proc. SIGGRAPH’92, Computer Graphics, 26(2) (1992) 379–387. Smith, A. R.: Plants, fractals and formal languages. Proc. SIGGRAPH’84, Computer Graphics, 18(3) (1984) 1–10. Stępień, C.: Comparison of the Self-Congruent Model of a Plant Growth with the IFS Models Used in Computer Graphics. Research Report II PW8/04, Institute of Computer Science, Warsaw University of Technology (2004).
References
141
105. Stępień, C.: Generating of Time-Dependent Sets with the IFS Method for Computer Animations. Research Report II PW5/04, Institute of Computer Science, Warsaw University of Technology (2004). 106. Atherton, P. R.: A scan-line hidden surface removal procedure for constructive solid geometry. Proc. SIGGRAPH’83, Computer Graphics, 17(3) (1983) 73–82. 107. Edelsbrunner, H.: Algorithms in Computational Geometry. Springer-Verlag, Berlin (1987). 108. Mantyla, M.: An Introduction to Solid Modeling. Computer Science Press, Rockville, MD (1988). 109. Fractal plants; http://www.alias.com/. 110. Fractal plants; http://www.bionatics.com/. 111. Fractal plants; http://www.greenworks.com/. 112. Massopust, P. R.: Fractal Functions, Fractal Surfaces and Wavelets. Academic Press Inc., San Diego, CA (1994). 113. Musgrave, F. K. et al.: The synthesis and rendering of eroded fractal terrains. Proc. SIGGRAPH’89, Computer Graphics, 23(3) (1989) 41–50. 114. Yokoya, N., Yamamoto, K. and Funakubo, N.: Fractal-based analysis and interpolation of 3D natural surface shapes and their application to terrain modeling. Comp. Vis., Graph. Image Proc., 46 (1989) 289–302. 115. Dixon, A. R., Kirby, G. H. and Wills, D. M. P.: Artificial planets with fractal feature specification. The Visual Computer, 15(3) (1999) 147–158. 116. Dixon, A. R.: The synthesis of fractal terrain and its applications and space simulation. Ph.D. thesis, Department of Computer Science, Univ. of Hull (1994). 117. Kai Power Tools; http://www.corel.com/. 118. Terragen; http://www.planetside.co.uk/. 119. VistaPro; http://www.aandromedasoftware.com/. 120. Nikiel, S. and Steć, P.: Automated generation of terrain in VR systems. Proc. Multimedia and Networks Inf. Syst. Conf., Wrocław (2000). 121. Jakubowski, S.: Real-time generation and rendering of terrain. M.Sc. thesis, Faculty of Electrical Engineering, Computer Science and Telecommunications, Univ. of Zielona Góra (in Polish) (2003). 122. Warszawski, K.: Generating terrain in OGL. M.Sc. thesis, Faculty of Electrical Engineering, Computer Science and Telecommunications, Univ. of Zielona Góra (in Polish) (2004). 123. Sprott, J. C. and Pickover, C. A.: Automatic generation of general quadratic map basins. Computers & Graphics, 19(2) (1995) 303–313. 124. Bedding, S. and Briggs, K.: Iteration of quaternion maps. Intl. J. Bifur. Chaos Appl. Sci. Eng., 5, (1995) 877–881. 125. Gomatam, J. et al.: Generalization of the Mandelbrot set: Quaternionic quadratic maps. Chaos, Solitons and Fractals, 5 (1995) 971–985. 126. Holbrook, J. A. R.: Quaternionic Fatou-Julia sets. Ann. Sci. Math., Quebec, 11 (1987) 79–94. 127. Kantor, I. L.: Hypercomplex Numbers. Springer-Verlag, New York (1989). 128. Norton, A.: Generation and display of geometric fractals in 3D. Computer Graphics, 16(1) (1982) 61–67. 129. Rochon, D.: A generalized Mandelbrot set for bicomplex numbers. Fractals, 8(4) (2000) 355–368. 130. Montani, C., Scateni, R. and Scopigno, R.: Discretized marching cubes. Proc. Visualization’94, IEEE Comp. Soc. Press (1994) 281–287.
142
References
131. Nikiel, S. and Goinski, A.: A recursive subdivision scheme for isosurface construction. Computers & Graphics, 29(1) (2005) 155–164. 132. Ehrig, H. et al.: Graph Grammars and Their Applications to Computer Science. Lecture Notes in Computer Science, Springer–Verlag, Berlin (1987). 133. Glassner, A. S.: Geometric substitution: A tutorial. IEEE Comp. Graph. and Appl., 12(1) (1992) 22–36. 134. Jacob, C.: Genetic L-system programming: Breeding and evolving artificial flowers with Mathematica. Proc. First Intl. Methematica Symp., Southampton (1995) 215–222. 135. Barzel, R.: Physically based Modeling for Computer Graphics. Academic Press, San Diego, CA (1992). 136. Reeves, W. T.: Particle systems: A technique for modeling a class of fuzzy objects. ACM Trans. Graph., 2(2) (1983) 91–108. 137. Reeves, W. T.: Approximate and probabilistic algorithms for shading and rendering structured particle systems. Proc. SIGGRAPH’85, Computer Graphics, 19(3) (1985) 313–321. 138. Stam, J. and Fiume, E.: Turbulent wind fields for gaseous phenomena. Proc. SIGGRAPH’93, Computer Graphics (1993) 369–376. 139. Reeves, W. T. and Blau, R.: Approximate and probabilistic algorithms for shading and rendering structured particle systems. Proc. SIGGRAPH’85, Computer Graphics, 19(3) (1985) 313–322. 140. Blumfeld, R. and Aharony, A.: Breakdown of multifractal behaviour in diffusion limited aggregates. Phys. Rev. Letters, 2977 (1989) 62–65. 141. Dekking, F. M.: Recurrent sets. Adv. Math., 44 (1982) 78–104. 142. Guyon, E. and Stanley, H. E.:. Fractal Forms. North Holland, Elsevier (1991). 143. Matsushita, M.: Experimental observation of aggregations, the fractal approach to heterogenous chemistry surfaces. Colloids Polymers, John Wiley & Sons, Chichester (1989). 144. Musiał, B.: Generating 3D DLA structures. M.Sc. thesis, Faculty of Electrical Engineering, Computer Science and Telecommunications, Univ. of Zielona Góra (in Polish) (2000). 145. Voss, R. F. and Tomkiewicz, M.: Computer simulation of dendritic electrodeposition. J. Electrochem. Soc., 132(2) (1985) 371–375. 146. Wolfram, S.: Theory and Application of Cellular Automata. World Scientific Publ., Singapore (1996). 147. Toffoli, T. and Margolus, N.: Cellular Automata Machines, A New Environment for Modeling. MIT Press, Cambridge, MA (1987). 148. Albert, J. and Culik, I. K.: A simple universal cellular automaton and its one-way totalistic version. Complex Systems, No. 1 (1987) 1–16. 149. Allouche, J. P. et al.: Linear cellular automata, finite automata and Pascal’s triangle. Discrete Appl. Math., No. 66 (1996) 1–22. 150. Stanffer, D.: Introduction to Percolation Theory. Taylor & Francis, London (1985). 151. Burks, E.: Essays on Cellular Automata, University of Illinois Press, Champaign, IL (1972). 152. Codd, E. F.: Cellular Automata, Academic Press, New York (1968). 153. Preston, K. Jr. and Duff, M. J. B.: Modern Cellular Automata. Plenum Press, New York (1984). 154. Willson, S.: Cellular automata can generate fractals. Discrete Appl. Math., 8 (1984) 91–99.
References
143
155. Aso, H. and Honda, N.: Dynamical characteristics of linear cellular automata. J. Comp. and Syst. Sci., No. 30 (1985) 281–317. 156. Bartlett, R. and Garzon, M.: Monomial cellular automata. Complex Systems, No. 7 (1993) 367–388. 157. Bartlett, R. and Garzon, M.: Bilinear cellular automata. Complex Systems, No. 9 (1995) 455–476. 158. Choffurt, C. and Culik, I. K.: On real-time cellular automata and trellis automata, Acta Informatica, No. 21 (1984) 393–407. 159. Garzon, M.: Models of Massive Parallelism, Springer-Verlag, New York (1995). 160. Terrier, V.: Language recognizable in real-time by cellular automata. Complex Systems, No. 8 (1994) 325–336. 161. von Neumann, J.: Theory of Self-Reproducing Automata. University of Illinois Press, Chicago, IL (1966). 162. Yang, T.: Cellular Image Processing. Nova Science Publishing, New York (2001). 163. Abraham, R. H. and Shaw, C. D.: Dynamics, the Geometry of Behavior. AddisonWesley, Santa Cruz, CA (1992). 164. Devaney, R. L.: An Introduction to Chaotic Dynamical Systems. Addison-Wesley, Redwood City, CA (1989). 165. Devaney, R. L.: Chaos, Fractals and Dynamics. Addison-Wesley, Menlo Park, CA (1990). 166. Katok, A. and Hasselblatt, B.: Introduction to the modern theory of dynamical systems. Encyclopedia of Mathematics and Its Applications, Cambridge University Press, Cambridge (1995). 167. Prusinkiewicz, P. and Sandness, G.: Koch curves as attractors and repellers. IEEE Comp. Graph. and Appl., 8(6) (1988) 26–40. 168. Lorentz, E. N.: Deterministic non-periodic flow. J. Atmos. Sci., 20 (1963) 130–161. 169. Lorentz, E. N.: The local structure of a chaotic attractor in four dimensions. Physica, 13D (1984) 90–104. 170. Anson, L. F.: Fractal image compression. Byte (1993) 195–202. 171. Barnsley, M. F.: Fractal Image Compression. Academic Press, Wellesley, MA (1993). 172. Groeller, E. and Wegenkiltl, H.: Interactive design of non-linear functions for iterated function systems. Proc. 4th Intl. Conf. Comp. Graph. and Visual. WSCG’96, Plzen (1996) 93–102. 173. Edalat, A.: Finite algorithms for decoding recurrent iterated function systems. Imperial College Technical Report DoC 95/1 (1995). 174. Reuter, L. H.: Rendering and magnification of fractals using iterated function systems. Ph.D. thesis, Georgia Institute of Technology (1987). 175. Barnsley, M. F., Elton, J. H. and Hardin, D. P.: Recurrent iterated function systems. Constructive Approximation, 5 (1989) 3–31. 176. Hart, J. C., Cocharan, W. O. and Flynn, P. J.: Similarity hashing: A model-based vision solution to the inverse problem of recurrent iterated function systems. Fractals, 3 (1997) 320–331. 177. Baharav, Z., Malah, D. and Karmin, E.: Hierarchical interpretation of fractal image coding and its applications. Proc. IEEE Intl. Conf. Digital Signal Processing, Nicosia (1993) 190–195. 178. Fisher, Y.: Fractal Image Compression: Theory and Application. Springer-Verlag, New York (1995). 179. Saupe, D.: Fractal Image Compression via Nearest Neighbour Search. NATO Advance Study, Institute of Fractal Image Encoding and Analysis (1995).
144
References
180. Nikiel, S. and Stachera, J.: Large texture storage using fractal image compression. Proc. ICCVG Conf., Warsaw (2004). 181. Stachera, J. and Nikiel, S.: Fractal image compression for efficient texture mapping. Proc. Intl. Conf. Comp. Graph. Visual., WSCG’2004, Plzen (2004) 169–172. 182. Dekking, F. M.: Fractal image coding: Some mathematical remarks on its limits and its properties. Fractal Image Encoding and Analysis, NATO ASI Series F: Computer and System Sciences, 159, Springer-Verlag (1998) 117–133. 183. Raynal, F. et al.: Manipulation of non-linear IFS attractors using genetic programming. Proc. Congress on Evolutionary Computation CEC’99, Washington, DC (1999). 184. Collet, P., Lutton, E. et al.: Polar IFS and Individual Genetic Programming. Technical Report, INRIA Research Reports (1999). 185. Miller, B. S. and Shaw, M. J.: Genetic Algorithms with Dynamic Niche Sharing for Multimodal Function Optimization. Technical Report 95010, IlliGAL Report, December (1995). 186. Nettleton, D. J. and Garigliano R.: Evolutionary algorithms and a fractal inverse problem. Biosystems, 33 (1994) 221–231. 187. Barnsley, M. F.: Theory and Applications of Fractal Tops. Fractals in Engineering: New Trends in Theory and Applications, Springer-Verlag, London (2005) 3–20. 188. Barnsley, M. F. and Hutchinson J.: New methods in fractal imaging. Proc. CGIV’06, Sydney (2006). 189. Barnsley, M. F. and Xie, R.: Colour-stealing animations; http://www.superfracatals.com/. 190. Barnsley, M. F.: Superfractals. Cambridge University Press, Cambridge, New York (2006). 191. Barnsley, M. F. et al.: Solution of an inverse problem for fractals and other sets. Proc. Natl. Acad. Sci., 83 (1986) 1975–1977. 192. Mantica, G. and Sloan, A.: Chaotic optimization and the construction of fractals: Solution of an inverse problem. Complex Systems, 3 (1989) 37–62. 193. Wadstroemer, N.: An automatization of Barnsley’s algorithm for the inverse problem of iterated function systems. IEEE Trans. Image Proc., 12(11) (2003) 1388–1397. 194. Horn, A. N.: IFS and interactive image synthesis. Computer Graphics Forum, 9(2) (1990) 127–137. 195. Nikiel, S.: A graphic design environment based on modified IFS. Proc. 10th Symp.on Comp. and Inf. Sci., Kusadasi (1995) 597–604. 196. Nikiel, S.: An efficient fractal modeller (modification of the IFS). Proc. 4th Intl. Conf. on Comp. Graph.Visual., WSCG’96, Plzen (1996) 294–300. 197. Nikiel, S.: True-colour images and iterated function systems. Computers & Graphics, 22(5) (1998) 635–640. 198. VanWijk, J. J. and Saupe D.: Image-based rendering of iterated function systems. Computers & Graphics, 28(6) (2004) 937–943. 199. Dubuc, S.: Approximations of fractal sets. J. Computational and Applied Math., 29 (1990) 78–89. 200. Monro, D. M., Dudbridge, F. and Wilson A.: Deterministic rendering of self-affine fractals. IEE Colloqium on Fractal Techniques in Image Processing, 1990/171 (1990) 5/1–5/4. 201. Monro, D. M. and Dudbridge, F.: Rendering algorithms for deterministic fractals. IEEE Comp. Graph. and Applic., 272(17) (1995) 32–41. 202. Chen, Y. Q. and Bi, G.: 3D IFS fractals as real-time graphics model. Computers & Graphics, 21(3) (1997) 367–370.
References
145
203. Nikiel, S. and Stec, P.: The recursive rendering algorithm for iterated function systems (in Polish). Proc. Conf. Methods and Systems in Science and Eng., Kracow (1999) 75–80. 204. Bell, S. B.: Fractals: A fast, accurate and illuminating algorithm. Image and Vision Computing, 13(4) (1995) 253–277. 205. Bell, S. B. and Holroyd, F.C.: Tesseral amalgamators and hierarchical tilings. Image and Vision Computing, 9(5) (1991) 313–328. 206. Peigen, H. O., Juergens, H. and Saupe, D.: Fractals for the Classroom. Part 1, Introduction to Fractals and Chaos, Springer-Verlag, New York (1992). 207. Hnitecki, R.: Comparison of volumetric IFS renderers. M.Sc. thesis, Faculty of Electrical Engineering, Computer Science and Telecommunications, Univ. of Zielona Góra (in Polish) (2004). 208. Hepting, D. and Hart, J.C.: The escape buffer: Efficient computation of escape time for linear fractals. Proc. Graphics Interface’91 (1991) 204–214 209. Nikiel, S: Integration of iterated function systems and vector graphics for aesthetics. Computers & Graphics, 30 (2006) 277–283. 210. Żmudzin, S.: Constructive solid geometry and iterated function systems. M.Sc. thesis, Faculty of Electrical Engineering, Computer Science and Telecommunications, Univ. of Zielona Góra (in Polish) (2001). 211. Ozkasap, O. and Kantarci, A.: Models for parallel and distributed implementation of fractals. Proc. 10th Symp. Comp. and Inf. Sci., Kusadasi (1995) 699–706. 212. Barnsley, M. F.: Fractal functions and interpolation. Constructive Approximation, 2 (1986) 303–329. 213. Burch, B. and Hart, J. C.: Linear fractal shape interpolation. Proc. Graphics Interface’97 (1997) 155–162. 214. Cochran, W. O., Hart, J. C. and Flynn, P. J.: On approximating rough curves with fractal functions. Proc. Graphics Interface’98 (1998) 65–72. 215. Hart, J. C.: The object instancing paradigm for linear fractal modeling. Proc. Graphics Interface’92 (1992) 224–231. 216. Nikiel, S. and Pawłowski, K: Quality of sound in streamed media. Proc. of PIONIER Conf., Poznań (2002) 259–271. 217. Nikiel, S. and Pawłowski, K: Real-time beat detection in MPEG layer-3. Proc. VIIIth IEEE Conf. MMAR02, Szczecin (2002) 573–578. 218. Navascues, M. A.: Fractal polynomial interpolation. Z. Anal. Anwendungen, 24(2) (2005) 401–418. 219. Landini, G.: Fractal anamorphosis: Look up table transform using self-affine series. Computers & Graphics, 21 (1997) 105–111. 220. Nikiel, S. and Kirby, G. H.: Fractal palettes for medical imaging. Machine Graphics & Vision, 7 (1998) 743–750. 221. Clausse, J., Kirby, G. H. and Nikiel, S.: Fractal palettes for texturing. Computers & Graphics, 25 (2001) 875–881. 222. Terlecki, A.: Generating 2.5D terrains based on IFS. M.Sc. Thesis, Faculty of Electrical Engineering, Computer Science and Telecommunications, Univ. of Zielona Góra (in Polish) (2004). 223. Nikiel, S. and Kirby, G. H.: Iterated function systems for terrain synthesis. Machine Graphics & Vision, 9(1-2) (2000) 47–55. 224. Nikiel, S. and Stec, P.: A circular interpolation of fractal craters. Proc. Multidimensional (nD) Systems, NDS-2000, Zielona Góra University Press (2000) 269–274.
146
References
225. Kulczycki, T.: Generating complex 3D objects with IFS. M.Sc. thesis, Faculty of Electrical Engineering, Computer Science and Telecommunications, Univ. of Zielona Góra (in Polish) (2002). 226. Barsky, B.: A description and evaluation of various 3D models. IEEE Comp. Graph. and Appl., 4 (1) (1984) 38–52. 227. Nikiel, S. and Goinski, A.: Generation of volumetric escape time fractals. Computers & Graphics, 27 (2003) 977–982.
Appendix A: Acknowledgments The author would like to thank Dr. Graham Kirby for his advice received during the work on IFS terrain modelling. Part of the research presented in this monograph was carried out during the author’s Royal Society NATO Postdoctoral Fellowship at the University of Hull, UK.
Appendix B: Abbreviations 2D two-dimensional 3D three-dimensional CA cellular automata CAD computer-aided design CG computer graphics CIE Commission Internationale de l’Eclairage CMA constant mass algorithm CMYK cyan magenta yellow black CSG constructive solid geometry DIA deterministic iteration algorithm DLA diffusion limited aggregation ETA escape-time algorithm fBm fractional Brownian motion GP genetic programming GUI graphical users’ interface HSI hue saturation intensity HxV Horizontal x Vertical IBR image-based rendering IFS iterated function systems L-Sys. Lindenmayer systems LUT look up tables MDM mid-point displacement method MPA minimal plotting algorithm NCS natural colour system NoI number of iterations OGL Open Graphic Language PEPP point expected per pixel PIFS partitioned IFS PL-Sys Prusinkiewicz-Lindenmayer systems PRR point recursive rendering RGB red green blue RIA random iteration algorithm RIFS recurrent IFS RYB red yellow blue TSA tesseral synecdoche algorithm VRR vector recursive rendering YIQ intensity and two chromacity channels used in broadcast TV YUV intensity and two chromacity channels used in image compression/decompression schemes
Appendix C: Index Algorithm, 3, 4, 17, 22, 40, 42–43, 51, 53, 58, 61, 63, 65, 67–129 ALPHA, 8, 9, 22, 119, 121, 122, 127–129, 133 Artistic, 22 Artists, 7 Buffer, 68–71, 73, 77, 83, 93 CAD, 1, 4, 112, 119, 123 Cluster, 27, 28, 47 Collage, 31, 37, 47, 55–58, 99, 118, 125,128, 129, 131 Colour, 4–9, 12, 19, 22, 25, 37, 42, 50, 51, 57, 58, 65–67, 71, 74, 84, 92, 93, 96, 99, 105, 106, 116, 117, 121–135 CSG, 16, 25, 77, 79, 81 Design, 3, 7–9, 12, 16, 22, 25, 96, 102, 111, 117, 121, 123, 131 Escape-time, 20, 21, 61, 67, 74–76, 93, 96 GP, 22, 46 Graphics, 1–6, 8, 11, 12, 27, 30, 37, 82, 96, 102, 125 HSI, 5, 7, 57, 126–131 Image binary, 4, 57, 92, 96 coding, 41, 45 compression, 3, 7, 11, 42–45, 89, 99 decoding, 43–45 digital, 5–8, 51, 65, 69, 91, 105 processing, 29 raster, 1, 3, 7, 8, 9, 11, 99, 102 resolution, 12, 64, 69, 74, 80, 83, 84, 91, 94, 99, 101
synthesis, 2–6, 11–29, 59, 99, 131, 133, 134 texture, 9, 25, 42, 44, 45, 95, 135 true-colour, 117, 125 Interactivity, 58, 134 Iterations, 28, 49, 53, 62–77, 83, 84, 92–96, 101, 113, 116, 122, 125 Interpolation, 102–111 Isosurface, 22 Light, 7, 9, 135 Matrix 2D, 38, 99 3D, 115 4D, 121 5D, 124, 126 6D, 127 7D, 130 OGL, 8, 84, 119 Pixel, 7, 8, 12, 19, 23, 63–68, 71–74, 78–95, 101–112, 116, 125 Print, 8, 99 Random, 11, 12, 17, 22, 23, 30, 51, 53, 59, 61–66, 69–71, 91–93, 97, 99, 105–106, 116, 133 Real-time, 1–4, 8, 9, 16, 64, 83, 91, 95–97, 101, 128, 131 Reflection, 9, 55 RGB, 5–8, 37, 42, 57, 84, 96–99, 117, 124–131 Solids, 21, 129 Spectra, 5, 7 String, 15, 61, 76–79 Terrain, 4, 12, 17, 108–112 User, 3, 4, 22, 100
152
Appendix C: Index
Vector, 3, 4, 8, 9, 31, 37–40, 48, 49, 61, 77, 79, 81, 82, 89–91, 99 Visualization, 1, 2, 8, 9, 35, 51, 66, 105 Volumetric, 1, 4, 8, 11, 21, 22, 24, 26, 61, 64, 68, 71, 75, 81, 92, 96, 97, 99, 115–131, 134