A closed-loop detection method and system for simultaneous positioning and mapping of robot vision
By optimizing the key frame selection strategy and using convolutional neural networks to extract visual features, combined with closed-loop verification, the problem of insufficient reflection of environmental information and illumination effects in closed-loop detection during visual simultaneous positioning and mapping has been solved, significantly improving the accuracy of closed-loop detection. and stability.
Patent Information
- Application Number
- CN202011412362.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-04
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-12-04
AI Technical Summary
In the existing technology, the closed-loop detection method that uses simultaneous visual positioning and mapping has a simple key frame selection strategy and cannot effectively reflect environmental information. Moreover, traditional visual features are easily affected by environmental factors such as lighting, resulting in low closed-loop detection accuracy and robustness. .
Use a better key frame selection strategy and convolutional neural network to extract visual features, combined with the closed-loop verification strategy, by setting the key frame selection interval, the difference threshold in the number of adjacent key frame feature points and the closed-loop discrimination threshold, using pre-trained convolutions The neural network model extracts visual features to form feature vectors, and ensures the accuracy of closed-loop detection through similarity calculation and verification.
It improves the accuracy and stability of closed-loop detection, can better reflect environmental information, reduce the impact of environmental factors such as lighting, and reduce the occurrence of false closed loops.
Smart Images

