Urban underground space three-dimensional modeling method and system based on visual SLAM algorithm

Through visual SLAM algorithm and octree map technology, the problem of time-consuming feature point extraction and poor map visibility in underground space 3D modeling is solved, and fast and accurate 3D modeling and navigation support are achieved.

CN118570392AInactive Publication Date: 2024-08-30JINKEN COLLEGE OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410930160.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In underground space development, existing technologies are difficult to effectively perform three-dimensional modeling. In particular, due to the tightness and complexity, feature point extraction takes a long time and map visibility is poor, making it impossible to provide precise navigation support.

Method used

Using a method based on the visual SLAM algorithm, the frame image sequence is obtained through the camera for image preprocessing, key frames are extracted and a dense point cloud is constructed, and a map is generated based on the octree principle, which reduces the workload of feature point extraction and matching, and improves the map's accuracy. Visibility.

Benefits of technology

It achieves fast and accurate three-dimensional modeling, reduces the burden of feature point description, improves map visibility and navigation accuracy, and is suitable for robot navigation and obstacle detection in underground spaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570392A
    Figure CN118570392A
Patent Text Reader

Abstract

The invention discloses an urban underground space three-dimensional modeling method and system based on a visual SLAM algorithm, and belongs to the technical field of underground space modeling. Comprising the steps of obtaining a two-dimensional image sequence by taking a frame image about an underground space; performing image preprocessing on the two-dimensional image sequence to obtain a processed two-dimensional image sequence, and obtaining a key frame based on the processed two-dimensional image sequence; acquiring color information and depth information of key frames, and matching the key frame set based on a spatial conversion relation to obtain key frame poses; a dense point cloud is constructed in combination with a key frame pose, and the dense point cloud is converted into an octree map by using an octree principle. According to the method, only the key frames are subjected to feature extraction and matching, the non-key frames are subjected to feature tracking, and feature extraction and matching are not needed. The workload of feature point extraction and matching is reduced by adopting a complementary processing form, and the problem of serious feature point description consumption in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of underground space modeling, and in particular relates to a method and system for three-dimensional modeling of urban underground space based on a visual SLAM algorithm. Background Art

[0002] With the continuous development of my country's economy and the continuous advancement of smart city construction, urban ground space resources are becoming increasingly scarce, and underground space resources are beginning to be continuously developed, and the utilization of urban underground space will gradually increase. However, the development of underground space also has certain difficulties. The underground space environment has problems such as airtightness, load-bearing, and difficulty in observation. The safety issues of urban underground space development need to be given priority consideration.

[0003] The three-dimensional mapping problem is a key task in the design and actual operation of robots at the current stage. In outdoor spaces, GPS can generally be used for positioning, but in indoor spaces, GPS has relatively obvious positioning errors. In recent years, mobile robot technology represented by machine vision has developed rapidly, which has greatly alleviated the task of manual inspection. However, the inspection routes of mobile robots are still mainly set by humans, and they cannot be used autonomously in unfamiliar and complex environments. Using mobile robots to perceive unknown environments is a hot spot and difficulty in robot technology research. Simultaneous Localization and Mapping (SLAM) of mobile robots is one of the important basic problems. Effectively solving the SLAM problem is considered to be one of the key technologies to truly realize the intelligence of mobile robots, and it is also one of the effective ways to further promote the construction of underground space.

[0004] However, considering the airtightness and complexity of indoor environments, especially underground environments, in order to ensure the authenticity of 3D modeling, a large number of feature points need to be obtained, so it takes a lot of time to describe the feature points and the processing load is large. At the same time, the uniform point map of the existing technology has poor visibility and is not convenient for providing more sophisticated navigation. Summary of the invention

[0005] The purpose of the present invention is to provide a method and system for three-dimensional modeling of urban underground space based on a visual SLAM algorithm to solve the problems raised in the background technology.

[0006] The present invention adopts the following technical solution: a method for three-dimensional modeling of underground space based on visual SLAM algorithm, comprising the following steps: Using a camera to acquire frame images of the underground space to obtain a two-dimensional image sequence; performing image preprocessing on the two-dimensional image sequence to obtain a processed two-dimensional image sequence, and acquiring key frames based on the processed two-dimensional image sequence to obtain a key frame set; Create world coordinate systems separately and pixel coordinate system , determine the world coordinate system and the camera coordinate system The spatial conversion relationship between them; obtaining the color information and depth information of the key frame, matching the key frame set based on the spatial conversion relationship to obtain the key frame pose for local mapping and loop detection; performing feature tracking on the non-key frame for tracking and positioning; The dense point cloud is constructed by combining the key frame poses, and the dense point cloud is converted into an octree map using the octree principle.

