Applying MATLAB to Computer Graphics and CAGD

Total Page:16

File Type:pdf, Size:1020Kb

Applying MATLAB to Computer Graphics and CAGD Applying MATLAB to Computer Graphics and CAGD. Application to a Visualization Problem in the Automotive Industry. Akemi Gálvez1, Andrés Iglesias1,*, Flabio Gutiérrez2 1Department of Applied Mathematics and Computational Sciences, University of Cantabria Santander, Spain 2Department of Mathematics, National University of Piura, Piura, Peru * Corresponding author. used in this paper are also discussed in this section. Then, Abstract Section 3 introduces some additional commands we need to implement in order to solve some interesting problems Computer graphics are usually achieved by using some related to CAGD and computer graphics. This section also traditional programming languages (Fortran, Pascal, C, includes a wide description of the main MATLAB etc.). In this paper an extensive use of the general-purpose graphical commands, options and utilities that will be numerical computation programs (NCPs) in the computer useful for rendering surfaces. As an application, Section 4 graphics field is proposed instead of. The paper describes shows how they can be successfully applied to solve a the main advantages of this kind of programs, and several given visualization problem coming from the automotive examples of how they can be successfully applied to industry. Today, many industries are concerned about the computer graphics and visualization. Moreover, the paper possibility to transfer their information by Internet, briefly introduces several functions and commands avoiding other possible and slower transference ways. developed by the authors, which will be successfully Section 5 discusses such a possibility for the visual applied to solve a visualization problem coming from the information, through the MATLAB-VRML connection. automotive industry. Finally, the paper closes with the main conclusions and Keywords: Computer Graphics, MATLAB, CAGD. remarks of this work. 1. INTRODUCTION 2. ADVANTAGES OF THE NCP Computer graphics play a fundamental role in engineering In this section we show the main advantages of the NCPs, design, capturing the visual and quantitative aspects of the which justify our proposal to apply them to the computer geometric objects. For example, in the automotive industry, graphics field. Then, we proceed to choose the program to one is interested not only to obtain the curves and surfaces be used along the paper. holding some prescribed constrains but also to join all these geometric entities together and to visualize the resulting 2.1 Why to use NCPs for Computer picture in order to take care the aesthetic features and the Graphics? general look of the product. There are many reasons to explain why we propose the Many of the most important programs for computer NCPs to be used in the computer graphics field. Some of graphics have been written in traditional programming them are listed below: languages (Fortran, Pascal, C, etc.) However, in the last • The NCPs are easier to use, because: recent years, the general-purpose numerical computation − they incorporate many mathematical and programming programs (NCPs) are gaining more and more popularity. commands and libraries Today, they are well established as a powerful alternative to the traditional programming languages in many different − their algorithms are very optimized areas, as mechanical engineering, signal processing, quality − they have a powerful and user-friendly interface control, electronic circuits, etc. • The NCPs are very powerful, because: In this context, it would seem natural to wonder if the − their programming languages incorporate not only the NCPs could be applied, instead of the traditional procedural but also the functional programming programming languages, in the computer graphics field. including, in several cases, pattern recognition and The present paper tries to answer this question by object-oriented programming. following the next sequence: Section 2 describes the main advantages of this kind of programs. In addition, the main − they have a very remarkable graphical capabilities. reasons to justify our choice of MATLAB as the NCP to be International Conference Graphicon 1999, Moscow, Russia, http://www.graphicon.ru/ Based on these considerations, our research group enough to allow the programmer to improve the algorithms undertook the ambitious task to apply the NCPs to and codes in an efficient, quick and easy way. computer graphics. The following paragraphs are devoted MATLAB incorporates some useful commands for CAGD. to show how this work has been performed, indicating the For instance, its kernel includes a basic command for main advantages of our approach. interpolation through cubic splines and some other 2.2 Choosing the NCP: MATLAB commands for interpolation in one and several variables. However, the system lacks of many of the most important Evidently, not all the NCPs offer the same advantages and mathematical entities for CAGD, such as Bézier and B- features. Therefore, the first thing to be done in this line is spline curves and surfaces, which must be implemented. to choose the program to work with. After a careful The powerful MATLAB functional programming offers us analysis, our final choice was MATLAB (see the the possibility to implement these functions in a short, MathWorks Home Page at: http://www.mathworks.com). In elegant and simple code. As an illustration, the following this choice we took into account some features as: script calculates and displays the Bézier curve of a given • Spreading. MATLAB is used for hundreds of thousands set of two- or three-dimensional points: of industrial, government and academic users around the world. Its last versions are available for Microsoft function Bezier(ptos) % main function Windows 9x and NT, Macintosh and Linux personal [n,d]=size(ptos); Computers, as well as UNIX workstations from Sun, n=n-1; bt=ptos'*mij(n)*ti(n); Hewlett-Packard, IBM, Silicon Graphics and Digital, if d==2 and Open VMS computers. plot(bt(1,:),bt(2,:),ptos(:,1),ptos(:,2),'r-.p') • Graphical capabilities, which raise many of the current else plot3(bt(1,:),bt(2,:),bt(3,:), ... graphics-oriented programs (see Section 3.2). ptos(:,1),ptos(:,2),ptos(:,3),'r-.p') • Since MATLAB is based on C, it runs faster than other end rotate3d analyzed symbolic and numerical programs. Moreover, its basic element is an array that does not require function T=ti(n) % generating the t^i dimensioning, so it takes less time to be computed. m=1; It must be noticed that, in spite of our choice, the same t=0:0.05:m; % step=0.05 results can be obtained by using some other NCPs. For T=[]; for i=0:n example, SCILAB (see [1] for details) is a free software T= [T;t.^i]; whose programming and graphical capabilities are very end similar (although slightly lower for our purposes) to those of MATLAB. However, we think this last one is more function M = mij(n) popular and used in academic and industrial environments. for i=0:n for j=0:n M(i+1,j+1)=(-1)^(ji)*binom(n,j)*binom(j,i); 3. APPLYING MATLAB TO CAGD AND end COMPUTER GRAPHICS end M=M(1:n+1,1:n+1); The aim of this section is twofold: on the one hand, Section function c=binom(n,i) % defining the binom function 3.1 introduces some additional commands we need to solve if i==n | i==0 a visualization problem described in Section 4 and other c=1; interesting problems related to CAGD and computer elseif i<n & i>=0 graphics. On the other hand, Section 3.2 describes the main c=factorial(n)/(factorial(i)*factorial(n-i)); MATLAB commands, options and utilities that will be else useful for rendering surfaces. c=0; end 3.1 Building numerical libraries for CAGD function f=factorial(n) %defining the factorial function Once the program is chosen, the following task to be done if n==1 is the implementation of an extensive set of numerical f=1; libraries for CAGD. By "extensive" we mean the libraries else must contain all the relevant geometric entities in the sense f=n*factorial(n-1); end that if a given geometric entity is useful in CAGD, it must be incorporated to the system. Of course, libraries must be continuously updated, so the system must be flexible Table 1: MATLAB code for the Bézier curves. International Conference Graphicon 1999, Moscow, Russia, http://www.graphicon.ru/ We remark that this example has been chosen primarily for • Two- and three-dimensional transformations. Since simplicity, rather than to correspond to a valuable code or a all these transformations are not available directly in very complicated algorithm. However, some questions MATLAB, they were implemented in the toolbox. deserve to be pointed out: as the reader may appreciate, we use the matrix form for the Bézier curves (see, for example, • Projections and perspectives. MATLAB only [2] pag. 58). This is not a chance: MATLAB handles supports some kinds of projections and perspectives. vectors and matrices in a straightforward and intuitive way. The toolbox incorporates all of them. Furthermore, there are typically many different ways to 3.2 MATLAB graphics commands formulate a given problem in MATLAB; in almost all cases, however, the best performance is expected when MATLAB provides a set of powerful high-level graphical matrix formulation is applied. The simple idea of routines for displaying both two- and three-dimensional organizing data in a matrix form yields to programs that are graphics. However, since we are mainly concerned about more efficient and easier to understand. Thus, Table 2 the three-dimensional pictures, the following description is shows the corresponding code for Bézier surfaces (which restricted to this case (which includes the 2-D case for can be easily derived from Table 1): many commands). In the following we describe the most important MATLAB features for computer graphics (the corresponding commands are denoted in courier font style). function SupBezier(ptos) [m,n,o]=size(ptos); for k=1:3 (1).
Recommended publications
  • Volume Rendering
    Volume Rendering 1.1. Introduction Rapid advances in hardware have been transforming revolutionary approaches in computer graphics into reality. One typical example is the raster graphics that took place in the seventies, when hardware innovations enabled the transition from vector graphics to raster graphics. Another example which has a similar potential is currently shaping up in the field of volume graphics. This trend is rooted in the extensive research and development effort in scientific visualization in general and in volume visualization in particular. Visualization is the usage of computer-supported, interactive, visual representations of data to amplify cognition. Scientific visualization is the visualization of physically based data. Volume visualization is a method of extracting meaningful information from volumetric datasets through the use of interactive graphics and imaging, and is concerned with the representation, manipulation, and rendering of volumetric datasets. Its objective is to provide mechanisms for peering inside volumetric datasets and to enhance the visual understanding. Traditional 3D graphics is based on surface representation. Most common form is polygon-based surfaces for which affordable special-purpose rendering hardware have been developed in the recent years. Volume graphics has the potential to greatly advance the field of 3D graphics by offering a comprehensive alternative to conventional surface representation methods. The object of this thesis is to examine the existing methods for volume visualization and to find a way of efficiently rendering scientific data with commercially available hardware, like PC’s, without requiring dedicated systems. 1.2. Volume Rendering Our display screens are composed of a two-dimensional array of pixels each representing a unit area.
    [Show full text]
  • Dr. Longin Jan Latecki [email protected]
    List of Publications of Longin Jan Latecki (h-index ≥ 54, i10-index ≥ 140, i100-index ≥ 20) Journal Articles (all peer reviewed) 2020 1. Daniel Pedronette and Longin Jan Latecki. Rank-based Self-Training for Graph Convolutional Networks. J. of Information Processing and Management. Accepted December 2020. 2. Quan Zhou, Yu Wang, Yawen Fan, Xiaofu Wu, Suofei Zhang, Bin Kang, Longin Jan Latecki. ALEDNet: Towards Real-time Semantic Segmentation of Self-driving Images via Attention- guided Lightweight Encoder-decoder Network. J. of Applied Soft Computing, accepted August 2020. pdf 3. Ilyass Abouelaziz, Aladine Chetouani, Mohammed El Hassouni, Longin Jan Latecki, and Hocine Cherifi. No-Reference Mesh Visual Quality Assessment via Ensemble of Convolutional Neural Networks and Compact Multi-Linear Pooling. Pattern Recognition, Vol. 100, April 2020. pdf 2019 4. Ilyass Abouelaziz, Aladine Chetouani, Mohammed El Hassouni, Longin Jan Latecki, and Hocine Cherifi. 3D Visual Saliency and Convolutional Neural Network for Blind Mesh Quality Assessment. Neural Computing and Applications, published online Oct 2019. pdf 5. Quan Zhou, Yu Wang, Jia Liu, Xin Jin, and Longin Jan Latecki. An open-source project for real- time image semantic segmentation. SCIENCE CHINA Information Sciences, 62(12), Nov 2019. pdf 6. Quan Zhou, Wenbing Yang, Guangwei Gao, Weihua Ou, Huimin Lu, Jie Chen, and Longin Jan Latecki. Multi-scale deep context convolutional neural networks for semantic segmentation. World Wide Web Journal. Special Issue on Deep vs. Shallow: Learning for Emerging Web-scale Data Computing and Applications, Vol. 22, Issue 2, pp 555–570, March 2019. pdf 7. Song Bai, Xiang Bai, Qi Tian, and Longin Jan Latecki.
    [Show full text]
  • Vector Median Filter with Directional Detector for Color Image Denoising
    Proceedings of the World Congress on Engineering 2011 Vol II WCE 2011, July 6 - 8, 2011, London, U.K. Vector Median Filter with Directional Detector for Color Image Denoising Vladimir V. Khryashchev, Member, IAENG, Denis K. Kuykin, and Alina A. Studenova Abstract – In this paper a new approach to the problem of There are many types of impulse noise. Let x be the impulse noise removal from color images is presented. The i proposed method is based on noise detection algorithm and vector, characterizing a pixel of a noisy image, vi – the weighted vector median filter. The results of its analysis compared to other known median-based vector filters are vector describing impulse noise model, zi is the noise-free presented. The analysis shows that the proposed algorithm is color vector, p – impulse noise probability, then more efficient in random-valued impulse noise removal from color digital images than other considered filters.1 vi , with probability p Index Terms – color image processing, impulse noise xi . removal, vector median filter, order statistic, genetic algorithm zi , with probability1 p optimization Depending on the type of vector vi researchers consider I. INTRODUCTION either fixed-valued or random-valued impulse noise models [4-6]. MAGE noise reduction without structure degradation is In the case of fixed-valued impulse noise v is I perhaps the most important low-level image processing i task [1, 2]. Faulty sensors, optic imperfectness, electronics characterized by the following expression: interference, and data transmission errors may introduce noise to digital images. In considering the signal-to-noise (,,),d zG zBT with probability p ratio over practical communication media, such as i i 1 R BT microwave or satellite links, there can be degradation in (,,),zi d zi with probability p2 vi , quality due to low received signal power.
    [Show full text]
  • Patterns Detection in SAED Images of Transmission Electron Microscopy*
    Patterns Detection in SAED Images of Transmission Electron Microscopy* Stepan Nebaba 1[0000-0001-9203-2170], Dmitry Zavyalov 1[0000-0002-0128-2658], Alexander Pak 1[0000-0001-8447-1309] 1 Tomsk Polytechnic University, Tomsk, Russia {stepanlfx,zda,ayapak}@tpu.ru Abstract. Specialized software that supports existing approaches to processing images of the crystal structure of materials for analyzing transmission electron microscopy images have a lot of different digital image processing methods, but major part of it are weakly automated. Automatic algorithm is able to make the crystal structure analysis more fast and effective process. The paper considers the problem of automated processing of SAED images of transmission electron microscopy. Proposed automated image processing algorithm based on methods of adaptive binarization and Watershed segmentation allows one to determine the distances on the diffraction pattern of a material sample on the image of transmission electron microscopy. The proposed algorithm has been tested on several SAED images, distances were calculated in automatic mode and compared with the results of semi-automatic measurement in Digital Micrograph GMS 1.8 software. The analysis of the results showed high agreement in considered cases, which let us assume that proposed algorithm has good development prospects. Keywords: Computer vision, Image processing, Image analysis, Transmission electron microscopy, Crystalline diffraction pattern, Selected area electron diffraction. 1 Introduction Methods and algorithms of computer vision associated with the processing and analysis of raster images are widely used in various fields of science [1-5], including in the field of processing images obtained using electron microscopes. One of the fundamental problems in these areas is the automation of assessing the composition and structure of materials from their images.
    [Show full text]
  • Advanced Algorithms in Medical Computer Graphics
    EUROGRAPHICS2008/T.TheoharisandP.DutréSTAR–StateofTheArtReport Advanced Algorithms in Medical Computer Graphics Jan Klein1, Dirk Bartz2, Ola Friman1, Markus Hadwiger3, Bernhard Preim4, Felix Ritter1, Anna Vilanova5, Gabriel Zachmann6 1MeVis Research, Germany 2University of Leipzig, Visual Computing (ICCAS), Germany 3VRVis Research Center, Vienna, Austria 4Otto-von-Guericke-University, Institute for Simulation and Graphics, Germany 5Eindhoven University of Technology, Department of Biomedical Engineering, Netherlands 6TU Clausthal, Department of Informatics, Germany Abstract Advanced algorithms and efficient visualization techniques are of major importance in intra-operative imaging and image-guided surgery. The surgical environment is characterized by a high information flow and fast deci- sions, requiring efficient and intuitive presentation of complex medical data and precision in the visualization results. Regions or organs that are classified as risk structures are in this context of particular interest. This paper summarizes advanced algorithms for medical visualization with special focus on risk structures such as tumors, vascular systems and white matter fiber tracts. Algorithms and techniques employed in intra-operative situations or virtual and mixed reality simulations are discussed. Finally, the prototyping and software development process of medical visualization algorithms is addressed. Categories and Subject Descriptors (according to ACM CCS): I.3.5 [Computer Graphics]: Computational Geometry and Object-Modeling I.3.7 [Computer
    [Show full text]
  • Bedrich Benes
    Bedrich Benes July 11, 2020 Purdue University George W. McNelly Professor of Technology Department of Computer Graphics Technology and Computer Science West Lafeyette, In 47907-2021 Phone: (765)-496-2954 Email: [email protected] Research Interests Computer graphics, geometric modeling, procedural modeling, generative algorithms, simulation of natural phenomena, additive manufacturing. Education Ph.D. Computer Science, Czech Technical University in Prague, 1998. M.S. Computer Science, Czech Technical University in Prague, 1991. Professional Experience Apr. 2019 - present George McNelly Professor of Technology Aug. 2019 - present Professor of Department of Computer Science Purdue University, USA Dec. 2017 - 2019 Professor of Department of Computer Science (by courtesy) Purdue University, USA Aug. 2015 - present Professor of Department of Computer Graphics Technology Purdue University, USA Aug. 2010 - Aug. 2015 Associate Professor of Department of Computer Graphics Technology Purdue University, USA Aug. 2011 - Aug. 2012 Assistant Head of Department of Computer Graphics Technology Purdue University, USA Aug. 2005 - Aug. 2010 Assistant Professor of Department of Computer Graphics Technology Purdue University, USA Bedrich Benes 2 Aug. 2000 - Aug. 2005 Assistant Professor of Department of Computer Science Instituto Technol´ogicoy de Estudios Superiores de Monterrey (ITESM), Mexico Jul. 1999 - Jun. 2000 Visiting Professor of Department of Computer Science Instituto Technol´ogicoy de Estudios Superiores de Monterrey (ITESM), Mexico Jun. 1998 -
    [Show full text]
  • Dr. Andrew S. Glassner
    Dr. Andrew S. Glassner 726 N. 47th St. Seattle, WA 98103 USA [email protected] http://www.glassner.com (206) 632-7663 February 2014 Fields of Expertise Computer Graphics: Rendering, modeling, signal processing, texturing, shading, shape grammars Game Design: Creating and developing fun, participatory social games and entertainments Interactive Storytelling: Participatory fiction, multiplayer games Fiction: Novels, screenplays Non-fiction: Computer graphics, interactive story technique Education Ph.D., Computer Science, University of North Carolina at Chapel Hill, Chapel Hill, NC, July, 1988 M.S., Computer Science, University of North Carolina at Chapel Hill, Chapel Hill, NC, 1987 B.S., Computer Engineering, Case Western Reserve University, Cleveland, OH, 1984 Employment President and Director of Education, The Imaginary Institute, LLC February 2013 – Present Novelist, Screenwriter-Director, Consultant, Coyote Wind, LLC May 2000 – Present Researcher, Microsoft Corporation, Microsoft Research, Redmond, WA July 1997 – May 2000 Research in 3D computer graphics and new media Writer-Director, The Microsoft Network, Redmond, WA October 1996 - July 1997 Created and developed Dead Air, an interactive web-based mystery show for The Microsoft Network. Wrote and directed the pilot episode. Researcher, Microsoft Corporation, Microsoft Research, Redmond, WA December 1994 - October 1996 Research in 3D computer graphics and media theory Member of the Research Staff, Xerox Corporation, Palo Alto Research Center (PARC), Palo Alto, CA September 1988 - September 1994 Research in computer graphics Visiting Scientist, Delft University of Technology, Delft, The Netherlands May 1987 - December 1987 Organized and taught advanced computer graphics course. Research in multidimensional ray tracing. Research Assistant University of North Carolina at Chapel Hill, Chapel Hill, NC September 1984 - May 1988 Research in computer graphics, assisted Dr.
    [Show full text]