An Efficient 2.5D Shadow Detection Algorithm for Urban Planning And
Total Page:16
File Type:pdf, Size:1020Kb
International Journal of Geo-Information Article An Efficient 2.5D Shadow Detection Algorithm for Urban Planning and Design Using a Tensor Based Approach Sukriti Bhattacharya 1,* , Christian Braun 2 and Ulrich Leopold 2 1 Department for IT for Innovative Services, Luxembourg Institute of Science and Technology (LIST), L-4362 Esch-sur-Alzette, Luxembourg 2 Department for Environmental Research and Innovation, Luxembourg Institute of Science and Technology (LIST), L-4362 Esch-sur-Alzette, Luxembourg; [email protected] (C.B.); [email protected] (U.L.) * Correspondence: [email protected] Abstract: Urbanization is leading us to a more chaotic state where healthy living becomes a prime concern. The high-rise buildings influence the urban setting with a high shadow rate on surroundings that can have no positive impact on the general neighborhood. Nevertheless, shadows are the main factor of defeatist virtual settings, they are expensive to render in real-time. This paper investigates how the amount of sunlight varies by season and how seasons can indicate the time of year to understand how shadows vary in length at different times of the day and how they change over the seasons. We propose a novel efficient (fast and scalable) algorithm to calculate a 2.5D cast-shadow map from a given LiDAR-derived Digital Surface Model (DSM). We present a proof-of-concept demonstration to examine the technical practicability of the introduced algorithm. Tensor-based techniques such as singular value decomposition, tensor unfolding are examined and deployed to represent the multidimensional data. The proposed method exploits horizon mapping ideas and Citation: Bhattacharya, S.; Braun, C.; extends the method to a modern graphics algorithm (Bresenham’s line drawing algorithm) to account Leopold, U. An Efficient 2.5D Shadow for the DSM’s underlying surface geometry. A proof-of-concept is developed utilizing Python’s Detection Algorithm for Urban TensorFlow library, exploring data flow graphs and the tensor data structure. The heavy computer Planning and Design Using a Tensor Based Approach. ISPRS Int. J. Geo-Inf. graphics algorithm used in this paper is parallelized using PySpark. Results explicate significant 2021, 10, 583. https://doi.org/ enhancements in overall performance while preserving accuracy at negligible variations. 10.3390/ijgi10090583 Keywords: tensor; TensorFlow; Digital Surface Model; Bresenham’s Algorithm; cast shadow Academic Editors: Géraldine Del Mondo, Peng Peng, Feng Lu and Jérôme Gensel 1. Introduction Received: 16 June 2021 Solar Access has become an essential concern for urban planning and building design. Accepted: 24 August 2021 Access to sunlight is a necessary element of a healthy individual thermic relief for inhabit- Published: 28 August 2021 able buildings. Direct sunlight is essential in architecture for psychic health reasons and reduces electric lighting and energy saving. Therefore, spatial analysis [1] in an urban envi- Publisher’s Note: MDPI stays neutral ronment often requires evaluating shadow points given a specific date and time, precisely with regard to jurisdictional claims in associated with the solar position and shared representation of spatial obstructions such as published maps and institutional affil- buildings. Several zonal authorities now require light concerns to be spoken as part of the iations. marking. Shadow studies explain the value of development concerning sun and daylight access to the neighboring settings, that includes encompassing buildings. The following scenarios make shadow calculation a crucial aspect of urban planning, 1. Calculating the amount of time a given roof or facade is shaded, to determine the Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. utility of installing photovoltaic cells for electricity production [2]. This article is an open access article 2. Calculating shadow footprint on vegetated areas, to determine the expected influence distributed under the terms and of a tall new building on the surrounding microclimate [3]. conditions of the Creative Commons 3. Daylight access; Shadow impact calculation to maximize the use of private residential Attribution (CC BY) license (https:// amenity spaces during spring, summer, and fall (Standards For Shadow Studies— creativecommons.org/licenses/by/ http://www.mississauga.ca, accessed on 12 June 2021; Shadow Impact Analysis— 4.0/). https://www.cityofdavis.org, accessed on 25 November 2020). ISPRS Int. J. Geo-Inf. 2021, 10, 583. https://doi.org/10.3390/ijgi10090583 https://www.mdpi.com/journal/ijgi ISPRS Int. J. Geo-Inf. 2021, 10, 583 2 of 17 The Sun is the most notable light source in the solar system, which transmits light from a single point in space; only one ray of direct light can hit a spot on the surface. Therefore, the allied intensity level can only be varied, depending on whether an obstruction prevents the ray. According to the principle of formation, there are two shadow types, cast-shadow, and self-shadow. The cast-shadow also referred to as hard shadow or umbra, is formulated by the objects’ projection in the light source’s direction. On the other hand, the self-shadow relates to the part of the object that is not illuminated, i.e., the building’s façade on the opposite side of the light source. The main idea of horizon mapping is to compute shadows for bump-mapped surfaces by precomputing each height-field visibility. The visibility is determined by the slope, which represents the highest elevation spot seen from a particular viewpoint. Max [4] proposed horizon mapping to overcome missing shadows on bump mapped surfaces. The bump mapping is a basic shading technique for rendering bumps on flat textures proposed by Blinn [5]. Cook introduced the displacement mapping to represent bumps [6]. The shadow map method [7,8] and shadow volume method [9] showed displacement mapping could be combined with rendering methods for geometry-based shadows. Becker and Max [10] showed that various bump mapping algorithms could be blended, including displacement mapping. Later, Wang et al. developed a view-dependent displacement mapping algorithm [11]. Onoue et al. took surface curvature into account to compute bump map shadows [12]. In late 1968 by A. Appel [13] introduced ray tracing for hard shadow. The principle is straightforward; a shadow ray casts from the intersection point to the light source. If the ray intersects an object between its origin and the light source, it is in shadow; otherwise. The raster-based solutions on the other hand, are widely implemented in soft- wares and tools [14,15]. For example, r.sun command [16] in GRASS GIS [17], the UMEP plugin [18] for QGIS [19], insol (https://CRAN.R-project.org/package=insol, accessed on 22 March 2019) package [20] and shadow (https://CRAN.R-project.org/package=shadow, accessed on 22 March 2019) package [21] in R, are few widely available open-source solu- tions. The proprietary software ArcGIS, provides raster-based shadow calculations using the Solar Analyst extension [22]. In one of our recent works [23], we proposed a 2.5D shadow detection algorithm in a similar context. The term 2.5D is used in computer graphics to describe the process of creating the illusion of a three-dimensional scene without the use of complete 3D rendering. 2.5D projections have been helpful in understanding visual-cognitive spatial representations or 3D visualization in geographic visualization (GVIS) [24]. The main limitations of the proposed algorithm are as follows, • The algorithm was limited to the buildings only. The base height of the buildings was calculated using 3Dfier (https://github.com/tudelft3d/3dfier, accessed on 22 March 2019) developed by Delft University. 3Dfier uses the LOD1 model [25] in which blocks represent buildings; Therefore, it overlooks accurate building height. • the shadow point calculation algorithm was not parallelized. Hence time-consuming. This paper proposes a novel scalable 2.5D real-time hard shadow detection algorithm to overcome the shortcomings. First, the algorithm operates on a LiDAR-derived Digital Surface Model (DSM) at a sufficiently high resolution for a given urban context. DSM repre- sents the mean sea level (MSL) elevations of trees’ reflective surfaces, buildings, and other features elevated above the bare earth. Therefore, the present algorithm is not dependent on 3Dfier and limited to the LOD1 model. Secondly, from an implementation point of view, tensor-based techniques such as singular value decomposition, tensor unfolding are examined and deployed to represent the multidimensional data [26]. The proposed method exploits horizon mapping ideas and extends the technique to a modern graphics algorithm (Bresenham’s line drawing algorithm) to account for the DSM’s underlying surface geometry. The proof of the concept is developed in Python using Tensorflow [27], an open-source software library developed by the Google Brain Team using data flow graphs and the tensor data structure. The heavy computer graphics algorithm used in this ISPRS Int. J. Geo-Inf. 2021, 10, 583 3 of 17 paper is parallelized using PySpark [28,29]. Results obtained from the stated work were analyzed to exhibit high scalability levels in time and accuracy. 2. Methodology 2.1. Shadow Geometry Solar orientation is the means of aiming something at the sun. Solar technologies like a solar panel or a sun oven receive the highest energy amount when oriented at a right angle (90◦) towards the sun. Standing at the exact center of the skydome, where