[0007] In a further embodiment, the two-dimensional image sequence is expressed in the following form: : ; in, represents the pixel number of the two-dimensional image, T represents the frame period, express Frame Image The signal at point express Frame Image Noise at the point; Correspondingly, the preprocessing process of the two-dimensional image sequence is as follows: Calculate the difference signal FD between two frames of images: ; The difference signal FD is converted into the pixel grayscale difference between frames : ; In the formula, Represents a two-dimensional image sequence Frame Image Gray value at the point.

[0008] In a further embodiment, the key frame determination process is as follows: Extract all image frame information related to the 2D image sequence and determine the number of all image frames ;Will The image frame is defined as the first key frame extracted , and use the autocorrelation function to calculate the current key frame The correlation function value of , k is the key frame number; from Start to traverse the processed two-dimensional image sequence in turn, and use the autocorrelation function to calculate the correlation function value of the current frame i in turn , calculate the current frame i and the current key frame The absolute value of the correlation function : ; like , it means that the current frame i is a key frame, extract the basic information of its corresponding frame and assign it to the current key frame Otherwise, it is a non-key frame and the traversal starts again. i=i+1 ; is the parameter; Wherein, the autocorrelation function is expressed as: ; In the formula, Represents the grayscale difference between pixels in frames. express A collection of information about a frame grayscale image.

[0009] In a further embodiment, the key frame pose determination process is as follows: Define key frame k in the world coordinate system The spatial coordinates inside are , traverse the RGB images and depth images corresponding to the key frames, and extract the image pixel coordinates of key frame k and spatial depth value d, the relationship between the pixel coordinates and spatial coordinates of key frame k is: ; In the formula, , s is the preset scale factor, K is the camera internal parameter, Lie algebra for image transformation pose; Then, the key frame pose The expression is as follows: .

[0010] In a further embodiment, the feature tracking of the non-keyframes comprises the following steps: Extract the coordinate metadata of non-key frames, compare the features in adjacent time frames in turn, match any two features with overlapping volumes in adjacent time frames t and t+1, and obtain the matching degree R of feature A and feature B: ; In the formula, represents the volume of feature A at time frame t, represents the volume of feature B at time frame t+1, Represents the overlapping volume of feature A and feature B switching at time frames t and t+1; The matching degree R of different feature combinations is calculated in turn, and the feature pair that maximizes the matching degree R is found to determine the feature evolution state; the feature evolution state at least includes: birth, continuation, merger, split and disappearance.

[0011] In a further embodiment, the dense point cloud construction process is as follows: Based on the color information and depth information of the key frame, the point cloud coordinates are obtained and colored, a coordinate set of the point cloud data is created, and the maximum value of the three-axis coordinates is determined. , , and minimum value , , ; Use the following formula to calculate the side length of the minimum bounding box of the point cloud , and : ; According to the side length r of the voxel grid, the number of triaxial voxel grids is obtained , and : ; in, means rounding down to an integer, the total number of voxel grids is: ; Calculate the position information of each point cloud in the voxel grid , that is, all point cloud data in each voxel grid are obtained; among them, The index of the point cloud on the X axis, is the index of the point cloud on the Y axis, The index of the point cloud on the Z axis; is the index of the point cloud within the voxel grid.

[0012] In a further embodiment, the location information The calculation process is as follows: , where is the X axis of the point cloud; , where is the Y axis of the point cloud; , where is the Z axis of the point cloud; but .

[0013] A three-dimensional modeling system for urban underground space based on visual SLAM algorithm, used to implement the three-dimensional modeling method for urban underground space as described above, comprising: The first module is configured to obtain a frame image of the underground space using a camera to obtain a two-dimensional image sequence; perform image preprocessing on the two-dimensional image sequence to obtain a processed two-dimensional image sequence, and obtain key frames based on the processed two-dimensional image sequence to obtain a key frame set; The second module is set to create a world coordinate system and pixel coordinate system , determine the world coordinate system and the camera coordinate system The spatial conversion relationship between them; obtaining the color information and depth information of the key frame, matching the key frame set based on the spatial conversion relationship to obtain the key frame pose for local mapping and loop detection; performing feature tracking on the non-key frame for tracking and positioning; The third module is configured to construct a dense point cloud based on key frame positions and positions, and to construct a three-dimensional model of the underground space using the constructed dense point cloud.

