Towards Collection of Smart City Data for Cloud Storage Using UAVs

Developing towards smart cities requires a welldeveloped infrastructure that is lacking in most cities today. Due to its low cost and flexibility in performing various operations, UAVs can help such cities develop in this direction. The article describes the methodology and process of collecting smart city data using drones for cities that do not have a sufficiently developed infrastructure. For storage and subsequent analysis of data, a cloud server is required; TUC DriveCloud is presented as an example of such a server in the article. Traffic analysis and building inspection are described as examples of drone data collection tasks. The advantages and disadvantages of collecting data using a thermal imaging camera are also discussed using the example of the problem of detecting and tracking the movement


I. INTRODUCTION
Following the definition of the European Commission, a smart city is "A smart city is a place where traditional networks and services are made more efficient with the use of digital and telecommunication technologies for the benefit of its inhabitants and business" [1].
A smart city describes a city with deep-integrated automated processes triggered by data from other processes or users. Typically, this requires a powerful, interconnected city infrastructure to collect and distribute all types of data. It includes data collected from people, devices and buildings, which are then analyzed to control and manage transport, energy, security, emergency and other systems to ensure the efficient functioning of the city. Up today, for many cities, this infrastructure is not available. UAVs (or drones) can help such cities in development towards smart cities due to their low cost and high flexibility in collection data.
Three types of drones will be considered that can help cities evolve towards smart cities. One drone is equipped with a thermal camera, the second drone with a highresolution camera for traffic analysis, and the third drone with a high-resolution camera for inspection of buildings. With these drones, information could be collected and provided to a cloud system, the TUC DriveCloud.

A. UAVs
Drones are usually small airborne vehicles that can carry a variety of sensors and loads [2]. Usually, it operates remotely by an operator or autonomously by onboard computers. The drones are easy to use, have a wide range of sophisticated missions, support high-definition video recording, and can cover large and hard-to-reach areas. Moreover, with their development, they are becoming cheaper along with improving the efficiency of operations. This is why smart cities use drones in a wide variety of applications. There are some drone capabilities applied to smart city [4]: • Due to the special design, it becomes possible to install various sensors on the drone to perform various tasks, such as geospatial research and land management, along with environmental analysis. • Additionally, trends towards data mining are allowing drones to be deployed in the civil security arena. The involvement of drones in smart policing, integration with mobile applications, stable and safe wireless networks can help make a smart city a safer place. Also, this could allow city governance to shift from being reactive to proactive. • Due to their ability to reach remote locations, drones provide the ability to more effectively monitor and control disasters such as fires, floods, earthquakes, and so on.

B. TUC DriveCloud
Cloud storage is one of the requirements that must be met to integrate smart systems with smart products and services in the context of a smart city. Cloud storage stores ~ 5 ~ data and statistics that are analyzed and processed to make sense over time and be used for decision making [3].
TUC DriveCloud is a big cloud data storage and analysis platform mainly targeted at but not limited to automotive test applications [5]. It can be used with any type of vehicles, including drones.
Its main features are structured sensor and vehicle management; standardized input and output API (abstracted from the actual storage technology); support for test drive management and recording as well as a live preview of collected data, and labeling of test drives. The TUC DriveCloud system is a structured cloud database for recording and administering data obtained from sensors. This cloud-based database can be accessed with drones using standardized APIs for input and output as shown in Figure 1. Currently, there is no such connection. Another part of the cloud application is a website that runs on the TU Chemnitz PROWeb server and provides a simplified user interface for cloud data input and output. Test vehicles can be added to the cloud through this web interface [6].
TUC DriveCloud allows to set the sensor readout period. After this configuration, the vehicle can conduct trips, the data of which will be stored in the cloud database, sorted by trips. Data can be saved directly to the cloud database while traveling through the token-protected API. If this is not possible due to the lack of an Internet connection, the data is first saved locally and then loaded into TUC DriveCloud. Trip data, which can be tabulated, can be saved as a CSV file that can be uploaded to the cloud database via the website. The data is prepared graphically and can then be evaluated and viewed on the website [7].

