Disclosure of Invention
In view of this, the present invention provides an indoor positioning method, a client and a server, which can achieve accurate indoor positioning.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention discloses an indoor positioning method, which comprises the following steps:
acquiring an indoor positioning picture shot by a user by using terminal equipment and sensor positioning data of the terminal equipment during shooting;
sending the positioning picture and the sensor positioning data to a server so that the server can position the position of the user according to the positioning picture and the sensor positioning data;
and receiving a positioning result returned by the server.
Further, the server locates the position of the user according to the positioning picture and the sensor positioning data, including:
the server searches a database to match the sensor positioning data to obtain an initial positioning scene candidate set;
and matching the positioning pictures in the initial positioning scene candidate set to determine the direction of the user.
Further, the matching the positioning picture in the initial positioning scene candidate set to determine the position of the user includes:
determining a shooting scene of a user and a corresponding 3D model;
calculating the orientation of a user in the 3D model by adopting an SFM technology;
the orientation in the 3D model is converted into a physical orientation by coordinate conversion.
Further, after determining the position of the user, the method further includes:
and updating the data in the database according to the positioning picture and the sensor positioning data.
Further, after displaying the position of the user, the method further includes:
receiving a target position input by a user, sending the target position to the server, so that the server calculates an optimal path for the user to reach the target position according to the position of the user and the target position, and returning navigation information to a client, wherein the navigation information comprises the optimal path;
and receiving the navigation information returned by the server.
The invention also discloses a client, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring an indoor positioning picture shot by a user by using terminal equipment and sensor positioning data of the terminal equipment during shooting;
the first sending module is used for sending the positioning picture and the sensor positioning data to a server so that the server can position the position of the user according to the positioning picture and the sensor positioning data;
and the first receiving module is used for receiving the positioning result returned by the server.
Further, the first receiving module is further configured to receive a target location input by a user after receiving the positioning result returned by the server, and receive navigation information returned by the server;
the first sending module is further configured to send the target location to the server, so that the server calculates an optimal path for the user to reach the target location according to the position of the user and the target location, and returns navigation information to a client, where the navigation information includes the optimal path.
Further, an indoor scene positioning picture associated with the optimal path is also included in the navigation information.
The invention also discloses a server, comprising:
the second receiving module is used for receiving a positioning picture and sensor positioning data sent by the client, wherein the positioning picture is an indoor picture which is acquired by the client and is shot by a user through terminal equipment, and the sensor positioning data is acquired by the client and is sensor positioning data of the terminal equipment when the user shoots;
the positioning module is used for positioning the position of the user according to the positioning picture and the sensor positioning data;
and the second sending module is used for returning the positioning result to the client so that the client receives the positioning result.
Further, the positioning module is specifically configured to determine a user shooting scene and a corresponding 3D model; calculating the orientation of a user in the 3D model by adopting an SFM technology; the orientation in the 3D model is converted into a physical orientation by coordinate conversion.
The invention utilizes the camera shooting or photographing function of the terminal equipment, obtains the indoor picture shot by the user for positioning and the sensor positioning data generated when the terminal equipment shoots through the client, and sends the positioning picture and the sensor positioning data to the server, and utilizes the server to position the position of the user according to the positioning picture and the sensor positioning data. Indoor location is carried out through using indoor location picture and sensor location data, and does not receive the restriction of indoor wireless radio frequency signal intensity, makes indoor location more accurate.
Detailed Description
The technical solution of the present invention will be further described in the following detailed description with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings.
It should be noted that the main application scenarios of the indoor positioning method, the client, the server and the system provided by the embodiment of the present invention include, but are not limited to, the following scenarios: indoor navigation of complex buildings (e.g., airports, superstores, museums, etc.), pervasive computing based on geographic location (e.g., crowd awareness), security monitoring related to location information, accurate placement of advertisements, serving social network functions, etc.
Fig. 1 is a schematic flow chart of an indoor positioning method according to embodiment 1 of the present invention, as shown in fig. 1, including the following steps:
s101, acquiring an indoor positioning picture shot by a user through the terminal equipment and sensor positioning data of the terminal equipment during shooting.
Specifically, the execution main body of the embodiment of the present invention is an application client installed on a terminal device, and the terminal device is preferably a mobile terminal device having a camera shooting or photographing function, such as an Ipad, an iphone, a general mobile phone, a notebook computer, and the like. When a user is in an unfamiliar indoor environment and does not know the position of the user, the position of the user is required to be located, the user can use a terminal device carried with the user, such as a mobile phone, to take a picture of a more remarkable indoor building, such as a shop trademark, a poster, a road sign and the like, and the sensor locating data on the terminal device is obtained when the picture is taken. The sensor positioning data may be compass direction and WIFI signal strength.
S102, sending the positioning picture and the sensor positioning data to a server so that the server can position the position of the user according to the positioning picture and the sensor positioning data.
Specifically, after the client acquires the positioning picture and the sensor positioning data, the positioning picture and the sensor positioning data are uploaded to the server, so that the server positions the position of the user according to the positioning picture and the sensor positioning data, and returns a positioning result to the client.
S103, receiving a positioning result returned by the server.
Specifically, the client receives a positioning result returned by the server, where the positioning result includes the position of the user, and the client may display the positioning result on a screen of the terminal device or notify the positioning result to the user in a voice manner.
The embodiment of the invention utilizes the camera shooting or photographing function of the terminal equipment, obtains the indoor picture shot by the user for positioning and the sensor positioning data generated when the terminal equipment shoots through the client, sends the positioning picture and the sensor positioning data to the server, and positions the position of the user according to the positioning picture and the sensor positioning data by utilizing the server. Indoor positioning is carried out by using indoor positioning pictures and sensor positioning data without being limited by indoor wireless radio frequency signal strength, so that the indoor positioning is more accurate, and a user can observe own geographical position in real time by using a terminal device carried with the user.
Fig. 2 is a schematic flow chart of an indoor positioning method according to embodiment 2 of the present invention, as shown in fig. 2, including the following steps:
s201, the client acquires an indoor positioning picture shot by a user through the terminal device and sensor positioning data of the terminal device during shooting.
S202, the client sends the positioning picture and the sensor positioning data to a server.
S203, the server searches a database to match the sensor positioning data, and an initial positioning scene candidate set is obtained.
In particular, if the database for storing the indoor scene pictures is huge in size and the number of indoor scenes is large, the usability of the system is greatly reduced due to the overhead of image processing if the user is accurately located by only performing image matching on the location pictures. Therefore, the embodiment of the invention provides multi-modal indoor positioning, namely, an initial positioning scene candidate set is determined before image matching is carried out on a positioning picture, and the data volume of a matched image is reduced, so that the search space of image matching is greatly reduced.
Before this step is performed, a database is pre-established for storing sensor positioning data, preferably compass direction and WIFI signal strength. When a user shoots an indoor scene, sensor data of the terminal device at the moment, such as compass direction and WIFI signal strength, are recorded while an image is acquired. And generating a compass data Gaussian distribution parameter and a WIFI signal fingerprint for the scene through a plurality of groups of compass directions and WIFI signal intensity data about the scene. Therefore, when the user actually positions, the WIFI signal intensity and compass data uploaded simultaneously with the positioning picture are matched to obtain a candidate scene set with a small scale, namely an initial positioning scene candidate set. And then, fine-grained accurate positioning is carried out by using an image matching method.
And S204, the server matches the positioning picture in the initial positioning scene candidate set to determine the direction of the user.
Specifically, before executing this step, a 3D model database needs to be established in advance, and fine-grained location and direction estimation are performed on the user by extracting features of the location picture and matching the 3D model. The 3D model may be built using the following method: the initial database is established by using crowd sensing, namely a mode of giving certain rewards to users who actively take part in uploading indoor positioning pictures and a mode of actively uploading the indoor positioning pictures by merchants. Specifically, a scene can be conveniently added to the database by the following steps:
A. the user stretches the left hand to shoot a positioning picture of the scene and transmits the positioning picture to the database;
B. the user stretches the right hand to shoot another positioning picture of the scene and transmits the picture to the database;
C. encouraging the user to repeat the operations of the steps 1 and 2 for a plurality of times, and directly entering the step D;
D. a user indicates a shot scene screenshot in the electronic plan and uploads the shot scene screenshot to a database;
E. the user enters his or her arm extension or height.
Through the simple operations, a scene can be added into the database, and then the pictures are processed to establish a simple 3D model for the scene. In the initial stage of the system, the 3D model is limited to the number of pictures, is not very accurate, but is already sufficient to obtain a rough orientation of the user by assisted localization and image recognition. And then, with the increase of uploaded data, the 3D model is continuously updated and updated through continuous updating of the database, so that higher positioning accuracy can be obtained. For example, after the user makes a positioning query, the uploaded positioning picture is added to the 3D model training set of the scene, so as to obtain a more accurate 3D model about the scene. And users often select remarkable indoor scenes for shooting, positioning pictures uploaded by the scenes are natural and many, and models of the scenes are more accurate.
Specifically, the server determines a shooting scene and a corresponding 3D model of the user according to the indoor positioning picture, calculates the orientation of the user in the 3D model by adopting an SFM technology, and converts the orientation in the 3D model into a physical orientation through coordinate conversion, so that the actual orientation of the user is determined.
Since the orientation in the 3D model obtained by SFM is only a relative structure with respect to the scene. The structure also needs to be coordinate transformed to be able to transform the orientation in the 3D model to a physical orientation for indoor positioning. Where the coordinate transformation includes scaling, rotation, and translation. As shown in fig. 3, the embodiment of the present invention estimates the scaling factor by the following method:
the scaling coefficient estimation is converted into an optimization problem by adopting the following formula I or formula II:
the formula I is as follows:
Subject to
the formula II is as follows:
Subject to
whereinRespectively, the coordinates of the ith pair of positioning pictures in the top view of the 3D model for the scene. When the positioning picture is shot, the compass readings of the sensor of the terminal equipment are respectivelyAnd anderror of two readings respectively. The coordinates of the shooting scene in the 3D model are (a, b), SiIndicating the absolute physical distance between the two positioning pictures when the pair of positioning pictures is taken, s indicating the abduction of the user,and lambda is the scaling factor to be obtained for the error between the distance between the two positioning pictures and the user's arm spread.Andthe absolute physical distances from the shooting positions of the two positioning pictures to the shot object are respectively.
The embodiment of the invention adopts the following method to estimate the rotation parameters:
taking an example of finding an entrance of a certain scene, as shown in fig. 4a, wherein an abscissa represents an x-coordinate position of a user in a 3D model, and an ordinate represents a y-coordinate position of the user in the 3D model, according to a photographing position and feature points of the user in the 3D model, four Edges of the scene are found by using a "K-Edges" algorithm, as shown in fig. 4b, so as to determine the entrance of the scene. By comparing the orientation of the portal in the 3D model with the orientation in the actual physical world, the rotation parameters of the 3D model relative to the physical world can be derived.
The fitted straight line obtained by the above algorithm is the geometric representation of the scene entrance in the 3D model. And then, by comparing the indoor plane maps, the rotation of the whole 3D model relative to the physical world can be determined.
The embodiment of the invention adopts the following method to estimate translation:
a reference point needs to be found whose coordinates must be known both in the physical world and in the 3D model. The most prominent scenes are always intended to be placed in the middle of the positioning picture according to the shooting habits of a large number of users. Considering the positioning picture as a ray from the terminal device, the rays generated by the positioning pictures about the scene tend to converge into a point, which is the reference point to be found. For example, also taking the above-mentioned entry to find a certain scene as an example, as shown in fig. 5a, if there are n positioning pictures about the scene, n photographing rays can be determined. It can be theoretically determined from the n photographing raysAnd (4) a point of intersection. The DBSCAN algorithm can be used here to cluster these intersections, and the center of the closest cluster is the reference point, as shown in fig. 5 b. And determining the translation relation of the 3D model and the physical world according to the reference point.
And S205, receiving a positioning result returned by the server.
Compared with other existing indoor positioning methods, the method and the device have the advantages of being low in cost, convenient to deploy, high in precision and the like. Specifically, the embodiment of the invention realizes indoor positioning by using terminal equipment such as a mobile phone and a sensor comprising a camera thereof, and does not need additional special equipment such as a radio frequency transmitter and the like. The embodiment of the invention realizes high-precision indoor positioning by utilizing the 3D reconstruction and image matching technology, and the experimental result shows that the positioning error of the method is within 20 cm. And by analyzing and utilizing the sensor positioning data of the terminal equipment, a mechanism for updating the database according to user query is introduced, and the requirement for the number of pictures for establishing the 3D model is reduced. In addition, the embodiment of the invention reduces the search space of image matching through multi-mode positioning, greatly reduces the overhead of system positioning and realizes the near-real-time indoor positioning effect. Even if the user actually positions, the WIFI signal intensity and compass direction data uploaded simultaneously with the picture are matched through the server to obtain a candidate scene set with a small scale, and then fine-grained accurate positioning is carried out by using an image matching method. By the method provided by the embodiment of the invention, the real-time performance of the system is ensured. The experimental result shows that the system overhead can be reduced by more than 75% through multi-modal positioning.
The embodiment of the invention can provide indoor navigation with auxiliary images besides the most basic indoor positioning function. The basic idea is to provide indoor navigation service for users by using rich image information in the database. The following describes in detail how the present invention provides an indoor navigation service in detail by way of embodiment 3.
Fig. 6 is a schematic flow chart of an indoor positioning method according to embodiment 3 of the present invention, as shown in fig. 6, including the following steps:
s301, the client receives the target position input by the user and sends the target position to the server.
Specifically, after the client finishes user positioning, the client can also receive a target position input by the user, that is, a place to which the user is going to go, and send the target position to the server, so as to provide a navigation service for the user.
S302, the server calculates the optimal path of the user to the target position according to the position of the user and the target position, and returns navigation information to the client, wherein the navigation information comprises the optimal path.
Specifically, the server calculates the shortest path according to the position of the user, i.e., the current position of the user, and the input target position, i.e., the destination, and returns the optimal path information to the client. The server can also find the salient scenes that the user will pass through according to the path, and return a picture of the expected observation angle for the user for each scene.
S303, the client receives the navigation information returned by the server.
Specifically, the client receives navigation information returned by the server, wherein the navigation information comprises the optimal path and a remarkable scene photo possibly encountered in the path, so that the user can enjoy the navigation information. The client may also display an indoor floor plan, with the best path labeled in the floor plan.
Fig. 7 is a schematic structural diagram of a client according to embodiment 4 of the present invention, as shown in fig. 7, including: an acquisition module 11, a first sending module 12 and a first receiving module 13. Wherein,
an obtaining module 11, configured to obtain an indoor positioning picture taken by a user using a terminal device and sensor positioning data of the terminal device during shooting;
a first sending module 12, configured to send the positioning picture and the sensor positioning data to a server, so that the server locates an orientation of a user according to the positioning picture and the sensor positioning data;
a first receiving module 13, configured to receive a positioning result returned by the server.
Further, the first receiving module 13 is further configured to receive a target location input by a user after receiving the positioning result returned by the server, and receive navigation information returned by the server;
the first sending module 12 is further configured to send the target location to the server, so that the server calculates an optimal path for the user to reach the target location according to the position of the user and the target location, and returns navigation information to a client, where the navigation information includes the optimal path.
Further, the navigation information further includes an indoor scene positioning picture associated with the optimal path.
Further, the sensor positioning data comprises compass direction and WIFI signal strength.
The client described in this embodiment is used for executing the method steps related to the client in the indoor positioning method shown in fig. 1, fig. 2 and fig. 6, and the technical principle and the generated technical effect are similar, which refer to the related description of the embodiments shown in fig. 1, fig. 2 and fig. 3 specifically.
Fig. 8 is a schematic structural diagram of a server according to embodiment 5 of the present invention, as shown in fig. 8, including: a second receiving module 21, a positioning module 22 and a second sending module 23. Wherein,
a second receiving module 21, configured to receive a positioning picture and sensor positioning data sent by the client, where the positioning picture is an indoor picture taken by a user using a terminal device and acquired by the client, and the sensor positioning data is sensor positioning data of the terminal device, acquired by the client, when the user takes a picture;
a positioning module 22, configured to position the location of the user according to the positioning picture and the sensor positioning data;
a second sending module 23, configured to return a positioning result to the client, so that the client receives the positioning result.
Further, the positioning module 22 is specifically configured to search a database to match the sensor positioning data, so as to obtain an initial positioning scene candidate set; and matching the positioning pictures in the initial positioning scene candidate set to determine the direction of the user.
Further, the positioning module 22 is specifically configured to determine a shooting scene of the user and a corresponding 3D model; calculating the orientation of a user in the 3D model by adopting an SFM technology; the orientation in the 3D model is converted into a physical orientation by coordinate conversion.
Further, the server further includes:
and an updating module 24, configured to update the data in the database according to the positioning picture and the sensor positioning data after the positioning module 22 determines the position of the user.
Further, the second receiving module 21 is further configured to receive a target position sent by the client after the client displays the location of the user, where the target position is input by the user at the client;
the server further includes:
a navigation module 25, configured to calculate an optimal path for the user to reach the target location according to the position of the user and the target location;
the second sending module 23 is further configured to return navigation information to the client, where the navigation information includes the optimal path.
Further, the navigation information further includes an indoor scene positioning picture associated with the optimal path.
Further, the sensor positioning data comprises compass direction and WIFI signal strength.
The server according to this embodiment is used for executing the method steps related to the server in the indoor positioning method shown in fig. 1, fig. 2 and fig. 6, and the technical principle and the generated technical effect are similar, which refer to the related description of the embodiments shown in fig. 1, fig. 2 and fig. 3 specifically.
Fig. 9 is a schematic structural diagram of a system according to embodiment 6 of the present invention, as shown in fig. 9, including: a client 31, a server 32 and a terminal device 33. Wherein,
the client 31 is installed on the terminal device 33, and performs image capturing or photographing using a camera of the terminal device 33.
The client 31 is configured to obtain an indoor positioning picture taken by a user using the terminal device 33 and sensor positioning data of the terminal device during shooting; sending the positioning picture and the sensor positioning data to a server 32, so that the server 32 positions the position of the user according to the positioning picture and the sensor positioning data; receiving the positioning result returned by the server 32;
further, the client 31 is further configured to receive a target location input by a user after receiving the positioning result returned by the server 32, and receive navigation information returned by the server 32; the target position is sent to the server 32, so that the server 32 calculates the optimal path for the user to reach the target position according to the direction of the user and the target position.
The server 32 is configured to receive a positioning picture and sensor positioning data sent by the client 31, where the positioning picture is an indoor picture taken by a user using a terminal device 33 and acquired by the client 31, and the sensor positioning data is sensor positioning data of the terminal device 33 when the user takes a picture and acquired by the client 31; positioning the position of the user according to the positioning picture and the sensor positioning data; and returning a positioning result to the client terminal 31 so that the client terminal 31 receives the positioning result.
Further, the server 32 is specifically configured to search a database to match the sensor positioning data, so as to obtain an initial positioning scene candidate set; and matching the positioning pictures in the initial positioning scene candidate set to determine the direction of the user.
Further, the server 32 is specifically configured to determine a shooting scene of the user and a corresponding 3D model; calculating the orientation of a user in the 3D model by adopting an SFM technology; the orientation in the 3D model is converted into a physical orientation by coordinate conversion.
Further, the server 32 is further configured to update the data in the database according to the positioning picture and the sensor positioning data after determining the position of the user.
Further, the server 32 is further configured to receive a target position sent by the client 31 after the client 31 displays the location of the user, where the target position is input by the user at the client 31;
the server 32 is further configured to calculate an optimal path for the user to reach the target location according to the position of the user and the target location; and returning navigation information to the client terminal 31, wherein the navigation information comprises the optimal path.
Further, the navigation information further includes an indoor scene positioning picture associated with the optimal path.
Further, the sensor positioning data comprises compass direction and WIFI signal strength.
The system according to this embodiment is used for executing the method steps related to the indoor positioning method shown in fig. 1, fig. 2 and fig. 6, and the technical principle and the generated technical effect are similar, which refer to the related description of the embodiment shown in fig. 1, fig. 2 and fig. 3 specifically.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent replacements, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.