[0014] Beneficial effects of the present invention: The present invention only performs feature extraction and matching on key frames, and uses feature tracking for non-key frames without feature extraction and matching. The complementary processing reduces the workload of feature point extraction and matching, and solves the problem of serious feature point description consumption in the prior art.

[0015] At the same time, the present invention constructs a dense point cloud based on the color information and depth information of the key frame and combines the key frame pose to solve the technical problem of weak visibility of sparse point cloud maps in the prior art. At the same time, the octree map can also display obstacle information in the map, further improving visibility and facilitating storage and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Picture 1 This is a flow chart of the underground space three-dimensional modeling method based on the visual SLAM algorithm of Example 1. DETAILED DESCRIPTION

[0017] Example 1 This embodiment discloses a method for three-dimensional modeling of underground space based on a visual SLAM algorithm, such as Picture 1 As shown, the following steps are included: Using a camera to acquire frame images of the underground space to obtain a two-dimensional image sequence; performing image preprocessing on the two-dimensional image sequence to obtain a processed two-dimensional image sequence, and acquiring key frames based on the processed two-dimensional image sequence to obtain a key frame set; Create world coordinate systems separately and pixel coordinate system , determine the world coordinate system and the camera coordinate system The spatial conversion relationship between them; obtaining the color information and depth information of the key frame, matching the key frame set based on the spatial conversion relationship to obtain the key frame pose for local mapping and loop detection; performing feature tracking on the non-key frame for tracking and positioning; The dense point cloud is constructed by combining the key frame poses, and the dense point cloud is converted into an octree map using the octree principle.

[0018] In order to better obtain the key frame, this embodiment first uses the following form to express the two-dimensional image sequence : ; in, represents the pixel number of the two-dimensional image, T represents the frame period, express Frame Image The signal at point express Frame Image Noise at the point; Secondly, the preprocessing process of the two-dimensional image sequence is as follows: Calculate the difference signal FD between two frames of images: ; The difference signal FD is converted into the pixel grayscale difference between frames : ; In the formula, Represents a two-dimensional image sequence Frame Image Gray value at the point.

[0019] Based on the above two-dimensional image processing, the key frame determination process is as follows: Extract all image frame information related to the 2D image sequence and determine the number of all image frames ;Will The image frame is defined as the first key frame extracted , and use the autocorrelation function to calculate the current key frame The correlation function value of , k is the key frame number; from Start to traverse the processed two-dimensional image sequence in turn, and use the autocorrelation function to calculate the correlation function value of the current frame i in turn , calculate the current frame i and the current key frame The absolute value of the correlation function : ; like , it means that the current frame i is a key frame, extract the basic information of its corresponding frame and assign it to the current key frame Otherwise, it is a non-key frame and the traversal starts again. i=i+1 ; is the parameter; Wherein, the autocorrelation function is expressed as: ; In the formula, Represents the grayscale difference between pixels in frames. express A collection of information about a frame grayscale image.

[0020] By adopting the above technical solution, this embodiment distinguishes key frames from non-key frames in order to achieve complementary processing and reduce the description strength of feature points. For example, key frames are used for local mapping and loop detection, while non-key frames are used for tracking and positioning.

[0021] The further application of key frames is as follows: The key frame pose determination process is as follows: Define key frame k in the world coordinate system The spatial coordinates inside are , traverse the RGB images and depth images corresponding to the key frames, and extract the image pixel coordinates of key frame k and spatial depth value d, the relationship between the pixel coordinates and spatial coordinates of key frame k is: ; In the formula, , s is the preset scale factor, K is the camera internal parameter, Lie algebra for image transformation pose; Then, the key frame pose The expression is as follows: . Feature tracking for non-keyframes consists of the following steps: Extract the coordinate metadata of non-key frames, compare the features in adjacent time frames in turn, match any two features with overlapping volumes in adjacent time frames t and t+1, and obtain the matching degree R of feature A and feature B: ; In the formula, represents the volume of feature A at time frame t, represents the volume of feature B at time frame t+1, Represents the overlapping volume of feature A and feature B switching at time frames t and t+1; The matching degree R of different feature combinations is calculated in turn, and the feature pair that maximizes the matching degree R is found to determine the feature evolution state; the feature evolution state at least includes: birth, continuation, merger, split and disappearance.