A. UAV Mission Framework
The whole drone mission management process can be presented as a framework. The framework divides the entire process into a set of steps, which leads to the systematic and efficient conduct of any research using drones. The core of the framework is existing research. It is divided into the following components [8]: • Scope definition. The first module of the framework contains the definition of the scope of the study. It is the most important step, as all subsequent steps depend on it. • Flight planning. The Flight Planning Stage includes preparing to launch the drone to collect the necessary data. • Flight implementation. During the flight of the drone, the drone flies over the area of interest along the prepared route and collects the necessary data using the sensors located on it. The flight is carried out based on the parameters determined during the previous step. The flight, depending on the preference and experience of the drone user, is controlled manually using the radio remote control or using the autopilot function. • Data acquisition. The collection of information is highly dependent on the scope of the study. The data includes high-quality video recording along with other data from sensors located on the drone. In some cases, flight telemetry data is also collected from the drone and used to calibrate the recorded video. • Data preprocessing and transferring. After collection, data from the drone should be preprocessed and transferred to the server for further processing. • Data processing and analysis. Video analytics has attracted considerable attention mainly because of the ability to easily visualize a phenomenon along with detailed trajectory data at the same time [9]. • Data interpretation. Data interpretation is implemented using various visualization tools, such as charts and graphs, which are obtained as a result of performing data analysis procedures. The data collection part in this framework includes all steps up to and including data transferring. These will be described later in the paper.

B. Flight Planning
Due to the significant increase in the number of drones, laws began to be developed and enforced to regulate their use. In such a situation, when collecting data, even more importance is given to planning the flight of the drone. The entire planning process can be divided into 3 main aspects: safety, environment, and route planning categories.
First of all, the survey area for the flight should be estimated using local maps of the flight areas. Flight parameters should be selected based on suitable flight zones, ~ 6 ~ safe thresholds, and other design characteristics. It is followed by obtaining a flight permit from the concerned institution.
Location characteristics such as infrastructure must also be considered to determine optimal flight parameters. Parameters such as weather, wind, and time of day at the study site require special consideration.
With the advancement of technology, more and more advanced drone route planning technologies are available to develop more methodical and automated operations. Using such tools, the user can easily indicate the points in the planned route that the drone should visit. Alternatively, it is possible to upload a precise path to the drone for automatic flight.
There are many civilian drone applications and route planning problems associated with them. These problems can be classified by the type of drone operation [11]: • Area coverage, where drones have to cover a certain area,

C. Traffic Analysis
Traffic affects the life of every citizen in several aspects: the time it takes to move from home to work, the quality of the air he/she breathes, the stress caused by being stuck in traffic jams, as well as lack of sleep and exercise as a result of time spent in traffic jams [10]. Thus, an important part of a smart city is the monitoring and management of traffic in the city.
In some surveillance applications, such as transportation planning, routing is done using area coverage. However, the most common use of these applications is a tour of multiple points or road segments, starting and ending at a depot. Thus, this planning problem can be formulated as a generalized version of such common problems as traveling salesman problems or vehicle route problems [11].
There are several varieties of drone path planning problems. Some of the most common problems are presented in Figure 2.
One of the factors influencing route planning is the presence of a minimum turning radius for drones traveling at a constant speed. The path of such drones, which cannot contain bends with a radius less than a certain value, is called a Dubins path.
Some drone operations can be modeled as path planning problems with neighborhoods. This path problem consists of finding the shortest path length for one or more drones so that each neighborhood must be visited at least once. During disaster management, such as oil spills, forest fires, earthquakes, or urgent services such as traffic accident investigations, surveillance requests are dynamic and must be handled by available drones. Since the execution time of such queries is often undefined, various variants of the dynamic traveling repairman problem can arise. Traffic information is an important part of smart city management. Such systems as traffic monitoring and control, public transport planning, and so on are based on it. However, static traffic sensors are not installed everywhere due to their high purchase and maintenance costs. Also, mobile traffic detectors are not widespread, resulting in the low acquisition of traffic information. Thus, drones, as a new tool, have their unique advantages in mobility, versatility, wide camera viewing angles, and low operating costs.
Consider an existing traffic analysis framework. It has the following five components [12]: motion analysis; SVM (support vector machine) based vehicle detection; motion-vector clustering; connected counting, and traffic flow parameter estimation.
Further processing allows you to collect traffic flow data from frame-based information. Vehicle speed and traffic density are the most valuable parameters for simulating a traffic model.

D. Building Inspection
3D visualization is becoming an important component of a smart city, making it more accessible to more people. Smart 3D city models are being developed by cities such as Hamburg, Helsinki, Chicago and London to simplify city master planning and assess the impact of new developments and public services.

