Automatic Generation of a 3D City Model
Total Page:16
File Type:pdf, Size:1020Kb
UNIVERSITY OF CASTILLA-LA MANCHA ESCUELA SUPERIOR DE INFORMÁTICA COMPUTER ENGINEERING DEGREE DEGREE FINAL PROJECT Automatic generation of a 3D city model David Murcia Pacheco June, 2017 AUTOMATIC GENERATION OF A 3D CITY MODEL Escuela Superior de Informática UNIVERSITY OF CASTILLA-LA MANCHA ESCUELA SUPERIOR DE INFORMÁTICA Information Technology and Systems SPECIFIC TECHNOLOGY OF COMPUTER ENGINEERING DEGREE FINAL PROJECT Automatic generation of a 3D city model Author: David Murcia Pacheco Director: Dr. Félix Jesús Villanueva Molina June, 2017 David Murcia Pacheco Ciudad Real – Spain E-mail: [email protected] Phone No.:+34 625 922 076 c 2017 David Murcia Pacheco Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". i TRIBUNAL: Presidente: Vocal: Secretario: FECHA DE DEFENSA: CALIFICACIÓN: PRESIDENTE VOCAL SECRETARIO Fdo.: Fdo.: Fdo.: ii Abstract HIS document collects all information related to the Degree Final Project (DFP) of Com- T puter Engineering Degree of the student David Murcia Pacheco, tutorized by Dr. Félix Jesús Villanueva Molina. This work has been developed during 2016 and 2017 in the Escuela Superior de Informática (ESI), in Ciudad Real, Spain. It is based in one of the proposed sub- jects by the faculty of this university for this year, called "Generación automática del modelo en 3D de una ciudad". This work is part of a bigger project that the ESI is working on, which final goal is to create an operative Smart City model of the city. This bigger project is composed of different works like this (as it is too ambitious to be carried out by a single person). The project subject of this paper is focused on supporting the 3D modeling of the city. Data for doing this work is available and free in the Internet, but it needs to be processed and adjusted so it can be standardized to be used. Main focus of this DFP is to study a quite new technology that is (and is going to be even more) useful and used in the future. This technology is Light Detection and Rang- ing (LIDAR). Other technologies will be studied in parallel. It can be said that LIDAR data is a cloud of points resulting from a scanning process. Lots of devices and software is being de- veloped for this technology, as industry and research is taking advantage of its possibilities. Big scale Airborne LIDAR technology is useful for purposes such as agriculture, forest plan- ning, flood models, mapping, mining, archeology... There is also small scale LIDAR, used for scanning smaller objects or spaces. In this case, this technology is useful for 3D scanning (creating models for, e.g., 3D printers), architecture, 3D gaming, CAD modeling... While working on this project, it has been seen that the DFP is making use of a technology that is going to be very important in the medium and far future. iii Thanks To faculty of ESI. The quality and dedication of their work is outstanding. To all my Vestas colleagues, with whom i try to improve every day, personal and profes- sionally. To my elders brothers Emilio, Pedro Jose and Alberto. I’ve learned so much from them... To my wife Eva, for her support and understanding specially during my study years. To Carla, my new born and first daughter, for helping me value dedication needed to raise another person. This is one of the biggest sacrifice that, as humans, we can choose to make. Sacrifice which some year ago my parents Emilio and Ramona did for me. My biggest thanks is for them. David iv To my wife, Eva v Contents Abstract iii Thanks iv Contents vi List of Tables vii List of Figures viii List of Listings ix LIST OF ACRONYMS x 1 INTRODUCTION 1 1.1 Document Structure . .3 2 GOALS OF DFP 4 2.1 MAIN GOAL . .4 2.2 SPECIFIC GOALS AND DEFINED REQUIREMENTS . .4 2.3 CHALLENGES, LIMITATIONS AND SCOPE . .5 2.4 RESOURCES USED . .6 2.4.1 Hardware Resources . .6 2.4.2 Software Resources . .6 3 ANTECEDENTS AND STATE OF ART 8 3.1 LIDAR . .8 3.1.1 Digital surface models and methods . .9 3.1.1.1 Data pre-preprocessing . .9 3.1.1.2 Ground Point Filtering . 10 3.1.1.3 Interpolation . 10 vi 3.1.2 DSM generation methods for different categories . 10 3.1.2.1 Surface-Based Adjustment . 11 3.1.2.2 Morphology-based filtering . 11 3.1.2.3 Triangulated Irregular Network (TIN)........... 12 3.1.3 Futures challenges for DSM generation . 12 3.1.4 LIDAR .las format Standard 1.4 . 12 3.1.4.1 LIDAR data types . 13 3.1.4.2 LIDAR header format . 13 3.1.4.3 LIDAR point data record format . 17 3.2 3D CITY RENDERING METHODS . 19 3.2.1 Building rendering from LIDAR data . 20 3.2.1.1 Identify blocks and buildings . 20 3.2.1.2 Roof modeling . 23 3.2.2 Building rendering merging aerial and ground views . 25 3.2.2.1 DSM processing . 25 3.2.2.2 Ground based model registration . 26 3.2.2.3 Model merging . 28 3.3 OSM . 29 3.3.1 How do OSM works . 30 3.3.1.1 OSM Geodata . 30 3.3.1.2 Accessing OSM data . 31 3.3.2 OSM XML data and file format . 32 3.4 .PLY FILE FORMAT . 33 4 METHOD 38 4.1 SOURCE CODE FILES AND CLASSES . 38 4.2 PROGRAM INPUT AND OUTPUT . 39 4.3 PROCESS FLOW DIAGRAM . 40 4.4 PROCESS FLOW AND CODE EXPLANATION . 41 5 RESULTS 52 5.1 BASIC TESTING . 52 5.1.1 Further testing . 54 5.2 OUTPUT FILES . 55 5.2.1 LIDAR output . 55 5.2.2 Modified .osm output . 58 vii 5.2.3 .ply output . 60 5.3 SCALABILITY TEST . 64 6 CONCLUSIONS AND PROPOSALS 66 6.1 CONCLUSIONS . 66 6.2 SATISFIED GOALS . 67 6.3 PROPOSALS AND FURTHER WORK . 67 A PREREQUISITES AND DEPENDENCES FOR EXECUTION 70 A.1 INSTALL NEEDED PACKAGES AND LIBRARIES . 70 A.2 DOCUMENTATION GENERATION WITH TEXMAKER . 72 A.3 PROBLEMS DURING INSTALLATION . 72 viii List of Tables 3.1 LIDAR v1.4 header . 14 3.2 LIDAR point data 10 format . 17 3.3 LIDAR point classification numeric assignation . 19 5.1 Scalability tests inputs and results . 64 ix List of Figures 1.1 Smart City Concept . .1 1.2 3D city model . .2 3.1 Airborne LIDAR scanning . .9 3.2 DSM image from New York Central Park . 11 3.3 3D detailed city render . 20 3.4 Delaunay triangulation in plane with circumcircles . 21 3.5 Centroidal Voronoi diagram . 22 3.6 Building walls definned by split Voronoi Cells . 23 3.7 Normal extracted from roof points . 24 3.8 Textured city model example . 25 3.9 Google Street View Car with scanners used for shape mapping . 26 3.10 Surveying vehicle principle . 27 3.11 Result from Building rendering merging aerial and ground views method . 28 3.12 Open Street Maps (OSM) view for Amsterdam city center . 29 3.13 Surveying device and software example . 30 3.14 Data layer for Ciudad Real on OSM web page . 32 3.15 Cow representation from a .ply file . 35 4.1 Process execution flow diagram . 40 5.1 LIDAR campus building points on CloudCompare . 56 5.2 LIDAR campus building and ground points on CloudCompare . 56 5.3 LIDAR ESI building and ground points on CloudCompare . 57 5.4 Entire city of Ciudad Real buildings and ground points on CloudCompare . 58 5.5 .osm representation of the UCLM campus on Blender . 60 5.6 ESI .ply roof on Blender . 61 5.7 Hospital General de Ciudad Real .ply roof on Blender . 61 5.8 LIDAR view of Alcorcón . 65 x List of Listings 3.1 OSM fragment on which the ESI is defined . 34 3.2 .ply header format . 36 3.3 .ply format for vertices and faces . 36 4.1 Input command check in «buildings_capture.cpp» . 41 4.2 .osm buffers, readers and writers initializing in «buildings_capture.cpp» . 41 4.3 .osm header define geographical box used in «buildings_capture.cpp» . 41 4.4 Reading lidar data. Method in «lidar.cpp» . 42 4.5 Set ready files, readers and writers for lidar files in «lidar.cpp» . 42 4.6 LIDAR Point selection and filtering in «lidar.cpp» . 42 4.7 Update header of LIDAR files and close them in «lidar.cpp» . 43 4.8 Statistics applied to find and remove height outliers in «lidar.cpp» . 43 4.9 Print work coordinates on command line in «buildings_capture.cpp» . 44 4.10 Start of .osm file processing in «buildings_capture.cpp» . 44 4.11 Processing of OSM building entities, contained in ways, in «osmium_han- dlers.cpp» . 45 4.12 Call of calculate_height() and create_roof_meshes() methods, in «buildings_- capture.cpp» . 46 4.13 Method for calculation of height of buildings, in «lidar.cpp» . 47 4.14 Method to create the point cloud model for roof tops, in «roof_mesh_gener- ator.cpp» . 49 4.15 Call writerhandler to modify data, and write .osm file, in «roof_mesh_gen- erator.cpp» . 50 4.16 Write of the height tag on buildings for new .osm file, in «osmium_han- dlers.cpp» . 50 4.17 Program finalization and printing result, in«roof_mesh_generator.cpp» .