[0022] In order to solve the problem that the point cloud map information is incomplete and cannot be directly used for subsequent robot obstacle avoidance and path navigation, the color information and depth information of the key frames collected by the RGB-D camera are combined with the key frame pose to construct an octree map that can be directly used for navigation and obstacle avoidance. Simulations are performed on public datasets. Compared with point cloud maps, it is verified that the octree map established in this project can represent the existence information of obstacles in the map, and is easy to save and maintain, and the three-dimensional map accuracy can be adjusted.

[0023] Further expressed as: The construction process of dense point cloud is as follows: Based on the color information and depth information of the key frame, the point cloud coordinates are obtained and colored, a coordinate set of the point cloud data is created, and the maximum value of the three-axis coordinates is determined. , , and minimum value , , ; Use the following formula to calculate the side length of the minimum bounding box of the point cloud , and : ; According to the side length r of the voxel grid, the number of triaxial voxel grids is obtained , and : ; in, means rounding down to an integer, the total number of voxel grids is: ; Calculate the position information of each point cloud in the voxel grid , that is, all point cloud data in each voxel grid are obtained; among them, The index of the point cloud on the X axis, is the index of the point cloud on the Y axis, The index of the point cloud on the Z axis; is the index of the point cloud within the voxel grid.

[0024] Among them, location information The calculation process is as follows: , where is the X axis of the point cloud; , where is the Y axis of the point cloud; , where is the Z axis of the point cloud; but .

[0025] The urban underground space three-dimensional modeling method adopted in this embodiment is applicable to underground urban spaces, such as underground shopping malls, underground parking lots, subways, military, sea tunnels and other indoor spaces of buildings below the surface.

[0026] Example 2 This embodiment discloses a three-dimensional modeling system for urban underground space based on a visual SLAM algorithm, which is used to implement the three-dimensional modeling method for urban underground space described in Embodiment 1, including: The first module is configured to obtain a frame image of the underground space using a camera to obtain a two-dimensional image sequence; perform image preprocessing on the two-dimensional image sequence to obtain a processed two-dimensional image sequence, and obtain key frames based on the processed two-dimensional image sequence to obtain a key frame set; The second module is set to create a world coordinate system and pixel coordinate system , determine the world coordinate system and the camera coordinate system The spatial conversion relationship between them; obtaining the color information and depth information of the key frame, matching the key frame set based on the spatial conversion relationship to obtain the key frame pose for local mapping and loop detection; performing feature tracking on the non-key frame for tracking and positioning; The third module is configured to construct a dense point cloud based on key frame positions and positions, and to construct a three-dimensional model of the underground space using the constructed dense point cloud.

Claims

1. A method for three-dimensional modeling of underground space based on visual SLAM algorithm, characterized in that: The following steps are involved: Using a camera to acquire frame images of the underground space to obtain a two-dimensional image sequence; Performing image preprocessing on the two-dimensional image sequence to obtain a processed two-dimensional image sequence, acquiring key frames based on the processed two-dimensional image sequence to obtain a key frame set; Create world coordinate systems separately and pixel coordinate system , determine the world coordinate system and the camera coordinate system The spatial transformation relationship between them; obtaining the color information and depth information of the key frame, matching the key frame set based on the spatial transformation relationship to obtain the key frame pose for local mapping and loop detection; Perform feature tracking on non-key frames for tracking and positioning; The dense point cloud is constructed by combining the key frame poses, and the dense point cloud is converted into an octree map using the octree principle.

2. The method for three-dimensional modeling of underground space based on visual SLAM algorithm according to claim 1, characterized in that: The two-dimensional image sequence is expressed in the following form: : ; in, represents the pixel number of the two-dimensional image, T represents the frame period, express Frame Image The signal at point express Frame Image Noise at the point; Correspondingly, the preprocessing process of the two-dimensional image sequence is as follows: Calculate the difference signal FD between two frames of images: ; The difference signal FD is converted into the pixel grayscale difference between frames : ; In the formula, Represents a two-dimensional image sequence Frame Image Gray value at the point.

