Disclosure of Invention
The invention provides a WIFI-based vision-enhancing SLAM method and device, and aims to solve the problems that in an indoor office environment, a vision SLAM has a phenomenon of perception aliasing caused by a large number of repeated symmetrical spatial structures, and error loop detection is easily caused to cause error positioning, so that the calculation complexity and the processing time are increased. Through combining together WIFI response and vision SLAM, before carrying out the loop detection, preprocess WIFI data, reprocess image data, can reach the effect of coarse adjustment fine setting again, promote the degree of accuracy and the speed that the loop detected by a wide margin, have accurate, high efficiency etc. and show the advantage.
According to a first aspect of embodiments of the present invention, there is provided a WIFI-based enhanced visual SLAM method, the method comprising:
collecting first WIFI signals, clustering into first WIFI signatures, and forming a corresponding regional map database, wherein the first WIFI signals are collected WIFI signals of different regions in the visual SLAM mapping process, and the first WIFI signatures are clustered into WIFI signatures of different regions in the visual SLAM mapping process;
collecting second WIFI signals, and clustering into second WIFI signatures, wherein the second WIFI signals are the WIFI signals of the current area collected before loop detection, and the second WIFI signatures are the WIFI signatures of the current area clustered before loop detection;
traversing the regional map database based on the second WIFI signature, and calculating similarity to obtain a bag with the highest similarity in the regional map database;
performing the loop detection according to the bag of words.
Optionally, the hierarchical structure of the area map database is as follows:
each regional map database comprises a plurality of regional maps, and each regional map is represented by a regional map WIFI signature;
each regional map comprises a plurality of word bags, and each word bag is represented by a word bag WIFI signature.
Optionally, the WIFI signature is represented by two values, BSSID and RSSI, to represent a corresponding WIFI signal.
Optionally, the similarity is similarity of WIFI signatures, and includes BSSID similarity and RSSI similarity.
Optionally, the calculating of the similarity includes the following steps:
calculating and comparing the BSSID similarity and the RSSI similarity of the area map WIFI signature in the area map database so as to determine the area map, wherein the calculation formula of the BSSID similarity and the RSSI similarity of the area map WIFI signature is as follows:
BSSID similarity ═ ref · cur,
RSSI similarity is v · w/| v | | | w |;
calculating and comparing the RSSI similarity of the bag-of-words WIFI signature contained in the determined area map so as to determine the bag-of-words, wherein the RSSI similarity of the bag-of-words WIFI signature is calculated according to the following formula:
RSSI similarity is u ri/|u||ri|。
According to a second aspect of embodiments of the present invention, there is provided a WIFI-based enhanced vision SLAM device, the device comprising:
the generating module is used for collecting first WIFI signals, clustering the first WIFI signals into first WIFI signatures and forming a corresponding regional map database, wherein the first WIFI signals are collected WIFI signals of different regions in the visual SLAM mapping process, and the first WIFI signatures are clustered into WIFI signatures of different regions in the visual SLAM mapping process;
the clustering module is used for collecting second WIFI signals and clustering the second WIFI signals into second WIFI signatures, the second WIFI signals are the WIFI signals collected in the current area before loop detection, and the second WIFI signatures are the WIFI signatures clustered into the current area before loop detection;
the traversal module is used for traversing the regional map database based on the second WIFI signature, calculating the similarity and obtaining a bag with the highest similarity in the regional map database;
and the detection module is used for carrying out loop detection according to the word bag.
According to the technical scheme, the WIFI-based visual SLAM enhancement method and device have the advantages that the WIFI detection is integrated into the visual SLAM algorithm, the first WIFI signatures are clustered in the visual SLAM graph building process to form the regional map database, the second WIFI signatures are clustered before loopback detection is performed, the second WIFI signatures are matched with the first WIFI signatures in the regional map database, the similarity is calculated, the word bag with the highest similarity can be obtained quickly and accurately, and the loopback detection is performed. The method can solve the problems that in an indoor office environment, due to the fact that a large number of perception aliasing phenomena caused by repeated and symmetrical space structures exist, wrong loop detection is easily caused, and therefore wrong positioning is caused, and therefore calculation complexity and processing time are increased. Therefore, the WIFI detection is integrated into the visual SLAM algorithm to roughly position the area where the robot or the mobile equipment is located, so that the accuracy and the speed of loop detection are greatly improved, and the method has the remarkable advantages of accuracy, high efficiency and the like.
Detailed Description
The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the invention easier to understand by those skilled in the art, and thus will clearly and clearly define the scope of the invention.
As shown in fig. 1, a flowchart of a WIFI-based enhanced vision SLAM method includes the steps of:
s1: collecting first WIFI signals, clustering into first WIFI signatures, and forming a corresponding regional map database, wherein the first WIFI signals are collected WIFI signals of different regions in the visual SLAM mapping process, and the first WIFI signatures are clustered into WIFI signatures of different regions in the visual SLAM mapping process.
In the embodiment of the application, when the visual SLAM builds a map, the WIFI signals of different areas are collected firstly to form first WIFI signals, the formed first WIFI signals are clustered into corresponding first WIFI signatures, and the whole area is divided into different areas according to the difference of the first WIFI signatures, so that a corresponding area map database is formed. When the vision SLAM maps and collects WIFI signals, the robot or the mobile device can collect the WIFI signals in a mode of pausing for tens of seconds every several meters. In the moving process, the signal strength of each Access Point (AP) of the WIFI signal may change continuously, and there is an Access Point to be connected or disconnected continuously. Therefore, the formed area map database is a dynamic database and contains dynamic WIFI signatures of the whole area. By forming the area map database of the whole area, the approximate range of loop detection can be determined, and sufficient data resources are provided for subsequent data processing and analysis.
S2: and collecting second WIFI signals, and clustering into second WIFI signatures, wherein the second WIFI signals are the WIFI signals of the current region collected before loop detection, and the second WIFI signatures are the WIFI signatures of the current region clustered before loop detection.
In the embodiment of the application, before loop detection, the WIFI signals of the current area are collected to form second WIFI signals, and the second WIFI signals are clustered into the second WIFI signature. Through clustering into second WIFI signature can provide the matching basis for subsequent data processing, find out corresponding word bag fast to promote the degree of accuracy and the speed that the loopback detected by a wide margin.
S3: traversing the regional map database based on the second WIFI signature, and calculating similarity to obtain a bag with the highest similarity in the regional map database;
s4: performing the loop detection according to the bag of words.
In the embodiment of the application, before loop detection, the second WIFI signal is collected and clustered into the second WIFI signature, and the second WIFI signature is matched with the first WIFI signature in the regional map database. The specific matching mode is to calculate similarity, the similarity is the similarity of corresponding WIFI signatures, and the bag with the highest similarity in the regional map database can be obtained by calculating the similarity. The bag of words is the sum of the features of each image in a set of images. And finally, carrying out loop detection according to the word bag. By matching the first WIFI signature with the second WIFI signature, the occurrence of false loopback detection can be reduced, and therefore false positioning is reduced. Before loop detection is carried out, WIFI data are processed in advance, image data are processed again, the effect of coarse adjustment and fine adjustment can be achieved, the accuracy and the speed of loop detection are greatly improved, and the method has the remarkable advantages of accuracy, high efficiency and the like.
The hierarchical structure of the regional map database is as follows:
each regional map database comprises a plurality of regional maps, and each regional map is represented by a regional map WIFI signature;
each regional map comprises a plurality of word bags, and each word bag is represented by a word bag WIFI signature.
As shown in fig. 2, the hierarchical structure diagram of the area map databases of the present application is provided, each of the area map databases includes n area maps, where n is an integer greater than or equal to 0, and each of the area maps is represented by an area map WIFI signature. And each regional map also comprises i word bags, wherein i is an integer greater than or equal to 0, and each word bag is represented by a word bag WIFI signature. That is to say, each regional map database corresponds to n regional map WIFI signatures, and each regional map WIFI signature corresponds to i bag of words WIFI signatures. Through establishing regional map data base, can match the WIFI signal according to hierarchical division, when first WIFI signature and second WIFI signature match, can match according to the hierarchical structure relation of one-level to accelerate matching speed and accuracy, and then promote the degree of accuracy and the speed of loop detection by a wide margin.
The WIFI signature is represented by two values, BSSID and RSSI, to represent the corresponding WIFI signal.
In the embodiment of the application, when there are a large number of areas with repeated symmetrical structures in an indoor environment, such as corridors, rooms, etc., and meanwhile, there are a plurality of WIFI signals distributed indoors, a received signal strength indicator is assembled on a robot or a mobile device to receive each WIFI signal. According to the IEEE 802.11 standard, all WIFI Access Points (APs) constantly Signal their presence to inform potential clients of their presence, all clients calculate an RSSI (Received Signal Strength Indication) value for each Access Point (AP) that is visible, each Access Point (AP) has a BSSID (Basic Service Set Identifier) value that is unique to any WIFI Signal. On a robot or mobile device, BSSID values and RSSI values from multiple WIFI signal Access Points (APs) may be collected to form corresponding WIFI signatures. The robot or mobile device may receive different combinations of Access Points (APs) and RSSI values in different areas, the different Access Points (APs) are distinguished by BSSID values, and the WIFI signature received and formed at a certain location may be represented in the following form:
{
AP0(BSSID0):RSSI0
AP1(BSSID1):RSSI1
…
APk(BSSIDk):RSSIk
…
where k is an integer greater than or equal to 0.
The matching of the signals of the current region and the whole region can be realized by forming the WIFI signature, so that the corresponding word bag can be found quickly and accurately, loop detection is completed, and wrong positioning caused by wrong loop detection is avoided.
The similarity is the similarity of WIFI signatures and comprises BSSID similarity and RSSI similarity.
The calculation of the similarity comprises the following steps:
calculating and comparing the BSSID similarity and the RSSI similarity of the area map WIFI signature in the area map database so as to determine the area map, wherein the calculation formula of the BSSID similarity and the RSSI similarity of the area map WIFI signature is as follows:
BSSID similarity ═ ref · cur,
RSSI similarity is v · w/| v | | | w |;
calculating and comparing the RSSI similarity of the bag-of-words WIFI signature contained in the determined area map so as to determine the bag-of-words, wherein the RSSI similarity of the bag-of-words WIFI signature is calculated according to the following formula:
RSSI similarity is u ri/|u||ri|。
Fig. 3 is a flowchart of calculating the similarity according to the present application. In the embodiment of the application, similarity is calculated by matching the second WIFI signature of the current region with the first WIFI signature in the region map database, so as to obtain a bag of words with the highest similarity, and finally loop detection is performed according to the bag of words with the highest similarity. The similarity is the similarity of the WIFI signature, and comprises BSSID similarity and RSSI similarity. When the similarity is calculated, firstly, the area map is determined, namely, the similarity of the WIFI signature of the area map is calculated. And combining BSSID values of each area map WIFI signature and a second WIFI signature of the current area into a reference vector, respectively deriving an area map WIFI signature calculation vector ref and a second WIFI signature calculation vector cur of the current area in the area map database according to the presence or absence of the BSSID values, marking the BSSID values as 1 in the vectors when the BSSID values exist, and marking the BSSID values as 0 in the vectors when the BSSID values do not exist. Thus, the calculation formula for obtaining BSSID similarity is as follows:
BSSID similarity is ref · cur.
And when only one BSSID similarity value with a high value appears, determining the corresponding regional map as a target value. When a plurality of BSSID similarity values with high values appear, the RSSI similarity values are further compared, and the RSSI similarity value with the highest value is found out, so that the corresponding regional map is determined to be the target value. The calculation formula of the RSSI similarity is as follows:
RSSI similarity is v · w/| v | | w |,
v is a vector value composed of RSSI values in a local map WIFI signature in the local map database, and w is a vector value composed of RSSI values in the second WIFI signature of the current area.
After determining the area map, determining the areaAnd the bag with the highest RSSI similarity in the map. After the area map is determined, comparing the RSSI value in the second WIFI signature of the current area with the RSSI value in the bag-of-words WIFI signature corresponding to the bag-of-words contained in the determined area map, recording the RSSI value if the RSSI values are the same, and recording the RSSI value as 0 if the RSSI values are different, so that an RSSI vector u of the second WIFI signature of the current area is formed, and a vector r isiThen, the RSSI value in the bag-of-words WIFI signature corresponding to the bag of words in the determined area map is formed, so that the RSSI similarity calculation formula of the bag-of-words WIFI signature can be derived as follows:
RSSI similarity is u ri/|u||riWherein i is an integer greater than or equal to 0.
And finding out the bag of words with the highest RSSI similarity value by calculating the RSSI similarity of the bag of words, determining the bag of words as a final target value, and finally carrying out loop detection according to the found bag of words.
By calculating the similarity layer by layer according to the hierarchical structure relationship of the regional map database, the word bag can be quickly and accurately found for loop detection, the accuracy and the speed of loop detection are greatly improved, the calculation complexity and the processing time are reduced, timely and accurate positioning is carried out, and the method has the remarkable advantages of accuracy, high efficiency and the like.
Fig. 4 is a block diagram of a WIFI-based enhanced vision SLAM device of the present application. Referring to fig. 4, the apparatus includes:
the generating module 11 is configured to collect first WIFI signals, cluster the first WIFI signals into first WIFI signatures, and form a corresponding regional map database, where the first WIFI signals are WIFI signals of different regions collected in a visual SLAM mapping process, and the first WIFI signatures are clustered WIFI signatures of different regions in the visual SLAM mapping process.
In the embodiment of the application, the general range of loop detection can be determined by forming the region map database of the whole region, so that sufficient data resources are provided for subsequent data processing and analysis.
The clustering module 12 is configured to collect second WIFI signals, and cluster the second WIFI signals into second WIFI signatures, where the second WIFI signals are the WIFI signals collected in the current area before loopback detection, and the second WIFI signatures are the WIFI signatures clustered into the current area before loopback detection.
In this application embodiment, through clustering into the second WIFI signature, can provide the matching basis for subsequent data processing, find out corresponding word bag fast to promote the degree of accuracy and the speed that the loopback detected by a wide margin.
The traversal module 13 is configured to traverse the regional map database based on the second WIFI signature, calculate a similarity, and obtain a bag of words with the highest similarity in the regional map database;
a detection module 14, configured to perform the loop detection according to the bag of words.
In the embodiment of the application, the first WIFI signature and the second WIFI signature are matched, so that the occurrence of error loopback detection can be reduced, and therefore the error positioning is reduced. Before loop detection is carried out, WIFI data are processed in advance, image data are processed again, the effect of coarse adjustment and fine adjustment can be achieved, the accuracy and the speed of loop detection are greatly improved, and the method has the remarkable advantages of accuracy, high efficiency and the like.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.