Barcode based localization system in indoor environment Ľubica Ilkovičová, Ján Erdélyi, Alojz Kopáčik Slovak University of Technology, Faculty of Civil Engineering, Radlinskeho 11, 81368 Bratislava, Slovakia Web site: www.svf.stuba.sk lubica_ilkovicova@stuba.sk Abstract Nowadays, in the era of intelligent buildings, there is a need to create indoor navigation systems, what is steadily a challenge. QR (Quick Response) codes provide accurate localization also in indoor environment, where other navigation techniques (e.g. GPS) are not available. The paper deals with the issues of posi- tioning using QR codes, solved at the Department of Surveying, Faculty of Civil Engineering SUT in Bratislava. Operating principle of QR codes, description of the application for positioning in indoor environment based on OS Android for smartphones are described. Keywords: indoor positioning, QR Codes, OS Android, smartphones 1. Introduction In recent years we have seen a sharp increase in activities aimed at automating processes and services. Their integral part is creating of intelligent environment, in which vehicles, machines and people are navigated. In open areas, this task is provided using global navigation satellite systems (GNSS), which are available on every place of the land, at the sea and in the air. The operation of GNSS technology is considerably limited in areas with high-rise buildings, occultation, respectively is not applicable in indoor environment. Therefore are developed systems, which can supplement or completely replace the GNSS technology. At the present, there is an increasing need to navigate persons not only in outdoor environment, but also in buildings, such as hospitals, office buildings, parking houses and so on. Navigation systems in buildings make the movement of the people not only more effective, but also safer. The people can be navigated to the nearest escape route, and the operation of emergency units can be more effective. In this paper is presented a proposal of a positioning system based on identification using QR codes, as well as its concrete realization with the name QR_STU. This can be a subsystem of information systems of intelligent buildings. Functionality of the system has been tested at the Slovak University of Technology in Bratislava at the Department of Surveying. 2. Design of the positioning system Important part of information systems of intelligent buildings are systems for navigation and localization in indoor environment of these buildings. The navigation system allows for the user to navigate to the place of interest, and enables easier and more efficient use of the building environment. Positioning systems are a simplified form of navigation systems, Geoinformatics FCE CTU 13, 2014, doi:10.14311/gi.13.4 31 http://orcid.org/0000-0002-8061-4592 http://orcid.org/0000-0001-9492-2775 www.svf.stuba.sk http://dx.doi.org/10.14311/gi.13.4 Ilkovičová, Ľ.: Barcode based localization system in indoor environment which instead of real time navigation, allow determining of the current position of the visitor considering to the environment of the buildings. Besides the position, they can provide important additional information, which are necessary for quicker orientation and planning the visits (information about rooms, offices, etc.). Positioning system working on the basis of localization of the users using QR codes is based on the identification of QR codes, which are positioned on the characteristic places in a building. QR codes placed at these locations allow users to determine their current position on the map. The QR code includes the information, with which we are able to identify the user's location (it may be a coordinate, or URL). Besides the positioning IDs, QR code can also contain additional information about the object or the position where is the user currently located. Requirements for a system mentioned above are: simple actualization of data (the ability to update only part of the system as needed), the possibility to install the map of a building (or floor) on local server (to make the application more independent), and the possibility to add to the map some additional information (e.g. pictures, contacts, etc.). QR code is a two-dimensional barcode, whose advantage is a high capacity of data, which can be encoded. While conventional bar code is able to encode about 20 digits, a QR code is able to encode from ten to a hundred times more (all alphanumeric characters and symbols), that means one QR code can store up to 7089 characters. Another advantage is also its shape and size. Contrary to traditional bar code, which is oriented horizontally, QR code carries the information also vertically. Advantage of QR code is also the ability to "error correction". Data can be decoded even if the QR code is partly dirty or destroyed (Fig. 1), but can´t be destroyed more than 30% of codewords (one codeword represents 8 bits) [1]. Figure 1: Dirty or destroyed QR code The most appropriate equipment to install a positioning system is a smartphone, especially because of its technological parameters, such as screen size, and simplicity of control and comfort. For a smartphone is not a problem to run multiple applications at once. In the following parts of this paper, is designed a positioning system running on Android operating system, which currently is used by most of software developers for smartphones. Its use is user-friendly, easy and very intuitive. The advantage of OS Android is not only many free apps, but also the fact that it is an “open” operating system (anyone can program apps using freeware compilers) [2]. This property allows modifications of the designed system by the users. Two basic concepts of positioning system using QR codes distinguish between so-called offline and online solution. In both cases, the user have to install the application at the entrance Geoinformatics FCE CTU 13, 2014 32 Ilkovičová, Ľ.: Barcode based localization system in indoor environment Figure 2: Flowchart of the application to the building by connecting to the local network of the information system of the build- ing. Advantage of the offline solution is, that the internet connection is required only for installing the app, when all the data needed to locate the user (maps, contact lists, etc.) are automatically downloaded and updated. However, this solution is more difficult, in terms of storage capacity and is suitable only for smaller building (less data). In contrast, online solution displayed the requested information by reading URL, which is encoded in the QR code, using a web browser. In this case, URL includes the address of the maps on the external server, and the internet connection is required at all times during the visit of the building. The advantage is, that the storage of the device used is not overloaded with a large amount of the data. The flowchart of the online positioning system is shown in Figure 2. The user downloads the app at the entrance to the building. After the installation and the launching of the app, the user launches a QR code reader, which decodes the QR code scanned Geoinformatics FCE CTU 13, 2014 33 Ilkovičová, Ľ.: Barcode based localization system in indoor environment by the camera of the smartphone. The application can continue and show the decoded URL, or to terminate it. If the user chooses to view the URL, the application redirects him to the external server, where an interactive map is stored. The map can be controlled interactively (e.g. zoom), and the additional information associated with each object can be used (e.g. contact list). After showing the map, the application can be terminated or the user can continue with taking the next QR code. 3. The application QR_STU One of the specific solutions of above proposed positioning system is the application QR_STU (Fig. 3a). The application is developed in Java and designed for OS Android for use in smartphones. During the installation of the application, the main application and the QR code reader is installed from a single installation package. The QR code reader is integrated into the application source code QR_STU. Scanning the QR codes is performed by ZXing library, or also "Zebra Crossing", which is an open source library for processing 1D and 2D barcodes of multiple formats, implemented in Java. The library supports all of the most commonly used formats of barcodes and QR codes: • EAN-8 a EAN-13 (European Article Number), • UPC-A a UPC-E (Universal Product Code), • and many others (ITF, Codabar, Data Matrix, QR Code, etc.) [3] For scanning the QR codes, is used the camera built in the smartphone. The QR code reader starts automatically when the user press the "SCAN" button. If the QR code reader is not yet installed, the application automatically offers its installation (Fig. 3b). Figure 3: Startup screen of the application, installing the reader, the content of a QR code After scanning the code, the type of the scanned code and its content are displayed. In our case, the encoded content is the URL address of an interactive map stored on external server (Fig. 5). After clicking on the link a map displaying the position of the user and some additional information are obtained. Geoinformatics FCE CTU 13, 2014 34 Ilkovičová, Ľ.: Barcode based localization system in indoor environment The functionality of the positioning system was tested at the Slovak University of Technology in Bratislava at the Department of Surveying. The plan of the department (one floor in the block A of the building of the Faculty of Civil Engineering) was created in AutoCAD software (Fig. 4), and was inserted into the online service iMap Builder, in which we imported to the map some additional information (Fig. 5). That was the name of the employee, who is sitting in that office. This kind of information is displayed after clicking on each office. Figure 4: Floor plan of the Department of Surveying The database of other additional information, which are displayed by clicking on the icons, and which we also added to the map, contains for example also a phone number, teacher's schedule, and automated redirection to sending mail or to the website of the department. After determination of the user's position and displaying the map, the user can find all the necessary information about a person or an office he is looking for by clicking on one of the offices. Thus user is able to find the most optimal way from his current position to the searched office, or person (Fig. 5). Figure 5: Positioning by QR_STU 4. Conclusion Since there is no universally applicable and commercially available navigation system for indoor environment of intelligent buildings, and such systems are not yet an ordinary part Geoinformatics FCE CTU 13, 2014 35 Ilkovičová, Ľ.: Barcode based localization system in indoor environment of smartphones, the topic of indoor navigation is still a big challenge. Creating online and offline versions of positioning systems using QR codes is an easy way to locate the users in the areas of the buildings. Java application with integrated QR code reader named QR_STU was created. The system works online, so all the data needed for interactive positioning are downloaded from an external server. The system described in the paper, would be improved in the future, enabling interactive navigation in real time. Acknowledgement This publication was supported by Competence Center for SMART Technologies for Elec- tronics and Informatics Systems and Services, ITMS 26240220072, funded by the Research & Development Operational Programme from the ERDF. References [1] http://www.qrcode.com/en/, cited: 27.1.2014 [2] GRANT, A. 2012. Beginning Android 4, New York: Apress Media, 2012. 604 p. ISBN 978- 1-4302-3984-0. [3] https://github.com/zxing/zxing, cited: 28.1.2014 Geoinformatics FCE CTU 13, 2014 36 http://www.qrcode.com/en/ https://github.com/zxing/zxing