~ 7 ~
A building inspection uses the area coverage route planning or less often the routing for a set of locations.
Coverage path planning refers to finding a path for a drone in which all points of a certain area are covered at least once. [11]. Figure 3 shows examples of drone paths. The common trajectories are spiraling and lawn mowing patterns. An area can also be represented as a graph by dividing the area into a collection of cells. Next, it is needed to capture information about the connectivity of these cells and the distance between them. If we represent these cells as the vertices of a graph, this reduces the task of building a route to a travelling salesman problem (TSP). When constructing a route, it is worth taking into account the height differences of the territory, as this affects the energy efficiency of the routes. The data collected with the drone can be converted into a 3D model for further analysis. For this, the following existing framework is used [13]: image acquisition; image matching; relative orientation; bundle adjustment; DSM and DOM generation, and 3D building reconstruction.
The photogrammetric processing, including image matching, the relative orientation of images, bundle adjustment, generation of the digital surface model (DSM) and the digital orthophoto map (DOM), and building reconstruction in the 3D model are the steps to build 3D models.
Photos taken from drones with digital cameras have very important advantages for matching images and generating a 3D model of buildings. The main ones are the wide-angle view of the camera and the high area of overlap, which can be up to 80%, which means that an area will appear in 5 different shots. It allows the design of models with high precision. Figure 4 shows example of overlap detection. A 3D city model is one of the most important photogrammetric products. It finds applications in many areas such as vehicle navigation, online shopping, city planning, and so on. Low-altitude drone imagery of the city helps make these models more detailed with improved textures due to their image overlap characteristics. An example of such a 3D model is in Figure 5.

E. Thermal Camera
Thermal cameras can be used in many fields. One of the most popular applications for thermal cameras is building inspection. However, due to the reduction in cost and independence from lighting, they are becoming popular in various fields. For example, they can be useful in border and coastal surveillance as they can spot people several kilometers away. They resemble color cameras in weight and size, although they are still more expensive [14]. A network of such cameras can become part of a larger network of cameras due to the ease of data transfer [15].
The main application of such cameras for a smart city is their use to detect and track the movement of people [16]. An example of this use can be seen in Figure 6. When subtracting the background to detect moving objects, the disadvantages of both types of cameras must be considered. To use RGB cameras, it is worth considering the shadows of people, which can quickly change depending on the lighting and cause false detection. When using a thermal camera, it is worth considering reflective surfaces as they are capable of reflecting thermal radiation that can be captured by the thermal camera. A comparison of camera types is shown in Table I.

F. Data Transferring
The last step in collecting data is sending the data to the server for further processing. The transmission takes place frame by frame or as a video stream using a special Access-Point module installed on the drone.
To access the TUC DriveCloud server, the standardized REST API and HTTP protocol are used. Figure 7 shows components of drone and server communication. Figure 7: Scheme of a drone data transferring [18] During a mission, the drone transmits not only data from wearable sensors, but also, if necessary, some telemetry, such as altitude, speed, and coordinates.
When transmitting data online, the data is sent from the drone in real-time. When using this transmission method, it is necessary to consider the network bandwidth and, thus, design the drone routes depending on the network coverage area. If the speed of the Internet connection is not sufficient to transfer original photos or if the space in the cloud storage is limited, the frames must be compressed before transfer. It happens at the preprocessing stage. If the data transfer takes place offline, then, during the flight, the drone saves all data to a hard drive and transmits the data during its return to base. In this case, there is no need to consider the connection speed, but besides, the size of the drone storage must be considered.

A. Shared system
All of the above examples of using a drone to collect data can be used in the context of a smart city. To do this, it is necessary to transfer the collected data to the TUС DriveCloud cloud storage. The proposed system for collecting data from a drone is part of the pipeline of a project for collecting, processing and visualizing data from a smart city. The general system diagram is shown in Fig. 8.

B. Data collection part
Data collection is the first part of the project. To implement the ability to transfer data from drones to the TUC DriveCloud server, it is necessary to develop and implement a data transfer module for drones. Such a module will collect data from drones using the MAVLink protocol and transmit data via the Internet using HTTP requests. The collected data will be the image from the camera installed on it, as well as telemetry data, such as location, altitude, speed and direction of flight. The proposed data flow diagram of the module is shown in Fig. 9. The module collects telemetry data from the drone directly using the Mavlink Abstraction component. This is an already implemented component that allows you to work with the MAVLink protocol using software interfaces. During the flight, the drone records video, which is saved locally in a video file. Video Frame Reader component allows you to extract the last captured frames from the recorded video and save them to the file system as a separate file, passing the path to this file to the module. Using this path, the module can ~ 9 ~ find this file and extract all the data necessary for sending from it, including the image itself. After the module has all the necessary data, it converts them into TUС DriveCloudspecific requests and sends them to the server for further processing and storage. The general principles of the data collection process for a smart city were reviewed in this paper. The possibilities and disadvantages of using drones for collecting information, the stage of preparing the flight, preparing and sending data to the cloud server were considered in detail. Application areas of mobile data collection such as traffic analysis and building inspection were also explored, along with comparisons between the use of RGB and thermal cameras for motion detection. Software has been proposed in the form of a drone module for transferring smart city data to a cloud server.
From the given data it follows that cities should invest more in researching and deploying drone systems to analyze and manage city operations and processes. The researched articles show that it is currently one of the cheapest and most versatile methods for getting closer to a smart city due to its advantages.