3. The method for three-dimensional modeling of underground space based on visual SLAM algorithm according to claim 1, characterized in that: The key frame determination process is as follows: Extract all image frame information related to the 2D image sequence and determine the number of all image frames ;Will The image frame is defined as the first key frame extracted , and use the autocorrelation function to calculate the current key frame The correlation function value of , k is the key frame number; from Start to traverse the processed two-dimensional image sequence in turn, and use the autocorrelation function to calculate the correlation function value of the current frame i in turn , calculate the current frame i and the current key frame The absolute value of the correlation function : ; like , it means that the current frame i is a key frame, extract the basic information of its corresponding frame and assign it to the current key frame Otherwise, it is a non-key frame and the traversal starts again. i=i+1 ; is the parameter; Wherein, the autocorrelation function is expressed as: ; In the formula, Represents the grayscale difference between pixels in frames. express A collection of information about a frame grayscale image.

4. The method for three-dimensional modeling of underground space based on visual SLAM algorithm according to claim 1, characterized in that: The key frame pose determination process is as follows: Define key frame k in the world coordinate system The spatial coordinates in , traverse the RGB images and depth images corresponding to the key frames, and extract the image pixel coordinates of key frame k and spatial depth value d, the relationship between the pixel coordinates and spatial coordinates of key frame k is: ; In the formula, , s is the preset scale factor, K is the camera internal parameter, Lie algebra for image transformation pose; Then, the key frame pose The expression is as follows: .

5. The method for three-dimensional modeling of underground space based on visual SLAM algorithm according to claim 1, characterized in that: The feature tracking of the non-key frame comprises the following steps: Extract the coordinate metadata of non-key frames, compare the features in adjacent time frames in turn, match any two features with overlapping volumes in adjacent time frames t and t+1, and obtain the matching degree R of feature A and feature B: ; In the formula, represents the volume of feature A at time frame t, represents the volume of feature B at time frame t+1, Represents the overlapping volume of feature A and feature B switching at time frames t and t+1; The matching degree R of different feature combinations is calculated in turn, and the feature pair that maximizes the matching degree R is found to determine the feature evolution state; the feature evolution state at least includes: birth, continuation, merger, split and disappearance.

6. The method for three-dimensional modeling of underground space based on visual SLAM algorithm according to claim 1, characterized in that: The construction process of the dense point cloud is as follows: Based on the color information and depth information of the key frame, the point cloud coordinates are obtained and colored, a coordinate set of the point cloud data is created, and the maximum value of the three-axis coordinates is determined. , , and minimum value , , ; Use the following formula to calculate the side length of the minimum bounding box of the point cloud: , and : ; According to the side length r of the voxel grid, the number of triaxial voxel grids is obtained , and : ; in, means rounding down to an integer, the total number of voxel grids is: ; Calculate the position information of each point cloud in the voxel grid , that is, all point cloud data in each voxel grid are obtained; among them, The index of the point cloud on the X axis, is the index of the point cloud on the Y axis, The index of the point cloud on the Z axis; is the index of the point cloud within the voxel grid.

7. The method for three-dimensional modeling of underground space based on visual SLAM algorithm according to claim 6, characterized in that: The location information The calculation process is as follows: , where is the X axis of the point cloud; , where is the Y axis of the point cloud; , where is the Z axis of the point cloud; but .

8. A three-dimensional modeling system for urban underground space based on visual SLAM algorithm, used to implement the three-dimensional modeling method for urban underground space according to any one of claims 1 to 7, comprising: The first module is configured to obtain a frame image of the underground space using a camera to obtain a two-dimensional image sequence; Performing image preprocessing on the two-dimensional image sequence to obtain a processed two-dimensional image sequence, acquiring key frames based on the processed two-dimensional image sequence to obtain a key frame set; The second module is set to create a world coordinate system and pixel coordinate system , determine the world coordinate system and the camera coordinate system The spatial transformation relationship between them; obtaining the color information and depth information of the key frame, matching the key frame set based on the spatial transformation relationship to obtain the key frame pose for local mapping and loop detection; Perform feature tracking on non-key frames for tracking and positioning; The third module is configured to construct a dense point cloud based on key frame positions and positions, and to construct a three-dimensional model of the underground space using the constructed dense point cloud.