Shenzhen ZTRON Microelectronics Co., Ltd
Telephone
0755-8299 4126

Software

Indoor positioning APP development


Development of indoor positioning APP based on OCR technology


With the continuous development of our country's economy and the improvement of people's living standards, various indoor places tend to become larger and more complex, such as libraries, hospitals, large supermarkets, high-speed rail stations, underground garages, etc., in large indoor environments. Positioning needs also arise accordingly. Different from outdoor positioning systems such as GPS and Beidou satellite positioning system, indoor positioning systems are a major challenge in the field of mobile applications.


The indoor positioning system based on OCR technology is to establish a database of text information on indoor markers and their corresponding coordinates, so that users can enjoy more accurate positioning services indoors where the GPS signal is weak. Use the APP on the mobile phone to take photos of the text information of indoor landmarks, such as shop names, street signs, exhibit introductions, etc., and the OCR recognition engine connected to the APP will recognize the text information in the picture, and then transmit it to the server for recognition in the database. The text information is retrieved and matched, and the coordinates are returned after the matching is successful, and the location is displayed on the APP in the form of a map and coordinate points.


1. System analysis of indoor positioning APP


1.1 Positioning APP system architecture


The software architecture requires UI components, UI processing components, Baidu OCR engine, Gaode map SDK, data access components, etc. UI components are used to display the user interface, Baidu OCR engine provides text recognition services, AutoNavi maps provide map sources, and the software exchanges information through data access components and databases. In addition, issues such as communication, operation management, and system security need to be considered.


1.2 Main functional modules of indoor positioning APP


The indoor positioning APP mainly includes 6 functional modules.


(1) Registration module: The registration method is mobile phone number or email registration, click to get the verification code to verify the correctness of the mobile phone number or email address, and prevent malicious registration or wrong registration. After the verification is successful, you need to set a login password. If you fill in twice and the password is the same, you will be registered successfully. Then you will automatically log in to the system without entering the account number and password again. At the same time, the system will transmit the registration information to the server and insert it into the user table.


(2) Login module: The user needs to enter the account number and password. If you do not remember the password, you can click "Forgot Password" to reset the password after verifying the mobile phone number or email address. After clicking Login, the login information will be transmitted to the database for comparison, and only if it is completely correct can you enter the main interface.


(3) Setting module: After clicking the gear icon in the main interface, you will enter the setting interface. You can choose to modify the password, map management, whether to allow the administrator to push messages, whether to allow the latest version of the software to be automatically downloaded under WiFi, and clear the cache in the settings. And functions such as logout and login. Among them, map management refers to the ability to download maps of specified cities, which can save data traffic, and it is not necessary to connect to the Internet to receive map resources every time the software is opened.


(4) OCR recognition module: After clicking the camera icon on the right side of the top search bar, the software will open the system camera to take pictures, and then automatically call the Baidu OCR engine for recognition. After the recognized text is displayed, the user can choose to manually modify the text, After modification, upload it to the server, or upload it directly.


(5) Map module: use the map provided by Gaode to display the current location on the map according to the coordinate information returned by the server.


(6) History record module: After clicking the clock icon on the main interface, you will enter the history record interface, where you can see the records of user location, including time, place and text information recognized by OCR.


1.3 Positioning APP system process


After opening the software, click the camera icon on the right side of the search box, turn on the phone camera, and after taking a photo, the system will call the Baidu OCR engine to recognize the text in the photo. If the recognition fails, the user will be prompted to take a clear photo again. After the recognition is successful, the system will recognize the text The displayed text is displayed for the user to check whether it is correct. If there is an error, you can choose to manually modify the text. If there is no error, it will be directly uploaded to the server, and then searched and matched in the database. If the match fails, it will return to the camera interface and prompt the user to restart. Select a landmark, and if the match is successful, the coordinate value will be returned, and then the system will call the Gaode map source to display the indoor map and coordinate points, and one indoor positioning is completed.


