1 Computer Graphics
Total Page:16
File Type:pdf, Size:1020Kb
1 COMPUTER GRAPHICS 1.1 WHAT IS COMPUTER GRAPHICS? The usual definition of computer graphics is the following: asetof models, methods, and techniques to transform data into images that are displayed in a graphics device. The attempt to define an area is a difficult, if not an impossible, task. Instead of trying to devise a good definition, perhaps the best way to understand an area is through a deep knowl- edge of its problems and the methods to solve them. From this point of view, the definition above has the virtue of emphasizing a fundamental problem of computer graphics: the transformation of data into images (Figure 1.1). In applied mathematics, the solution to problems is directly related to the mathematical models used to understand and pose the problem. For this reason, the dividing line between solved and open problems is more subtle than in the case of pure mathematics. In fact, in pure mathematics, different solutions to the same problem, in general, do not constitute great innovations from the scientific point of view; on the other hand, in applied mathematics, different solutions to the same 1 2 COMPUTER GRAPHICS CHAPTER 1 Computer graphics Data Image Figure 1.1: Computer graphics: transforming data into images. problem as a consequence of the use of different models usually bring a significant advance in terms of applications. This book discusses the solution to various problems in computer graphics using optimization techniques. The underlying idea is to serve as a two-way channel: stimulate the computer graphics community to study optimization methods and call attention of the optimization community to the extremely interesting real-world problems in com- puter graphics. 1.1.1 RELATED AREAS Since its origin, computer graphics is concerned with the study of models, methods, and techniques that allow the visualization of infor- mation using a computer. Because, in practice, there is no limita- tion to the origin or nature of the data, computer graphics is used today by researchers and users from many different areas of human activity. The basic elements that constitute the fundamental problem of com- puter graphics are data and images. There are four related areas that deal with these elements, as illustrated in Figure 1.2. Geometric modeling deals with the problem of describing, structuring, and transforming geometric data in the computer. SECTION 1.1 WHAT IS COMPUTER GRAPHICS? 3 Geometric modeling Data Computer Visualization vision Image Image processing Figure 1.2: Computer graphics: related areas. Visualization interprets the data created by geometric modeling to generate an image that can be viewed using a graphical output device. Image processing deals with the problem of describing, structuring, and transforming images in the computer. Computer vision extracts from an input image various types of infor- mation (geometric, topological, physical, etc.) about the objects depic- ted in the image. In the literature, computer graphics is identified with the area called visualization (Figure 1.2). We believe it is more convenient to consider computer graphics as the mother area that encompasses these four subareas: geometric modeling, visualization, image processing, and 4 COMPUTER GRAPHICS CHAPTER 1 computer vision. This is justified because these related areas work with the same objects (data and images), which forces a strong trend of integration. Moreover, the solutions to certain problems require the use of methods from all these areas under a unified framework. As an example, we can mention the case of a Geographical Informa- tion System (GIS) application, where a satellite image is used to obtain the elevation data of a terrain model and a three-dimensional (3D) reconstruction is visualized with texture mapping from different view points. Combined techniques from these four related subareas comprise a great potential to be exploited to obtain new results and applications of computer graphics. This brings to computer graphics a large spectrum of models and techniques providing a path for new achievements: the combined result is more than the sum of parts. The trend is so vigorous that new research areas have been created. This was the case of image-based modeling and rendering,arecentarea that combines techniques from computer graphics, geometric model- ing, image processing, and vision. Furthermore, in some application domains such as GIS and medical image, it is natural to use techniques from these related areas to the point that there is no separation between them. We intend to show in this book how mathematical optimization meth- ods can be used in this unified framework in order to pose and solve a reasonable number of important problems. 1.1.2 IS THERE SOMETHING MISSING? The diagram given in Figure 1.2 is classical. But it tells us only part of the computer graphics script: the area of geometric modeling and the related areas. In our holistic view of computer graphics, several other areas are missing on the diagram. Where is animation? Where is digital video? SECTION 1.1 WHAT IS COMPUTER GRAPHICS? 5 Motion specification Scene Motion Motion analysis visualization Image sequence Motion processing Figure 1.3: Animation and related areas. In fact, it is possible to reproduce a similar diagram for animation, and this is shown in Figure 1.3. Note the similarity to the previous diagram. Motion modeling is the area that consists in describing the movement of the objects on the scene. This involves time, dynamic scene objects, trajectories, and so on. This is also called motion specification. Similarly, we can characterize motion analysis, motion synthesis, and motion processing. We could now extend this framework to digital video, but this is not the best approach. In fact, this repetition process is an indication that some concept is missing, a concept that could put together all of these distinct frameworks into a single one. This is the concept of graphical object. 6 COMPUTER GRAPHICS CHAPTER 1 In fact, once we have devised the proper definition of a graphical object, we could associate with it the four distinct and related areas: mod- eling, visualization, analysis, and processing of graphical object. The concept of graphical object should encompass, in particular, the geo- metric models of any kind, animation, and digital video. We introduce this concept and develop some related properties and results in the next two sections. 1.2 MATHEMATICAL MODELING AND ABSTRACTION PARADIGMS Applied mathematics deals with the application of mathematical meth- ods and techniques to problems of the real world. When computer simulations are used in the solution to problems, the area is called com- putational mathematics. In order to use mathematics in the solution to real-world problems, it is necessary to devise good mathematical models that can be used to understand and pose the problem cor- rectly. These models consist in abstractions that associate real objects from the physical world with mathematical abstract concepts. Follow- ing the strategy of dividing to conquer, we should create a hierarchy of abstractions, and for each level of the hierarchy, we should use the most adequate mathematical models. This hierarchy is called an abstraction paradigm. In computational mathematics, a very useful abstraction paradigm consists of devising four abstraction levels, called universes: the phys- ical universe, the mathematical universe, the representation universe, and the implementation universe (Figure 1.4). The physical universe contains the objects from the real (physical) world, which we intend to study; the mathematical universe contains the abstract mathematical description of the objects from the physi- cal world; the representation universe contains discrete descriptions of the objects from the mathematical universe; and the implementation SECTION 1.2 MATHEMATICAL MODELING AND ABSTRACTION PARADIGMS 7 Physical Mathematical Representation Implementation universe universe universe universe Figure 1.4: The four-universe paradigm. universe contains data structures and machine models of computation so that objects from the representation universe can be associated with algorithms in order to obtain an implementation in the computer. Note that by using this paradigm, we associate with each object from the real (physical) world three mathematical models: a continuous model in the mathematical universe, a discrete model in the representa- tion universe, and a finite model in the implementation universe. This abstraction paradigm is called the four-universe paradigm (Gomes and Velho, 1995). In this book, we take the computational mathematics approach to com- puter graphics. That is, a problem in computer graphics will be solved considering the four-universe paradigm. This amounts to saying that computer graphics is indeed an area of computational mathematics. As a consequence, the four-universe paradigm will be used throughout the book. Example 1 [length representation]. Consider the problem of measuring the length of objects from the real world. To each object, we should associate a number that represents its length. In order to attain this, we must introduce a standard unit of measure, which will be com- pared with the object to be measured in order to obtain its length. From the point of view of the four-universe paradigm, the mathemat- ical universe is the set R of real numbers. In fact, to each measure, we associate a real number; rational numbers correspond to objects that are commensurable with the adopted unit of measure, and 8 COMPUTER GRAPHICS CHAPTER 1 irrational numbers are used to represent the length of objects that are incommensurable. In order to represent the different length values (real numbers), we must look for a discretization of the set of real numbers. A widely used technique is the floating-point representation. Note that in this repre- sentation, the set of real numbers is discretized in a finite set of rational numbers. In particular, this implies that the concept of commensura- bility is lost when we pass from the mathematical to the representation universe.