Figure CN112509045B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of robot visual positioning and mapping, and in particular relates to a closed-loop detection method and system for simultaneous visual positioning and mapping that can improve mapping accuracy. Background Art
[0002] As a key technology for autonomous robot navigation, simultaneous visual localization and mapping has been widely used in fields such as autonomous driving and sweeping robots. Closed-loop detection is an important component of simultaneous visual localization and mapping, which is used to eliminate cumulative errors and improve mapping accuracy. Domestic and foreign researchers have proposed many different closed-loop detection methods. Most of these methods are based on the bag-of-words model, which uses artificially designed visual features as the basis for discrimination and uses feature matching to complete closed-loop detection. This method has two problems: (1) The key frame selection strategy is too simple. Usually, a frame is selected as a key frame at intervals. When the camera moves too fast, the key frame selected by this strategy cannot reflect the environmental information well. (2) Traditional artificially designed visual features are easily affected by environmental factors such as lighting, resulting in incorrect closed-loop detection results. Summary of the invention
[0003] The present invention discloses a closed-loop detection method and system for simultaneous positioning and mapping by robot vision, so as to solve the technical problems in the prior art of low ability to reflect environmental information, high influence of environmental factors such as illumination during feature extraction, and low accuracy and robustness of closed-loop detection.
[0004] The present invention provides a closed-loop detection method for simultaneous positioning and mapping of robot vision, and the specific steps are as follows:
[0005] Step 1: Set initial parameters: set the key frame selection interval, set the threshold for the difference in the number of feature points of adjacent key frames, the closed-loop discrimination threshold, and the number of image frame acquisitions, where the number of image frame acquisitions is an integer starting from zero;
[0006] Step 2: Obtain an image sequence of the external environment, obtain image frames in the image sequence one by one, and process the current image frame by executing steps 3-5;
[0007] Step 3: The number of image frame acquisitions is incremented once, and the pre-trained convolutional neural network model is used to extract the visual features of the current image frame to form a feature vector;
[0008] Calculate the difference between the number of visual features of the current image frame and the number of visual features of the last key frame in the key frame sequence;
[0009] Step 4: When the difference value obtained in step 3 is greater than or equal to the threshold value of the difference in the number of feature points of adjacent key frames, execute step 5;
[0010] When the difference value obtained in step 3 is less than the threshold value of the difference in the number of feature points of adjacent key frames, the processing of the current image frame is terminated;
[0011] When the difference value obtained in step 3 is greater than or equal to the difference threshold of the number of feature points of adjacent key frames, and the number of image frame acquisitions is greater than or equal to the key frame selection interval, execute step 5;
[0012] When the difference value obtained in step 3 is greater than or equal to the difference threshold of the number of feature points of adjacent key frames, and the number of image frame acquisitions is less than the key frame selection interval, the processing of the current image frame is terminated;
[0013] Step 5: reset the number of image frame acquisitions, insert the current image frame into the key frame sequence, traverse the key frame sequence in reverse order, and use the feature vector of the current image frame and the feature vector of the current key frame to calculate the similarity between the current image frame and the current key frame;
[0014] When the similarity is less than the closed-loop discrimination threshold, the processing of the current image frame is terminated;
[0015] When the similarity is greater than or equal to the closed-loop discrimination threshold, it is determined to send a closed loop, the traversal of the current image frame sequence is ended, and the closed-loop detection of the currently acquired external environment image is completed.
[0016] Furthermore, the value range of the key frame selection interval is: 15-30; the value range of the threshold of the difference in the number of feature points of adjacent key frames is 25-40; and the value range of the closed-loop discrimination threshold is 05-075.
[0017] Furthermore, the value of the key frame selection interval is: 20; the value of the threshold value of the difference in the number of feature points of adjacent key frames is 30; and the value of the closed-loop discrimination threshold is 0.7.
[0018] Furthermore, in step 5, the specific formula for calculating the similarity between the current image frame and the current key frame using the feature vector of the current image frame and the feature vector of the current key frame is as follows:
[0019]
[0020] Among them, a and b are the current image frame and the current key frame respectively; V a 、V b is the feature vector; Sim(a,b) is the similarity value.
[0021] Furthermore, in step 5, when the similarity is greater than or equal to the closed-loop discrimination threshold, it also includes obtaining the similarity between the two subsequent frames of the current image frame and the current key frame respectively. When the two subsequent similarities obtained are both greater than or equal to the closed-loop discrimination threshold, it is determined to send a closed loop, end the traversal of the current image frame sequence, and complete the closed-loop detection of the currently acquired external environment image.
[0022] The present invention also provides a closed-loop detection system for simultaneous positioning and mapping by robot vision, which is used to carry the above-mentioned closed-loop detection method for simultaneous positioning and mapping by robot vision, including:
[0023] Parameter initialization module, used to initialize the key frame selection interval, the threshold of the difference in the number of feature points of adjacent key frames, and the closed-loop discrimination threshold;
[0024] An image acquisition module, used to acquire an image frame sequence of an external environment;
[0025] The visual feature extraction module is used to extract the visual features of the current frame image and use the pre-trained convolutional neural network model to extract the visual features of the current image frame to form a feature vector;
[0026] Image frame counter: used to calculate the number of image frames retrieved since the last key frame insertion;
[0027] The key frame selection module is used to select appropriate key frames from the input image frame sequence to reduce the amount of data and improve the performance of closed-loop detection;
[0028] Similarity calculation module: used to calculate the similarity value between the current key frame and the historical key frame;
[0029] Closed loop determination module: used to determine whether a closed loop occurs based on the similarity value obtained by the similarity calculation module;
[0030] Closed-loop verification module: used to detect whether the current closed-loop is a true closed-loop and to correct the closed-loop result;
[0031] The parameter initialization module is connected to the image acquisition module; the image acquisition module is respectively connected to the visual feature extraction module, the image frame counter, and the closed-loop verification module; the key frame selection module is respectively connected to the visual feature extraction module, the image frame counter, and the similarity calculation module; the closed-loop determination module is respectively connected to the closed-loop verification module and the similarity calculation module.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] The present invention designs a better key frame selection strategy, which can better reflect environmental information to deal with the problem of too fast camera movement; uses convolutional neural networks instead of traditional models to extract visual features, which can effectively reduce the influence of environmental factors such as lighting; and designs a closed-loop verification strategy to effectively solve the problem of false closed loops in similar scenes. In summary, the present invention discloses a closed-loop detection method for simultaneous positioning and mapping of robot vision, which can effectively improve the accuracy and stability of closed-loop detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0035] Figure 1 is a flow chart of the present invention;
[0036] Figure 2 It is a system block diagram of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0038] like Figure 1 As shown, the present invention discloses a closed-loop detection method in robot vision simultaneous positioning and mapping, comprising:
[0039] Step S1: Setting initial parameters: setting the key frame selection interval, setting the threshold of the difference in the number of feature points of adjacent key frames, setting the closed-loop discrimination threshold, and the number of image frame acquisitions, where the number of image frame acquisitions is an integer starting from zero;
[0040] Among them, the value range of the key frame selection interval is: 15~30; the value range of the threshold of the difference in the number of feature points of adjacent key frames is 25~40; and the value range of the closed-loop discrimination threshold is 0.5~0.75.
[0041] The most preferred value is: 20 for the key frame selection interval; 30 for the difference in the number of feature points between adjacent key frames; and 0.7 for the closed loop discrimination threshold.
[0042] Among them, the key frame selection interval, the number of image frame acquisitions, and the threshold of the difference in the number of feature points of adjacent key frames are used for key frame selection, and the closed loop judgment threshold is used to determine whether a closed loop occurs after obtaining the similarity value based on whether the similarity value is greater than the threshold;
[0043] Step S2: Acquire an image sequence of the external environment, acquire image frames in the image sequence one by one, and process the current image frame by executing steps S3-S5;
[0044] Step S3: the number of image frame acquisitions is incremented once, and the pre-trained convolutional neural network model is used to extract the visual features of the current image frame to form a feature vector;
[0045] Calculate the difference between the number of visual features of the current image frame and the number of visual features of the last key frame in the key frame sequence. The specific formula is as follows:
[0046] D=|N c -N l |
[0047] Among them, N c is the number of visual features of the current image frame; N l is the number of visual features of the last key frame in the key frame sequence; D is the difference between the number of visual features of the current image frame and the number of visual features of the key frame;
[0048] Using convolutional neural networks instead of traditional bag-of-words models to extract visual features of image frames contains more in-depth information than traditional methods and can effectively reduce the impact of environmental factors such as lighting;
[0049] Step S4: When the difference value obtained in step S3 is greater than or equal to the threshold value of the difference in the number of feature points of adjacent key frames, execute step S5;
[0050] When the difference value obtained in step S3 is less than the threshold value of the difference in the number of feature points of adjacent key frames, the processing of the current image frame is terminated;
[0051] When the difference value obtained in step S3 is greater than or equal to the threshold of the difference in the number of feature points of adjacent key frames, and the number of image frame acquisitions is greater than or equal to the key frame selection interval, step S5 is executed;
[0052] When the difference value obtained in step S3 is greater than or equal to the threshold of the difference in the number of feature points of adjacent key frames, and the number of image frame acquisitions is less than the key frame selection interval, the processing of the current image frame is terminated;
[0053] Step S4 involves a key frame selection strategy. Different from the prior art which only inserts a key frame at regular intervals, the present invention also determines whether to insert the current image frame into the key frame sequence as a new key frame based on the difference between the number of feature points in each image frame and the number of feature points in the previous key frame. When the camera moves too fast, there will inevitably be a large change in adjacent frames. At this time, only relying on a single time interval to select key frames cannot well reflect the environmental change information. Since the image information of adjacent frames changes greatly when the camera moves too fast, the number of visual feature points of the image will change greatly. Therefore, the number of visual feature points can be used to detect whether the camera moves quickly. If so, the current image frame is inserted into the key frame as soon as possible. Specifically, the number of visual feature points of the current image frame extracted in step S2 is first compared with the number of feature points of the previous key frame. If the difference is greater than the threshold, it is considered that the camera has moved quickly and the current image frame is inserted into the key frame sequence. If the difference is less than the threshold, the number of image frame acquisitions continues to be accumulated. When the number of image frame acquisitions exceeds the key frame selection interval, it means that the current image frame should be inserted into the key frame sequence to ensure the continuity of key frame sequence acquisition. This process is the process of inserting a key frame every certain number of image frames, which is used to solve the problem that traditional methods cannot insert key frames well when the camera moves too fast.
[0054] Step S5: The number of image frame acquisitions is reset to zero, the current image frame is inserted into the key frame sequence, the key frame sequence is traversed in reverse order, and the similarity between the current image frame and the current key frame is calculated using the feature vector of the current image frame and the feature vector of the current key frame. The specific formula is as follows:
[0055]
[0056] Among them, a and b are the current image frame and the current key frame respectively; V a 、V b is the feature vector; Sim(a,b) is the similarity value;
[0057] When the similarity is less than the closed-loop discrimination threshold, the processing of the current image frame is terminated;
[0058] When the similarity is greater than or equal to the closed-loop discrimination threshold, the similarity between the two subsequent frames of the current image frame and the current key frame is obtained. When the two subsequent similarities obtained are both greater than or equal to the closed-loop discrimination threshold, it is determined to send a closed loop, end the traversal of the current image frame sequence, and complete the closed-loop detection of the currently acquired external environment image.
[0059] Step 5 involves a closed loop verification strategy. The traditional method generally only considers a closed loop to have occurred when the similarity value is higher than a certain part. This method is applicable in most cases, but in the case of similar scenes, a false closed loop will appear. For example, two offices have similar layouts. In this case, the calculated similarity value is relatively high. If the traditional method is used, it will be considered that this is a closed loop. The method of the present invention is that when it is found that the similarity value between the current image frame and the key frame is high, it is temporarily considered that a closed loop has occurred, and the subsequent consecutive image frames are compared with the key frame for similarity. If the similarity values are all higher than the threshold, it is considered that a closed loop has indeed occurred, which can solve the closed loop detection problem of similar scenes.
[0060] like Figure 2 As shown, the present invention also provides a robot vision simultaneous positioning and closed-loop detection system in mapping that implements the closed-loop detection method in robot vision simultaneous positioning and mapping, comprising:
[0061] Parameter initialization module, used to initialize the key frame selection interval, the threshold of the difference in the number of feature points of adjacent key frames, and the closed-loop discrimination threshold;
[0062] An image acquisition module, used to acquire an image frame sequence of an external environment;
[0063] The visual feature extraction module is used to extract the visual features of the current frame image and use the pre-trained convolutional neural network model to extract the visual features of the current image frame to form a feature vector;
[0064] Image frame counter: used to calculate the number of image frames retrieved since the last key frame insertion;
[0065] The key frame selection module is used to select appropriate key frames from the input image frame sequence to reduce the amount of data and improve the performance of closed-loop detection;
[0066] Similarity calculation module: used to calculate the similarity value between the current key frame and the historical key frame;
[0067] Closed loop determination module: used to determine whether a closed loop occurs based on the similarity value obtained by the similarity calculation module;
[0068] Closed-loop verification module: used to detect whether the current closed-loop is a true closed-loop and to correct the closed-loop result;
[0069] The parameter initialization module is connected to the image acquisition module; the image acquisition module is respectively connected to the visual feature extraction module, the image frame counter, and the closed-loop verification module; the key frame selection module is respectively connected to the visual feature extraction module, the image frame counter, and the similarity calculation module; the closed-loop determination module is respectively connected to the closed-loop verification module and the similarity calculation module.
[0070] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A closed-loop detection method for simultaneous positioning and mapping of robot vision, characterized in that: The steps include: Step 1: Set initial parameters: set the key frame selection interval, set the threshold for the difference in the number of feature points of adjacent key frames, the closed-loop discrimination threshold, and the number of image frame acquisitions, where the number of image frame acquisitions is an integer starting from zero; Step 2: Obtain an image sequence of the external environment, obtain image frames in the image sequence one by one, and process the current image frame by executing steps 3-5; Step 3: The number of image frame acquisitions is incremented once, and the pre-trained convolutional neural network model is used to extract the visual features of the current image frame to form a feature vector; Calculate the difference between the number of visual features of the current image frame and the number of visual features of the last key frame in the key frame sequence; Step 4: When the difference value obtained in step 3 is greater than or equal to the threshold value of the difference in the number of feature points of adjacent key frames, execute step 5; When the difference value obtained in step 3 is less than the threshold value of the difference in the number of feature points of adjacent key frames, the processing of the current image frame is terminated; When the difference value obtained in step 3 is less than or equal to the threshold of the difference in the number of feature points of adjacent key frames, and the number of image frame acquisitions is greater than or equal to the key frame selection interval, execute step 5; When the difference value obtained in step 3 is greater than or equal to the difference threshold of the number of feature points of adjacent key frames, and the number of image frame acquisitions is less than the key frame selection interval, the processing of the current image frame is terminated; Step 5: reset the number of image frame acquisitions, insert the current image frame into the key frame sequence, traverse the key frame sequence in reverse order, and use the feature vector of the current image frame and the feature vector of the current key frame to calculate the similarity between the current image frame and the current key frame; When the similarity is less than the closed-loop discrimination threshold, the processing of the current image frame is terminated; When the similarity is greater than or equal to the closed-loop discrimination threshold, the similarity between the two subsequent frames of the current image frame and the current key frame is obtained. When the two subsequent similarities obtained are both greater than or equal to the closed-loop discrimination threshold, it is determined to send a closed loop, end the traversal of the current image frame sequence, and complete the closed-loop detection of the currently acquired external environment image.
2. The closed-loop detection method for simultaneous positioning and mapping by robot vision as claimed in claim 1, characterized in that: The value range of the key frame selection interval is: 15-30; the value range of the threshold of the difference in the number of feature points of adjacent key frames is 25-40; and the value range of the closed-loop discrimination threshold is 0.5-0.
75.
3. The closed-loop detection method for simultaneous positioning and mapping by robot vision as claimed in claim 2, characterized in that: The value of the key frame selection interval is: 20; the value of the threshold value of the difference in the number of feature points of adjacent key frames is 30; and the value of the closed-loop discrimination threshold is 0.
7.
4. The closed-loop detection method for simultaneous positioning and mapping by robot vision as claimed in claim 1, characterized in that: The specific formula for calculating the similarity between the current image frame and the current key frame using the feature vector of the current image frame and the feature vector of the current key frame in step 5 is as follows: Among them, a and b are the current image frame and the current key frame respectively; V a 、V b is the feature vector; Sim(a,b) is the similarity value.
5. A closed-loop detection system for simultaneous positioning and mapping of robot vision, used to carry the closed-loop detection method for simultaneous positioning and mapping of robot vision as claimed in claim 1, characterized in that: include: Parameter initialization module, used to initialize the key frame selection interval, the threshold of the difference in the number of feature points of adjacent key frames, and the closed-loop discrimination threshold; An image acquisition module, used to acquire an image frame sequence of an external environment; The visual feature extraction module is used to extract the visual features of the current frame image and use the pre-trained convolutional neural network model to extract the visual features of the current image frame to form a feature vector; Image frame counter: used to calculate the number of image frames retrieved from the last inserted key frame; The key frame selection module is used to select appropriate key frames from the input image frame sequence to reduce the amount of data and improve the performance of closed-loop detection; Similarity calculation module: used to calculate the similarity value between the current key frame and the historical key frame; Closed loop determination module: used to determine whether a closed loop occurs based on the similarity value obtained by the similarity calculation module; Closed-loop verification module: used to detect whether the current closed-loop is a true closed-loop and to correct the closed-loop result; The parameter initialization module is connected to the image acquisition module; the image acquisition module is respectively connected to the visual feature extraction module, the image frame counter, and the closed-loop verification module; the key frame selection module is respectively connected to the visual feature extraction module, the image frame counter, and the similarity calculation module; the closed-loop discrimination module is respectively connected to the closed-loop verification module and the similarity calculation module.