2.The main technology of APP design


2.1 Database design


This system creates a database table in the MySQL database on the server side, and according to different data formats, the data is divided into three categories: user login data, user behavior data, and location coordinate data for storage. User login data includes information such as user login account number and password. Since this type of data is very important, it should not be stored in the database in plain text. By using the AES_ENCRYPT function of MySQL to encrypt the data, because the encrypted data is ugly, so then Use the to_base64 function to transcode the data, and store the encrypted user information in the database.


User behavior data includes the time when the user uses the software for indoor positioning, the text recognized by OCR, the text modified by the user, and the location coordinates after positioning. The content of this data is for the user to view in the history record, and the user can delete it by himself.


The location coordinate data includes text information and corresponding coordinate values on the features in the indoor environment. By matching the string uploaded by the user, the coordinates are returned, which are used to display the current location on the mobile client and mark it on the map.


2.2 Call OCR interface


The software uses Baidu's OCR for text recognition. Baidu's OCR service is free, but there is a limit on the number of times per day, but it is enough for student projects. First, enter the console in the Baidu AI open platform, find the product service of text recognition, fill in the relevant information after creating the application, and obtain AK and SK. Then, download the license file. If you directly use AK and SK to call Baidu's OCR in plain text in the project, it is very unsafe. It may be decompiled by others to obtain the user's AK and SK. The license file integrates AK and SK and is placed in the The project can prevent others from cracking. After that, download the Android SDK of Baidu OCR and add it to the project. After the preparatory work is completed, you can start calling Baidu's OCR interface. Create a function that initializes the OCR instance according to the License file in the file where the page to be recognized resides, and call it in the onCreate() method. Next, create a class RecognizeService that can store the OCR recognition method. In the onActivityResult method, call the recAccurateBasic method of the newly created class. This method receives 3 parameters, which are context, the image path obtained by taking pictures, and defined in the RecognizeService class. In the onResult method, the returned result string is the json string of the recognition result. You only need to parse the JSON to get the recognition result.


2.3 Get indoor map service


This software uses the map service provided by Gaode. Enter the console in the Gaode open platform, create an application, obtain the API KEY, download the map SDK file under the Android platform, and import the decompressed jar package into the project. After the development environment is configured, add the user KEY and the required permissions in the "AndroidManifest.xml" file of the project, add the map control in the layout xml file, create a map Activity, and manage the map life cycle.


Summarize


This paper designs and develops an indoor positioning APP based on OCR technology based on the Android platform, which provides a new solution for indoor positioning. The more mature indoor positioning solutions at this stage require infrastructure, such as indoor deployment of dense access points or base stations, such as various sensors, signal receiving devices, signal transmitters, etc., which are costly and require maintenance equipment. The cost of the indoor positioning solution based on OCR technology is very low, and does not require various equipment for positioning. The more troublesome step is only the first step, the establishment of a coordinate library. The text information on the indoor markers is extracted, and a coordinate library is established. This is indeed a lot of work, but with the development of OCR technology and artificial intelligence technology, in the future, it may only be necessary to use drones to shoot all indoor scenes, and then the system can automatically sort out the pictures and match their corresponding coordinates , into the database, so that the workload can be greatly reduced, and even the camera can be turned on to achieve real-time indoor positioning through video recording. As a sensor-free indoor positioning solution, it can provide us with more innovative ideas and research directions.


The above is the indoor positioning APP development technology based on OCR technology introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. If you have software and hardware function development needs for smart electronic products, you can rest assured to entrust them to us. We have rich experience in customized development of electronic products, and can evaluate the development cycle and IC price as soon as possible, and can also calculate PCBA quotations. We are a number of chip agents at home and abroad: Songhan, Yingguang, Jieli, Ankai, Quanzhi, realtek, with MCU, voice IC, Bluetooth IC and module, wifi module. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth wifi development, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the research and development of electronic education products.


  • TOP