Disclosure of Invention
The invention aims to provide an SLAM system which solves the defects in the prior art.
A SLAM system, comprising: the system comprises a current key frame information extraction module, a current key frame information storage importance coefficient calculation module and a key frame set level information storage importance coefficient calculation and storage module; a key frame set level information calculating and storing module;
the current key frame information storage importance coefficient calculation module is connected with the key frame set level information storage importance coefficient calculation and storage module;
the current key frame information extraction module and the key frame set level information storage importance coefficient calculation and storage module are respectively connected with the key frame set level information calculation and storage module;
the current key frame information extraction module is used for extracting information of different levels from a current key frame image;
the current key frame information storage importance coefficient calculation module is used for calculating storage importance coefficients of different levels of information of the current key frame;
the key frame set level information storage importance coefficient calculation and storage module is used for storing the storage importance coefficients of different level information of the current key frame set;
the key frame set level information calculation and storage module is used for determining a storage mode for extracting information of different levels from the current key frame image transmitted by the current key frame information extraction module.
Further, the SLAM system further includes: the system comprises an information level sequence establishing module and an information level memory space establishing module;
the information level sequence establishing module and the information level memory space establishing module are respectively connected with the current key frame information extracting module; the information level sequence establishing module and the information level storage capacity establishing module are respectively connected with the current key frame information storage importance coefficient calculating module.
Further, the information hierarchy sequence establishing module is configured to establish an information hierarchy sequence of a key frame set, and is configured to instruct the current key frame information extracting module to extract information of a current key frame image, and is a carrier operated in step S100; the information level storage quantity establishing module is used for establishing different level information storage spaces of the key frame set, and is a carrier operated in step S200.
A SLAM method, characterized by:
abstracting and expressing images received by machine vision into different levels of information;
the higher the information individual storage amount, the higher the information individual storage amount of the lower layer (i.e., X)j,βThe storage space occupied by a single is less than Xj+1,βA single occupied storage space);
the higher the information number of the layer, the more; the lower the layer, the less the information number (i.e., Q described below)j>Qj+1)。
A SLAM method comprising the steps of:
s100, establishing an information hierarchy sequence of the key frames:
the information hierarchy sequence of the key frame is expressed as follows according to the descending order of the hierarchy level by level: level 1 information, level 2 information, level j information … … …, level k information:
s200, determining the storage capacity of each information level of the key frame:
the storage amount of the 1 st level information is Q1The storage amount of the 2 nd level information is Q2… … … … the storage capacity of the j level information is Qj… … … … the k-th level information has a storage capacity of Qk:
For Q1~QkFor example, there are: q1>Q2>……Qj-1>Qj>……Qk;
S300, the current key frame is the Yth key frame, and the information of layers 1 to k is extracted from the Yth key frame: x1,Y、X2,Y、……Xj,Y、……Xk,Y(ii) a And simultaneously calculating the storage importance coefficients of the information of the 1 st to k th layers extracted from the Yth key frame: z1,Y、Z2,Y、……Zj,Y、……Zk,Y;
X1,Y、X2,Y、……Xj,Y、……Xk,YRespectively represent: level 1 information of the Yth key frame, the Yth key frame… … th level information of the Y-th key frame, … … th level information of the Y-th key frame;
Z1,Y、Z2,Y、……Zj,Y、……Zk,Yrespectively represent: a storage importance coefficient of level 1 information of a Y-th key frame, a storage importance coefficient of level 2 information of the Y-th key frame, a storage importance coefficient of a j-th level information of … … the Y-th key frame, a storage importance coefficient of a k-th level information of … … the Y-th key frame;
s400, the storage importance coefficients of the information of the 1 st to k th layers extracted from the current Y-th key frame are: z1,Y、Z2,Y、……Zj,Y、……Zk,YAdding the importance parameter into a storage importance coefficient matrix of the current key frame level information (all the storage importance parameters of the extracted 1 st-k level information of the Y-th key frame are stored into the storage importance coefficient matrix of the current key frame level information);
S500,
extracting the information of the 1 st to k th layers from the current Y-th key frame: x1,Y、X2,Y、……Xj,Y、……Xk,Y,Adding the key frame level information into a current key frame level information matrix:
when 0 is present<Y≤QkWhen the current key frame set is selected, all the extracted 1 st-k level information of the Y key frame is stored into the current key frame set;
the above steps are expressed as follows:
Xj,Iexpressing j level information of the I key frame;
when Q isj<Y≤Qj-1When j represents any natural number from 2 to k;
storing all the level information from level 1 to level j-1 of the Y key frame into the current key frame set, wherein the steps are expressed by adopting the following formula:
for j-th to k-th level information of the Y-th key frame, calculating layer by layer, and determining whether to store:
for any of the j-th to k-th layers:
first, from Zβ,1,Zβ,2……Zβ,I……Zβ,Y-1Finding the minimum value, which takes Zβ,mThe information storage importance parameter of the mth key frame beta level is minimum;
secondly, according to Zβ,m、Zβ,YDetermines whether to store the beta level information X of the Y-th key frameβ,Y:
When Z isβ,m>Zβ,Y
Then Zβ,YGiven a new value such that Zβ,YNo longer participate in the ranking;
Xβ,Ygiving a new value of NULL or 0, namely not storing the beta level information of the Yth key frame;
when Z isβ,m≤Zβ,Y
Then Zβ,mGiven a new value such that Zβ,mNo longer participate in the ranking;
Xβ,massigning a new value of NULL or 0, i.e., deleting the beta level information of the mth key frame and adding the beta level information X of the Yth key frameβ,YStoring, namely, the storage space of the beta level information of the mth key frame is reserved to the storage space of the beta level information of the Yth key frame, namely, the storage space of the beta level information is always kept at Qβ;
When Q is1<When Y is in the range of:
for the level 1-k information of the Y key frame, calculating layer by layer, and determining whether to store:
for any of the 1 st to k th layers,
first, from Zβ,1,Zβ,2……Zβ,I……Zβ,Y-1Finding the minimum value, which takes Zβ,mThe information storage importance parameter of the mth key frame beta level is minimum;
secondly, according to Zβ,m、Zβ,YDetermines whether to store the beta level information X of the Y-th key frameβ,Y:
When Z isβ,m>Zβ,Y
Then Zβ,YGiven a new value such that Zβ,YNo longer participate in the ranking;
Xβ,Ygiving a new value of NULL or 0, namely not storing the beta level information of the Yth key frame;
when Z isβ,m≤Zβ,Y
Then Zβ,mGiven a new value such that Zβ,mNo longer participate in the ranking;
Xβ,massigning a new value of NULL or 0, i.e., deleting the beta level information of the mth key frame and adding the beta level information X of the Yth key frameβ,YStoring, namely, the storage space of the beta level information of the mth key frame is reserved to the storage space of the beta level information of the Yth key frame, namely, the storage space of the beta level information is always kept at Qβ。
Further, "when Z" in step S500β,m>Zβ,Y,Zβ,YNew values are assigned ", NULL or + ∞.
Further, in step S100, k is not less than 4.
The invention has the beneficial effects that:
first, the basic idea of the present application is: abstracting and expressing information received by machine vision at different semantic levels, and coding the information from the information level; the higher the semantic feature of the higher layer, the more simplified the information quantity stored, the higher the extraction frequency, the longer the time stored in the SLAM system; conversely, the lower the level of the point cloud feature, the larger the amount of data stored, the lower the frequency of extraction, and the shorter the time for storage in the SLAM system. By setting different storage and retrieval index configurations, the performance and the efficiency of freely allocating storage/retrieval and long-time large-scale SLAM loop detection are achieved.
Secondly, based on the basic concept of the application, a method for storing the SLAM key frame matrix is provided: the storage is determined by means of a double coefficient, namely: and storing the importance coefficient matrix and the current key frame level information matrix to jointly determine how the newly acquired 1 st-k level information of the Y-th key frame is stored into the current key frame level information matrix.
Detailed Description
A SLAM method comprising the steps of:
s100, establishing an information hierarchy sequence of the key frames:
the information hierarchy sequence of the key frame is expressed as follows according to the descending order of the hierarchy level by level: level 1 information, level 2 information, level j information … … …, level k information:
s200, determining the storage capacity of each information level of the key frame:
the storage amount of the 1 st level information is Q1The storage amount of the 2 nd level information is Q2… … … … the storage capacity of the j level information is Qj… … … … the k-th level information has a storage capacity of Qk:
For Q1~QkFor example, there are: q1>Q2>……Qj-1>Qj>……Qk;
S300, the current key frame is the Yth key frame, and the information of layers 1 to k is extracted from the Yth key frame: x1,Y、X2,Y、……Xj,Y、……Xk,Y(ii) a Computing the Y-th key frame extraction at the same timeTaking the storage importance coefficients of the information of the 1 st to k th layers: z1,Y、Z2,Y、……Zj,Y、……Zk,Y;
X1,Y、X2,Y、……Xj,Y、……Xk,YRespectively represent: level 1 information of the Y-th key frame, level 2 information of the Y-th key frame, … … level j information of the Y-th key frame, … … level k information of the Y-th key frame;
Z1,Y、Z2,Y、……Zj,Y、……Zk,Yrespectively represent: a storage importance coefficient of level 1 information of a Y-th key frame, a storage importance coefficient of level 2 information of the Y-th key frame, a storage importance coefficient of a j-th level information of … … the Y-th key frame, a storage importance coefficient of a k-th level information of … … the Y-th key frame;
s400, the storage importance coefficients of the information of the 1 st to k th layers extracted from the current Y-th key frame are: z1,Y、Z2,Y、……Zj,Y、……Zk,YAdding the importance parameter into a storage importance parameter set (namely, adding the importance parameter set into a storage importance coefficient matrix of the hierarchy information of the current key frame) of the current key frame (at the moment, the corresponding current key frame has 1 st to Y-1 st key frames):
all storage importance parameters of the extracted 1 st-k level information of the Y-th key frame are stored into a storage importance coefficient matrix of the current key frame level information;
the above steps can be expressed as follows:
S500,
extracting the information of the 1 st to k th layers from the current Y-th key frame: x1,Y、X2,Y、……Xj,Y、……Xk,Y,Add to the current key frame set (i.e., to the current key frame level information matrix):
kwhen 0 is present<When Y is less than or equal to QStoring all the extracted 1 st-k level information of the Y-th key frame into the current key frame set;
the above steps can be expressed as follows:
Xj,Iinformation of j level expressing the I key frame (the meaning of other expressions can be known from it, for example, Xk,YK-th level information expressed as the Y-th key frame).
k k-1When Q is<When Y is less than or equal to QAnd storing all the level information from level 1 to level k-1 of the Y-th key frame into the current key frame set, wherein the steps can be expressed as follows:
for the kth layer information of the Y-th key frame:
first, from Zk,1,Zk,2……Zk,I……Zk,Y-1Finding the minimum value, which takes Zk,mThe information storage importance parameter of the kth level of the mth key frame is minimum;
secondly, according to Zk,m、Zk,YDetermines whether to store the kth level information X of the Yth key framek,Y:
When Z isk,m>Zk,Y
Then Zk,YAssigning a new value (e.g., NULL or + ∞) (so that Zk,YNo longer participating in the ranking);
Xk,Ygiving a new value of NULL or 0, namely not storing the kth level information of the Yth key frame;
when Z isk,m≤Zk,Y
Then Zk,mA new value is given to the value of,so that Z isk,mNo longer participate in the ranking;
Xk,massigning a new value of NULL or 0, i.e. removing the kth level information of the mth key frame and adding the kth level information X of the Yth key framek,YStoring, namely, the storage space of the k-level information of the mth key frame is saved to the storage space of the k-level information of the Yth key frame (namely, the storage amount of the k-level information is always kept at Qk)。
……
j j-1When Q is<When Y is less than or equal to QAnd storing all the level information from level 1 to level j-1 of the Y-th key frame into the current key frame set, wherein the steps can be expressed as follows:
for the j-th to k-th level (it should be noted that j in this application represents any natural number between [1, k ] rather than k-1, i.e. the order of j, k in english does not represent the distance between the two) information of the Y-th key frame, the calculation is performed layer by layer to determine whether to store:
for the jth level information of the yth key frame:
first, from Zj,1,Zj,2……Zj,I……Zj,Y-1Finding the minimum value, which takes Zj,mThe j level information storage importance parameter of the mth key frame is minimum;
secondly, according to Zj,m、Zj,YDetermines whether to store the j level information X of the Y key framej,Y:
When Z isj,m>Zj,Y
Then Zj,YAssigning a new value (e.g., NULL or + ∞) such that Zj,YNo longer participate in the ranking;
Xj,Ygiving a new value of NULL or 0, namely not storing the j level information of the Y key frame;
when Z isj,m≤Zj,Y
Then Zj,mGiven a new value such that Zj,mNo longer participate in the ranking;
Xj,massigning a new value of NULL or 0, i.e. deleting the j level information of the mth key frame and adding the j level information X of the Yth key framej,YStoring, namely, the storage space of the j level information of the mth key frame is made to be equal to the storage space of the j level information of the Yth key frame (namely, the storage amount of the j level information is always kept at Qj)。
For the j +1 th level information of the Y-th key frame:
first, from Zj+1,1,Zj+1,2……Zj+1,I……Zj+1,Y-1Finding the minimum value, which takes Zj+1,mThe j +1 th level information storage importance parameter of the mth key frame is minimum;
secondly, according to Zj+1,m、Zj+1,YDetermines whether to store the j +1 th level information X of the Yth key framej+1,Y:
When Z isj+1,m>Zj+1,Y
Then Zj+1,YAssigning a new value (e.g., NULL or + ∞) such that Zj+1,YNo longer participate in the ranking;
Xj+1,Ygiving a new value of NULL or 0, namely not storing the j +1 level information of the Yth key frame;
when Z isj+1,m≤Zj+1,Y
Then Zj+1,mGiven a new value such that Zj+1,mNo longer participate in the ranking;
Xj+1,massigning a new value of NULL or 0, i.e. removing the j +1 level information of the mth key frame and deleting the j +1 level information X of the Yth key framej+1,YStoring, namely, the storage space of the j +1 level information of the mth key frame is made to be equal to the storage space of the j +1 level information of the Yth key frame (namely, the storage amount of the j +1 level information is always kept at Qj+1)。
………
For the kth layer information of the Y-th key frame:
first, from Zk,1,Zk,2……Zk,I……Zk,Y-1Finding the minimum value, which takes Zk,mThe information storage importance parameter of the kth level of the mth key frame is minimum;
secondly, according to Zk,m、Zk,YDetermines whether to store the kth level information X of the Yth key framek,Y:
When Z isk,m>Zk,Y
Then Zk,YAssigning a new value (e.g., NULL or + ∞) (so that Zk,YNo longer participating in the ranking);
Xk,Ygiving a new value of NULL or 0, namely not storing the kth level information of the Yth key frame;
when Z isk,m≤Zk,Y
Then Zk,mGiven a new value such that Zk,mNo longer participate in the ranking;
Xk,massigning a new value of NULL or 0, i.e. removing the kth level information of the mth key frame and adding the kth level information X of the Yth key framek,YStoring, namely, the storage space of the k-level information of the mth key frame is saved to the storage space of the k-level information of the Yth key frame (namely, the storage amount of the k-level information is always kept at Qk)。
……
2 1When Q is<When Y is less than or equal to Q,
Storing all the level 1 information of the Y-th key frame into the current key frame set, wherein the steps can be expressed as follows:
|X1,1X1,2......X1,I......X1,Y-1|—>|X1,1X1,2......X1,I......X1,Y-1X1,Y|
for the 2 nd to k th level information of the Y-th key frame, calculating layer by layer, and determining whether to store:
for the level 2 information of the Y-th key frame:
first, from Z2,1,Z2,2……Z2,I……Z2,Y-1Finding the minimum value, which takes Z2,mTo indicate that the storage importance parameter of the mth key frame level 2 information is minimum;
secondly, according to Z2,m、Z2,YDetermines whether to store the 2 nd level information X of the Yth key frame2,Y:
When Z is2,m>Z2,Y
Then Z2,YAssigning a new value (e.g., NULL or + ∞) such that Z2,YNo longer participate in the ranking;
X2,Ygiving a new value of NULL or 0, namely not storing the 2 nd level information of the Yth key frame;
when Z is2,m≤Z2,Y
Then Z2,mGiven a new value such that Z2,mNo longer participate in the ranking;
X2,massigning a new value of NULL or 0, i.e., deleting the 2 nd level information of the mth key frame and deleting the 2 nd level information X of the Yth key frame2,YStoring, namely, the storage space of the 2 nd level information of the mth key frame is saved to the storage space of the 2 nd level information of the Yth key frame (namely, the storage amount of the 2 nd level information is always kept at Q2)。
For the level 3 information of the Yth key frame:
first, from Z3,1,Z3,2……Z3,I……Z3,Y-1Finding the minimum value, which takes Z3,mTo indicate that the 3 rd level information storage importance parameter of the mth key frame is minimum;
secondly, according to Z3,m、Z3,YDetermines whether to store the 3 rd level information X of the Yth key frame3,Y:
When Z is3,m>Z3,Y
Then Z3,YGiven a new value (e.g. N)ULL or + ∞) such that Z3,YNo longer participate in the ranking;
X3,Ygiving a new value of NULL or 0, namely not storing the 3 rd level information of the Yth key frame;
when Z is3,m≤Z3,Y
Then Z3,mGiven a new value such that Z3,mNo longer participate in the ranking;
X3,massigning a new value of NULL or 0, i.e., removing the 3 rd level information of the mth key frame and adding the 3 rd level information X of the yth key frame3,YStoring, namely, the storage space of the 3 rd level information of the mth key frame is saved to the 3 rd level information storage space of the Yth key frame (namely, the storage space of the 3 rd level information is always kept at Q3)。
………
For the kth layer information of the Y-th key frame:
first, from Zk,1,Zk,2……Zk,I……Zk,Y-1Finding the minimum value, which takes Zk,mThe information storage importance parameter of the kth level of the mth key frame is minimum;
secondly, according to Zk,m、Zk,YDetermines whether to store the kth level information X of the Yth key framek,Y:
When Z isk,m>Zk,Y
Then Zk,YAssigning a new value (e.g., NULL or + ∞) (so that Zk,YNo longer participating in the ranking);
Xk,Ygiving a new value of NULL or 0, namely not storing the kth level information of the Yth key frame;
when Z isk,m≤Zk,Y
Then Zk,mGiven a new value such that Zk,mNo longer participate in the ranking;
Xk,massigning a new value of NULL or 0, i.e. removing the kth level information of the mth key frame and adding the kth level information X of the Yth key framek,YStoring, i.e. the mth key frameThe storage space of k-level information is allowed to be the k-level information storage space of the Y-th key frame (namely, the storage amount of the k-level information is always kept at Qk)。
1When Q is<At Y time:
For the level 1-k information of the Y key frame, calculating layer by layer, and determining whether to store:
for level 1 information of the Y-th key frame:
first, from Z1,1,Z1,2……Z1,I……Z1,Y-1Finding the minimum value, which takes Z1,mThe 1 st level information storage importance parameter of the mth key frame is minimum;
secondly, according to Z1,m、Z1,YDetermines whether to store the level 1 information X of the Yth key frame1,Y:
When Z is1,m>Z1,Y
Then Z1,YAssigning a new value (e.g., NULL or + ∞) such that Z1,YNo longer participate in the ranking;
X1,Ygiving a new value of NULL or 0, namely not storing the level 1 information of the Yth key frame;
when Z is1,m≤Z1,Y
Then Z1,mGiven a new value such that Z1,mNo longer participate in the ranking;
X1,massigning a new value of NULL or 0, i.e. deleting the level 1 information of the mth key frame and deleting the level 1 information X of the Yth key frame1,YStoring, namely, the storage space of the 1 st level information of the mth key frame is saved to the 1 st level information storage space of the Yth key frame (namely, the storage amount of the 1 st level information is always kept at Q1)。
For the level 2 information of the Y-th key frame:
first, from Z2,1,Z2,2……Z2,I……Z2,Y-1Finding the minimum value, which takes Z2,mTo represent, i.e. the mth key frameThe 2 nd level information storage importance parameter is minimum;
secondly, according to Z2,m、Z2,YDetermines whether to store the 2 nd level information X of the Yth key frame2,Y:
When Z is2,m>Z2,Y
Then Z2,YAssigning a new value (e.g., NULL or + ∞) such that Z2,YNo longer participate in the ranking;
X2,Ygiving a new value of NULL or 0, namely not storing the 2 nd level information of the Yth key frame;
when Z is2,m≤Z2,Y
Then Z2,mGiven a new value such that Z2,mNo longer participate in the ranking;
X2,massigning a new value of NULL or 0, i.e., deleting the 2 nd level information of the mth key frame and deleting the 2 nd level information X of the Yth key frame2,YStoring, namely, the storage space of the 2 nd level information of the mth key frame is saved to the storage space of the 2 nd level information of the Yth key frame (namely, the storage amount of the 2 nd level information is always kept at Q2)。
For the level 3 information of the Yth key frame:
first, from Z3,1,Z3,2……Z3,I……Z3,Y-1Finding the minimum value, which takes Z3,mTo indicate that the 3 rd level information storage importance parameter of the mth key frame is minimum;
secondly, according to Z3,m、Z3,YDetermines whether to store the 3 rd level information X of the Yth key frame3,Y:
When Z is3,m>Z3,Y
Then Z3,YAssigning a new value (e.g., NULL or + ∞) such that Z3,YNo longer participate in the ranking;
X3,Ygiving a new value of NULL or 0, namely not storing the 3 rd level information of the Yth key frame;
when Z is3,m≤Z3,Y
Then Z3,mGiven a new value such that Z3,mNo longer participate in the ranking;
X3,massigning a new value of NULL or 0, i.e., removing the 3 rd level information of the mth key frame and adding the 3 rd level information X of the yth key frame3,YStoring, namely, the storage space of the 3 rd level information of the mth key frame is saved to the 3 rd level information storage space of the Yth key frame (namely, the storage space of the 3 rd level information is always kept at Q3)。
………
For the kth layer information of the Y-th key frame:
first, from Zk,1,Zk,2……Zk,I……Zk,Y-1Finding the minimum value, which takes Zk,mThe information storage importance parameter of the kth level of the mth key frame is minimum;
secondly, according to Zk,m、Zk,YDetermines whether to store the kth level information X of the Yth key framek,Y:
When Z isk,m>Zk,Y
Then Zk,YAssigning a new value (e.g., NULL or + ∞) (so that Zk,YNo longer participating in the ranking);
Xk,Ygiving a new value of NULL or 0, namely not storing the kth level information of the Yth key frame;
when Z isk,m≤Zk,Y
Then Zk,mGiven a new value such that Zk,mNo longer participate in the ranking;
Xk,massigning a new value of NULL or 0, i.e. removing the kth level information of the mth key frame and adding the kth level information X of the Yth key framek,YStoring, namely, the storage space of the k-level information of the mth key frame is saved to the storage space of the k-level information of the Yth key frame (namely, the storage amount of the k-level information is always kept at Qk)。
A SLAM system, comprising: the system comprises an information level sequence establishing module, an information level memory space establishing module, a current key frame information extracting module, a current key frame information storage importance coefficient calculating module and a key frame set level information storage importance coefficient calculating and storing module; a key frame set level information calculating and storing module;
the information level sequence establishing module and the information level memory space establishing module are respectively connected with the current key frame information extracting module;
the information level sequence establishing module and the information level storage capacity establishing module are respectively connected with the current key frame information storage importance coefficient calculating module;
the current key frame information storage importance coefficient calculation module is connected with the key frame set level information storage importance coefficient calculation and storage module;
the current key frame information extraction module and the key frame set level information storage importance coefficient calculation and storage module are respectively connected with the key frame set level information calculation and storage module;
the information level sequence establishing module is used for establishing an information level sequence of a key frame set and guiding the current key frame information extracting module to extract information of a current key frame image, and is a carrier operated in the step S100;
the information level storage quantity establishing module is used for establishing different level information storage spaces of the key frame set and is a carrier operated in the step S200;
the current key frame information extraction module is used for extracting information of different levels from the current key frame image, and is a carrier operated in the step S300;
the current key frame information storage importance coefficient calculation module is used for calculating storage importance coefficients of different levels of information of the current key frame;
the key frame set level information storage importance coefficient calculation and storage module is used for storing the storage importance coefficients of different level information of the current key frame set;
the key frame set level information calculation and storage module is used for determining a storage mode (namely determining whether the key frame set level information is stored) for extracting information of different levels from the current key frame image transmitted by the current key frame information extraction module.
It should be noted that: the information level sequence establishing module and the information level storage capacity establishing module are not necessary technical features, that is, the S100 and the S200 are not necessarily set by the two modules, and a designer can directly set related parameters in the software system.
The first embodiment is as follows: as shown in fig. 1, in a SLAM method, information of a key frame set is processed hierarchically; the method comprises the following steps:
s100, establishing an information level sequence of the key frame set:
level 1 information, namely a characteristic word set (namely a BOW model) of a scene;
level 2 information: spatial relationship expression of spatial entities;
level 3 information: point/line/surface features;
level 4 information: dense point cloud features.
S200, establishing the storage priority of the information of the key frame set according to the information level sequence established in the step S100: the storage amount of the information level of the hierarchy is larger than that of the information level of the hierarchy, and the storage time of the information level of the hierarchy is longer than that of the information level of the hierarchy.
Specifically, S200 is to determine the storage capacity of the 1 st to 4 th information levels of the key frame:
the storage amount of the 1 st level information is Q1The amount of storage of the 2 nd level information is Q50000240000, the amount of storage of the 3 rd level information is Q310000, the storage amount of the 4 th hierarchy information is Q4=700:
S300, the current key frame is the Y-th key frame, as shown in fig. 1: extracting information of layers 1-4 from the Yth key frame: x1,Y、X2,Y、X3,Y、Xk,Y;
And simultaneously calculating the storage importance coefficients of the information of the 1 st to k th layers extracted from the Yth key frame: z1,Y、Z2,Y、Z3,Y、Zk,Y(ii) a The calculation principle of the storage importance coefficient can be specifically determined and adjusted by a system designer according to actual requirements and environments. For example: i am giving the machine in an indoor simulated environment a design of: the storage importance coefficient of the crossroad is positioned by 1.0, the storage importance coefficient of the T-shaped crossroad is positioned by 0.8, and the storage importance coefficient of the middle of the road is positioned by 0.5.
X1,Y、X2,Y、X3,Y、X4,YRespectively represent: level 1 information of a Y-th key frame, level 2 information of the Y-th key frame, level 3 information of the Y-th key frame, and level 4 information of the Y-th key frame;
Z1,Y、Z2,Y、Z3,Y、Z4,Yrespectively represent: the storage importance coefficient of the 1 st level information of the Y-th key frame, the storage importance coefficient of the 2 nd level information of the Y-th key frame, the storage importance coefficient of the 3 rd level information of the Y-th key frame and the storage importance coefficient of the 4 th level information of the Y-th key frame;
s400, the storage importance coefficient of the information of the 1 st to 4 th layers extracted from the current Y-th key frame is: z1,Y、Z2,Y、Z3,Y、Z4,YAdding the importance coefficient into a storage importance coefficient matrix of the current key frame level information:
all storage importance parameters of the extracted 1 st-4 th-level information of the Y-th key frame are stored into a storage importance coefficient matrix of the current key frame level information;
the above steps can be expressed as follows:
s500, extracting the information of the 1 st to 4 th layers from the current Y-th key frame: x1,Y、X2,Y、X3,Y、X4,Y,Adding the key frame into a current key frame level information matrix:
extracting the information of the 1 st to 4 th layers of the current Y-th key frame: x1,Y、X2,Y、X3,Y、X4,Y,Adding the key frame level information into a current key frame level information matrix:
4when 0 is present<When Y is less than or equal to QStoring all the extracted 1 st-4 th-level information of the Y-th key frame into a current key frame set;
the above steps can be expressed as follows:
j j-1when Q is<When Y is less than or equal to QAnd storing all the level information from level 1 to level j-1 of the Y-th key frame into the current key frame set, wherein the steps can be expressed as follows:
for the j-th to 4-th level information of the Y-th key frame, calculating layer by layer, and determining whether to store:
for any of the jth to 4 th layers,
first, from Zβ,1,Zβ,2……Zβ,I……Zβ,Y-1Finding the minimum value, which takes Zβ,mThe information storage importance parameter of the mth key frame beta level is minimum;
secondly, according to Zβ,m、Zβ,YDetermines whether to store the beta level information X of the Y-th key frameβ,Y:
When Z isβ,m>Zβ,Y
Then Zβ,YAssigning a new value (e.g., NULL or + ∞) such that Zβ,YNo longer participate in the ranking;
Xβ,Ygiving a new value of NULL or 0, namely not storing the beta level information of the Yth key frame;
when Z isβ,m≤Zβ,Y
Then Zβ,mGiven a new value such that Zβ,mNo longer participate in the ranking;
Xβ,massigning a new value of NULL or 0, i.e., deleting the beta level information of the mth key frame and adding the beta level information X of the Yth key frameβ,YStoring, namely, the storage space of the beta level information of the mth key frame is saved to the storage space of the beta level information of the Yth key frame (namely, the storage space of the beta level information is always kept at Qβ)。
1When Q is<At Y time:
For the level 1-4 information of the Y key frame, calculating layer by layer, and determining whether to store:
for any beta-th layer of the 1 st to 4 th layers,
first, from Zβ,1,Zβ,2……Zβ,I……Zβ,Y-1Finding the minimum value, which takes Zβ,mThe information storage importance parameter of the mth key frame beta level is minimum;
secondly, according to Zβ,m、Zβ,YDetermines whether to store the beta level information X of the Y-th key frameβ,Y:
When Z isβ,m>Zβ,Y
Then Zβ,YAssigning a new value (e.g., NULL or + ∞) such that Zβ,YNo longer participate in the ranking;
Xβ,Ygiving a new value of NULL or 0, namely not storing the beta level information of the Yth key frame;
when Z isβ,m≤Zβ,Y
Then Zβ,mGiven a new value such that Zβ,mNo longer participate in the ranking;
Xβ,massigning a new value of NULL or 0, i.e., deleting the beta level information of the mth key frame and adding the beta level information X of the Yth key frameβ,YStoring, i.e. of the mth key frameThe storage space of the beta level information is allowed to be equal to the storage space of the beta level information of the Y key frame (namely, the storage space of the beta level information is always kept at Qβ)。
It should be noted that, according to the first embodiment: for any I key frame j layer information Xj,IThe value is not limited to be a numerical value, that is, it may be a character set, for example, as in the first embodiment: x1,IIs the BOW model data, and may also be a data set, for example: the first embodiment is as follows: x4,IIs a dense point cloud data set.
The above-mentioned embodiments are only for convenience of description, and are not intended to limit the present invention in any way, and those skilled in the art will understand that the technical features of the present invention can be modified or changed by other equivalent embodiments without departing from the scope of the present invention.