An unmanned aerial vehicle monocular vision inertial slam loop detection method based on under-forest trunk geometry

By constructing a joint detection framework based on tree trunk geometry triangular features and a visual bag-of-words model in UAV visual inertial SLAM, the problem of false detection and missed detection of loop closures in the forest environment is solved, and high-precision and real-time positioning support is achieved.

CN122265874APending Publication Date: 2026-06-23NORTHEAST FORESTRY UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NORTHEAST FORESTRY UNIV
Filing Date
2026-02-05
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

When drones operate in forest environments without GNSS, traditional visual-inertial SLAM loop closure detection methods are prone to false detections and missed detections in forest environments with repetitive textures and variable lighting, leading to decreased positioning accuracy and system failure.

Method used

We employ deep data-driven extraction of tree trunk geometric information to construct triangular geometric features. By combining these features with a visual bag-of-words model, we perform multi-dimensional similarity matching and joint decision-making to achieve loop closure detection.

Benefits of technology

It significantly improves the accuracy and robustness of loop closure detection in GNSS-free environments under forest cover, optimizes the overall positioning performance of visual inertial positioning systems, and meets the requirements for lightweight design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122265874A_ABST
    Figure CN122265874A_ABST
Patent Text Reader

Abstract

The application discloses a kind of unmanned aerial vehicle monocular vision inertial SLAM loop detection methods based on undergrowth trunk geometry, the method includes the following steps: step 1, trunk region segmentation and three-dimensional point cloud generation;Step 2, trunk clustering detection and position positioning;Step 3, triangular geometric feature construction and screening;Step 4, multidimensional similarity calculation;Step 5, geometric and visual joint decision and loop confirmation.This method extracts stable geometric information of trunk by driving depth data, constructs triangular features with invariance with trunk position as vertex to break through the dependence of visual texture, realizes double-path independent detection and joint decision by combining traditional visual bag-of-words model, balances detection accuracy and real-time through adaptive matching strategy, thereby effectively improves the accuracy, robustness and environmental adaptability of loop detection in undergrowth GNSS-free environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a loop closure detection method applicable to monocular visual inertial SLAM for unmanned aerial vehicles, specifically a loop closure detection method that integrates trunk geometric feature modeling with a visual bag-of-words model. Background Technology

[0002] In forestry inspection and ecological monitoring, autonomous drone inspections have become a key technology for improving the efficiency of forest understory inspections due to their high efficiency and flexibility. Their core support lies in reliable autonomous positioning capabilities. In forest environments without Global Navigation Satellite System (GNSS) signal coverage, Visual-Inertial SLAM (VIS) has become the preferred positioning solution due to its outstanding advantages such as lightweight payload, low hardware cost, and independence from external signals.

[0003] However, the unique characteristics of the forest understory environment present a significant challenge to the loop closure detection module in visual-inertial SLAM. On one hand, the numerous tree trunks and branches in the forest understory create highly repetitive texture features, easily leading to mismatches of visual features and causing inconsistencies between the residuals of visual and inertial measurement data, directly reducing positioning accuracy. On the other hand, the complex and variable lighting conditions in the forest understory further exacerbate the difficulty of distinguishing visual features. Loop closure detection, as a crucial step in visual-inertial SLAM to correct accumulated errors and ensure positioning accuracy, is essential. Figure One The core module of the system directly determines the reliability of the entire positioning system. If it cannot accurately identify the visited scene and achieve loop closure, the positioning error will continue to accumulate, causing map distortion or even system positioning failure.

[0004] Traditional loop closure detection methods primarily rely on bag-of-words models based on appearance features. These models extract local visual features from images to construct a bag-of-words database, enabling scene re-identification and loop closure detection. However, these methods have significant limitations: in scenes with high texture repetition, similar but non-originating scenes are easily misidentified as loop closures, resulting in false positives; and in situations with significant lighting changes or scarce visual features, missed matches are common, preventing the effective detection of true loop closures. Furthermore, traditional methods often employ heuristic triggering logic with fixed keyframe intervals. Improper similarity thresholds and geometric verification parameters can lead to delays in loop closure detection or even complete omission of loop closures, failing to promptly correct accumulated errors.

[0005] To address the aforementioned issues, existing research primarily focuses on two technical approaches: multi-source information fusion optimization and perception enhancement. However, these approaches still have shortcomings.

[0006] Multi-source information fusion methods: Some schemes achieve loop closure detection by fusing visual inertial odometry and bag-of-words models, but they rely on traditional corner features, have poor robustness in texture degradation environments, and sacrifice loop closure recall to ensure accuracy; other schemes improve reliability through geometric verification and pose graph optimization, but they are still based on hand-designed features, which have insufficient feature discrimination in complex forest environments and large matching errors.

[0007] Perception enhancement methods: Some solutions use deep learning to achieve semantic segmentation or feature extraction, which improves the feature representation ability. However, they are highly dependent on segmentation accuracy or training on specific datasets, and their applicability is limited in forest areas with highly similar tree trunks. They also suffer from problems such as large computational load and insufficient real-time performance on low-computing-power devices. Other solutions improve feature extraction speed through parallel processing, but they are highly dependent on the structured features of the scene, and their performance is limited in single structured scenes under the forest.

[0008] In summary, existing loop closure detection methods struggle to simultaneously meet the dual demands of lightweight systems, real-time performance, and accurate loop closure detection in forest environments. In forest scenes with repetitive textures and variable lighting, they still suffer from high false positive rates, high false negative rates, and insufficient robustness, hindering the application of UAV-based visual-inertial SLAM in autonomous forest inspections. Therefore, a loop closure detection technology adapted to the characteristics of forest environments and balancing reliability and real-time performance is urgently needed to improve the positioning accuracy and robustness of visual-inertial positioning systems. Summary of the Invention

[0009] To address the issues of loop closure detection failure and decreased positioning accuracy caused by environmental characteristics when UAVs perform autonomous inspections in forest environments without GNSS, this invention provides a UAV monocular visual-inertial SLAM loop closure detection method based on forest trunk geometry. This method extracts stable geometric information from the tree trunk using depth data, constructs invariant triangular features with the trunk position as the vertex to overcome visual texture dependence, and combines this with a traditional visual bag-of-words model to achieve independent detection and joint decision-making along two paths. An adaptive matching strategy balances detection accuracy and real-time performance, thereby effectively improving the accuracy, robustness, and environmental adaptability of loop closure detection in forest environments without GNSS.

[0010] The objective of this invention is achieved through the following technical solution:

[0011] A UAV monocular vision-inertial SLAM loop closure detection method based on forest tree trunk geometry has a core technical framework of "depth data-driven tree trunk position extraction → triangle geometric feature modeling → multi-dimensional similarity matching → joint geometric and visual decision-making", specifically including the following steps:

[0012] Step 1: Tree trunk region segmentation and 3D point cloud generation:

[0013] Step 1-1: Segment the input RGB image using a semantic segmentation algorithm to generate a binary mask for the tree trunk region. The specific steps are as follows:

[0014] Step 1-1-1: Perform online semantic segmentation inference based on a pre-trained model on the input RGB image, generate a trunk region mask, extract the mask and merge it into an initial binary trunk mask, thereby achieving the initial localization of the trunk region;

[0015] Step 1-1-2: Combine the historical mask cache with the recent frame mask, adopt the attenuation fusion strategy for unstable areas, and then optimize the initial trunk binary mask by smoothing the edges with Gaussian blur and threshold binarization.

[0016] Step 1-1-3: Output the optimized binary mask with the same size as the input image. Let the image pixel set be Define semantic mask To distinguish the tree trunk from the background area:

[0017] ;

[0018] Steps 1-2: Filter the spatially aligned depth image using a binary mask of the tree trunk region, extract the depth data of the tree trunk region, and combine it with the pose information from the camera's visual inertial odometry to convert the filtered tree trunk region depth data into a 3D point cloud. The specific steps are as follows:

[0019] Step 1-2-1: Apply the tree trunk mask to the depth image to filter effective depth data, retaining only the depth data of regions with a mask value of 1. , Represents the pixel location of the image, i.e., the depth map for the tree trunk;

[0020] Step 1-2-2: Combine the pose data from the camera with the visual inertial odometry. , the pixel coordinates of the tree trunk depth map With depth data Convert to 3D point cloud data. The 3D point cloud is defined by the formula:

[0021]

[0022]

[0023]

[0024]

[0025]

[0026] in, Represents the overall collection of three-dimensional point clouds. Represents the first in this point cloud set A three-dimensional point, Representing three-dimensional real space, Representing the first Three-dimensional points In the world coordinate system axis, axis, Axis coordinates , , Representing the first The points in the camera coordinate system , , coordinate, and These are the row and column numbers of the pixels in the depth image, respectively. and The pixel coordinates representing the center of the camera's imaging plane. and They represent cameras and Axial focal length;

[0027] Step 2, Trunk Clustering Detection and Location:

[0028] Step 2-1: Use a density-based clustering algorithm to cluster the 3D point cloud of the tree trunk, forming independent tree trunk point cloud clusters. Each cluster corresponds to a single tree trunk. The specific steps are as follows:

[0029] Define any point in the point cloud of - Neighborhood is:

[0030]

[0031] Among them, symbols represent of - Neighborhood set, Represents the distance threshold. and Representing any two 3D points in the point cloud, when Mark when the minimum number of points is met. Using the core points as the basis, a trunk cluster set is formed by connecting density-reachable points:

[0032]

[0033] Each cluster Corresponding to a single, independent tree trunk;

[0034] Step 2-2: Calculate the two-dimensional center coordinates of each cluster and use them as the position representation of the trunk to construct the trunk position set. :

[0035]

[0036] in, Representing the The two-dimensional center coordinates of the clusters corresponding to each tree trunk;

[0037] Step 3: Construction and Filtering of Triangle Geometric Features:

[0038] Step 3-1: Select any three non-collinear tree trunks from the set of tree trunk locations, construct triangles using their center coordinates as vertices, calculate the area of ​​the triangles using the determinant, set a minimum area threshold to filter out degenerate triangles with areas close to zero, and retain effective geometric features. The specific steps are as follows:

[0039] Step 3-1-1: Construct a triangle for any three non-collinear tree trunks in each keyframe, with the coordinates of its three vertices as follows:

[0040]

[0041] in, for The center coordinates;

[0042] Step 3-1-2, Area of ​​the triangle Calculated using determinant:

[0043]

[0044] Step 3-1-3: Employ a degenerate triangle filtering mechanism and set a minimum area threshold. Only retain those that meet the requirements. The triangular features;

[0045] Step 3-2: For each valid triangle, extract multi-dimensional geometric feature vectors of the three side lengths, three interior angles, and triangle area to form a geometrically invariant feature description. The feature vectors for each triangle are as follows:

[0046]

[0047] in, The lengths of the three sides of the triangle. The three interior angles of a triangle Let the area be the triangle.

[0048] Step 4: Multi-dimensional similarity calculation:

[0049] For each valid triangle generated in the current frame and triangles in the historical keyframe triangle database, the similarity of side length, angle, and area is calculated. A weighted average is then used to obtain a comprehensive similarity score, and potential loop closure candidate frames with high similarity are selected. The specific steps are as follows:

[0050] Step 4-1: To achieve triangle matching with historical frames, a multi-dimensional similarity measurement strategy is designed for the two triangles. and Calculate the similarity of side lengths, angles, and areas respectively, where:

[0051] Side length similarity:

[0052]

[0053] Angular similarity:

[0054]

[0055] Area similarity:

[0056]

[0057] In the formula, To determine the similarity of the side lengths of two triangles, triangles to be matched The The length of the strip, triangles in historical frames The The length of the strip, similarity of angles between two triangles triangles to be matched The The radian value of each interior angle. triangles in historical frames The The radian value of each interior angle. Let the area similarity of the two triangles be denoted as . triangles to be matched area, triangles in historical frames The area;

[0058] Step 4-2: Obtain the overall similarity score through weighted averaging, and then filter the overall similarity scores. The keyframes corresponding to the historical triangles are used as candidate frames for geometric loop closure. The comprehensive similarity calculation formula is as follows:

[0059]

[0060] in, The combined similarity between the two triangles is given by... This is a weighting coefficient for side length similarity, used to adjust the weight of side length similarity in the overall evaluation. This is a weighting coefficient for angle similarity, used to adjust the weight of angle similarity in the overall evaluation. This is a weighting coefficient for area similarity, used to adjust the weight of area similarity in the overall evaluation;

[0061] Step 5: Joint decision-making based on geometry and vision, and loop closure confirmation:

[0062] Step 5-1: Run two loop closure detection paths in parallel. The visual path uses the DBoW2 bag-of-words model to encode the ORB features of the current frame and historical keyframes, calculates the bag-of-words distance between frames, and marks the visual loop closure candidate frame if the distance is less than the set threshold. The geometric path generates geometric loop closure candidate frames based on the matching results of step 4.

[0063] Step 5-2: If the visual path detects a loop closure candidate frame, the triangle verification decision in this paper is called to perform a consistency check. If the decision passes, it is confirmed as a valid loop closure. In special cases, if the number of triangles in the current keyframe or candidate frame is less than the preset threshold or the candidate frame is not in the triangle database, the geometric decision will return a pass result by default. If the visual path does not detect a loop closure, but the geometric path detects a loop closure candidate frame, it is directly confirmed as a valid loop closure.

[0064] Step 5-3: Input the effective loop closure results into the state estimator, and collaboratively construct a sliding window nonlinear optimization problem with the IMU pre-integration residual and the visual feature reprojection residual. The specific steps are as follows:

[0065] Step 5-3-1: Define the optimized state vector within the sliding window. Includes IMU state at each moment within the window, camera-IMU extrinsic parameters, and front-end pose. The correction amount and feature point location are integrated into the three types of residuals in the form of an information matrix. The Levenberg-Marquardt (LM) algorithm is used to iteratively solve the problem, and the cost function is minimized as shown in the following equation:

[0066]

[0067] in, Represents the cost function. This represents the summation of all relevant items within the window. Represents a robust kernel function. Represents the weighted L2 norm, This is the covariance matrix of the corresponding residuals. Represents the IMU pre-integration residual, Represents the visual reprojection residual. Represents the closure constraint residual. , , These represent the covariance matrices of the three types of residuals, respectively.

[0068] Step 5-3-2: Maintain the window size through an edge-mapping strategy, retain historical constraint information, extract the world coordinate system pose of the latest frame based on the optimized state vector, and append it to the global trajectory list to output a real-time, high-precision trajectory.

[0069] Compared with the prior art, the present invention has the following advantages:

[0070] This invention proposes a visual-inertial SLAM loop closure detection method for unmanned aerial vehicles (UAVs) in forest environments based on triangular geometric features. This method significantly improves the accuracy, robustness, and environmental adaptability of loop closure detection in complex environments with no GNSS, repetitive textures, and variable lighting, thereby optimizing the overall positioning performance of the visual-inertial positioning system. Unlike existing traditional loop closure detection methods based on the bag-of-words model, which rely on visual texture features and are susceptible to environmental interference leading to false positives and false negatives, and those with limited adaptability due to single-modal detection methods, this invention constructs a complementary detection framework that combines tree trunk geometric feature modeling with a visual bag-of-words model. This achieves synergistic interaction between geometric and visual features. The geometric path is based on the stable three-dimensional structure of the tree trunk to construct invariant triangular features, eliminating dependence on visual textures. The visual path relies on the mature bag-of-words model to efficiently capture appearance similarity, ensuring detection efficiency in texture-rich scenes. This design not only effectively suppresses false positives, loops, and missed detections caused by high-repetition textures and lighting variations in the forest canopy, but also balances detection accuracy and real-time performance through an adaptive matching strategy and joint decision-making logic. Furthermore, it eliminates the need for high-performance hardware, meeting the lightweight requirements of embedded UAV devices and providing stable and reliable positioning support for autonomous forest inspection. Experimental results show that compared to the traditional VINS-Mono algorithm, the pose correction accuracy of this invention is improved by 38.46%, the positioning trajectory is smoother, and the continuity and consistency of pose correction are significantly optimized. Attached Figure Description

[0071] Figure 1 This is a block diagram of a UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry;

[0072] Figure 2 It is a special scene of snow under the forest;

[0073] Figure 3 This is a comparison of the loop closure detection and positioning trajectory of the present invention and VINS-Mono in a snowy forest scene;

[0074] Figure 4 This is a detailed comparison of the start and end points of loop closure detection between the present invention and VINS-Mono in a snowy forest scene. Detailed Implementation

[0075] The technical solution of the present invention will be further described below with reference to the accompanying drawings, but it is not limited thereto. Any modifications or equivalent substitutions to the technical solution of the present invention that do not depart from the spirit and scope of the technical solution of the present invention should be covered within the protection scope of the present invention.

[0076] against Figure 2 The invention presents a visual-inertial SLAM loop closure detection method for UAVs in a forest environment without GNSS, based on triangular geometric features. The overall process revolves around multi-source data fusion and geometric-visual collaboration. First, the system simultaneously receives RGB images, depth images, and IMU measurement information. A semantic perception module generates a tree trunk region mask to separate the background from key structures. Then, a point cloud filtering module extracts tree trunk depth data based on the mask and converts it into a 3D point cloud, eliminating invalid background interference. In the geometric modeling module, clustering algorithms locate independent tree trunk positions, constructing invariant triangular geometric features with the trunk positions as vertices. A matching module uses multi-dimensional similarity calculations to correlate features between the current frame and historical frames. A decision module confirms valid loop closures based on complementary geometric and visual logic. Finally, an optimization module combines loop closure constraints and IMU pre-integration residuals to perform global pose optimization, outputting a stable and high-precision positioning trajectory, providing a reliable spatial reference for autonomous UAV inspection in forests. Furthermore, this process strikes a balance between environmental resilience, detection accuracy, and real-time performance, demonstrating its theoretical and engineering value for positioning tasks in complex natural environments under forest canopies. Figure 1 As shown, the specific steps include:

[0077] Step 1: The input visual image data is acquired by an Intel RealSense D455 camera, and the output is an RGB image sequence with a resolution of 640×480 and a frame rate of 30Hz. The depth image is strictly aligned with the RGB image space. The IMU data includes the output of a three-axis accelerometer and gyroscope, with a sampling frequency of 200Hz.

[0078] Step 2: Perform unified preprocessing on RGB images, depth images, and IMU data to generate highly reliable observation data. In image preprocessing, OpenCV is used to correct distortion in the original frames based on the radial and tangential distortion coefficients of the camera's intrinsic components, reconstructing the geometry of the real scene. In IMU data processing, a short-time sliding window is first used to perform mean filtering on the accelerometer and gyroscope outputs to remove high-frequency oscillation noise. Then, the gravity vector direction is estimated based on the acceleration statistics during the initial stationary phase, and the IMU coordinate system is aligned with the visual coordinate system through appropriate rotation. Finally, using the visual keyframe moments as a reference, linear interpolation is used to complete the discrete IMU data between keyframes, providing synchronous, high signal-to-noise ratio observation input for front-end pose propagation and back-end optimization.

[0079] Step 3: Deployment of the Tree Trunk Semantic Segmentation Model: Load the pre-trained existing semantic segmentation model RT-Trunk using the MMDeploy framework. RT-Trunk is a model specifically designed for real-time tree trunk instance segmentation by UAVs under the canopy in complex forest environments. Its core structure is as follows: SparseInst is used as the base framework to ensure real-time performance; the backbone network is replaced with ConvNeXt-T to enhance tree trunk feature extraction capabilities; and a lightweight convolutional block attention module is integrated to enable the model to focus on tree trunk features and suppress irrelevant information, thereby improving segmentation accuracy.

[0080] The algorithm generates a trunk region mask online from the input RGB image, extracts the mask, and merges them into an initial binary trunk mask to achieve preliminary trunk region localization. Combining historical mask caching and the most recent frame mask, a decay fusion strategy is applied to unstable regions (historical mask weights decrease over time). Gaussian blurring smooths edges, and threshold binarization reduces mask noise and jitter, improving mask stability. The optimized binary mask is published through a ROS topic to provide high-quality trunk semantic masks for subsequent visual-inertial fusion tasks, aiding in key feature selection and local enhancement. The output is a binary mask of the same size as the input image. Let the image pixel set be Define semantic mask Distinguish between the tree trunk and the background area:

[0081]

[0082] Step 4, Trunk Depth Filtering and 3D Point Cloud Generation: Apply the trunk mask to the depth image to filter effective depth data, retaining only the depth data of regions with a mask value of 1. , The pixel location representing the image, i.e., the depth map for the tree trunk, combined with the initial pose from within the camera that participates in the front-end output. , the pixel coordinates of the tree trunk depth map With depth value Convert to 3D point cloud data. The 3D point cloud is defined by the formula:

[0083]

[0084] in, Represents the overall collection of three-dimensional point clouds. Represents the first in this point cloud set A three-dimensional point, Representing three-dimensional real space, Representing the first Three-dimensional points In the world coordinate system axis, axis, Axis coordinates.

[0085] In the camera coordinate system:

[0086]

[0087]

[0088]

[0089] in, , , Representing the first The points in the camera coordinate system , , coordinate, and These are the row and column numbers of the pixels in the depth image, respectively. and The pixel coordinates representing the center of the camera's imaging plane. and They represent cameras and Axial focal length.

[0090] Combined with the initial pose output from the front end Convert camera coordinates to world coordinates:

[0091]

[0092] Step 5: 3D point cloud of tree trunk in world coordinate system obtained from Step 4. A density-based clustering algorithm (DBSCAN) is used for clustering analysis to achieve accurate identification of individual tree trunks. This defines any point in the point cloud. of - Neighborhood is:

[0093]

[0094] Among them, symbols represent of - Neighborhood set, This represents a distance threshold, which is set to 0.5m in this embodiment. and These represent any two 3D points in the point cloud. Mark when the minimum number of points is met. Using the core points as the basis, a trunk cluster set is formed by connecting density-reachable points:

[0095]

[0096] Each cluster For each individual tree trunk, based on stable trunk information, a geometrically invariant triangular feature is constructed. Let the set of detected trunk coordinates be:

[0097]

[0098] in, The center coordinates are For any three non-collinear tree trunks in each keyframe, construct a triangle with the coordinates of its three vertices as follows:

[0099]

[0100] The area of ​​a triangle is calculated using a determinant:

[0101]

[0102] A degenerate triangle filtering mechanism is used, with a minimum area threshold set. Only retain those that meet the requirements. The forest exhibits triangular characteristics. In the experimental forest environment, the stand density was 2018 trees / ... It belongs to medium-density forest land. Based on experimental analysis, the value is taken as follows. .

[0103] To facilitate subsequent triangle similarity comparisons, geometric feature vectors are extracted for each triangle. The feature vectors for each triangle are as follows:

[0104]

[0105] in, The lengths of the three sides of the triangle. The three interior angles of a triangle Let the area be the triangle. To achieve triangle matching with historical frames, a multi-dimensional similarity measurement strategy is designed for the two triangles. and The similarity of side length, angle, and area is calculated separately, and then a weighted average is used to obtain the overall similarity.

[0106] Side length similarity:

[0107]

[0108] Angular similarity:

[0109]

[0110] Area similarity:

[0111]

[0112] Overall similarity:

[0113]

[0114] Among these, the side length ratios and interior angles of a triangle, as scale-invariant geometric quantities, can stably characterize the shape of local structures and are highly robust to changes in viewing distance and angle. In contrast, area is more sensitive to scale changes, but as an important component of geometry, area can provide additional complementary shape information and cannot be completely ignored. Therefore, the weights are set to... , , This emphasizes the dominant role of side length and angle in geometric similarity. It also filters for comprehensive similarity. The keyframes corresponding to the historical triangles are used as candidate frames for geometric closure.

[0115] Step Six: Joint Geometric and Visual Decision-Making and Loop Closure Confirmation: The system runs two independent loop closure detection paths in parallel, achieving logical complementarity and joint decision-making. The visual path uses the DBoW2 bag-of-words model to encode the ORB features of the current frame and historical keyframes, calculating the inter-frame bag-of-words distance. If the distance is less than a set threshold, it is marked as a visual loop closure candidate frame. The geometric path generates geometric loop closure candidate frames based on the matching results from Step Seven. If the visual path detects a loop closure candidate frame, it calls the geometric decision module to perform consistency verification. Only after the decision passes is it confirmed as a valid loop closure. In special cases, such as when the number of triangles in the current keyframe or candidate frame is less than the preset threshold, or when the candidate frame is not in the triangle database, the geometric decision defaults to returning a pass result to avoid rejecting the visual detection result due to environmental limitations. If the visual path does not detect a loop closure, but the geometric path detects a loop closure candidate frame, it is directly confirmed as a valid loop closure.

[0116] Step 7: Input the effective loop closure results into the state estimator, and collaboratively construct a sliding window nonlinear optimization problem with the IMU pre-integration residual and the visual feature reprojection residual. Define the optimal state vector within the sliding window. Includes IMU state at each moment within the window, camera-IMU extrinsic parameters, and front-end pose. The correction amount and feature point locations are determined. The three types of residuals are integrated in the form of an information matrix and iteratively solved using the Levenberg-Marquardt (LM) algorithm, minimizing the cost function as shown in the formula:

[0117]

[0118] in, This represents the cost function; a smaller value indicates a better state estimate. This represents the summation of all relevant items within the window. This represents a robust kernel function used to suppress the effects of outliers. Represents the weighted L2 norm, This is the covariance matrix of the corresponding residuals. Represents the IMU pre-integrated residual. Represents the visual reprojection residual. Represents the closure constraint residual. , , These represent the covariance matrices of the three types of residuals. A marginalization strategy is used to maintain the window size, retain historical constraint information, extract the world coordinate system pose of the latest frame based on the optimized state vector, and append it to the global trajectory list to output a real-time, high-precision trajectory.

[0119] Step 8: Analysis and Comparison: Compare the trajectories as follows Figure 3 and Figure 4 As shown in Table 1, the comparison results demonstrate that the present invention outperforms VINS-Mono in terms of cumulative error at both the start and end points. Its technical advantages are reflected in the following two aspects:

[0120] 1. Superior overall positioning accuracy: The starting-end position error of this invention is 0.24m, which is 38.46% lower than VINS-Mono's 0.39m, effectively making up for the shortcomings of the single bag-of-words model in forest texture degradation environment;

[0121] 2. Trajectory stability: The trajectory curve of the present invention is smoother in the overlapping area of ​​the loop, with no obvious jumps, and the continuity of pose correction is significantly improved.

[0122]

Claims

1. A UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry, characterized in that... The method includes the following steps: Step 1: Tree trunk region segmentation and 3D point cloud generation: Step 1-1: Use a semantic segmentation algorithm to segment the input RGB image and generate a binary mask for the tree trunk region; Steps 1-2: Use the binary mask of the tree trunk region to filter the spatially aligned depth image, extract the depth data of the tree trunk region, and combine it with the pose information of the visual inertial odometry in the camera to convert the filtered depth data of the tree trunk region into a 3D point cloud. Step 2, Trunk Clustering Detection and Location: Step 2-1: Use a density-based clustering algorithm to cluster the 3D point cloud of the tree trunk, forming independent tree trunk point cloud clusters, with each cluster corresponding to a single tree trunk; Step 2-2: Calculate the two-dimensional center coordinates of each cluster and use them as the position representation of the trunk to construct the trunk position set. : in, Representing the The two-dimensional center coordinates of the clusters corresponding to each tree trunk; Step 3: Construction and Filtering of Triangle Geometric Features: Step 3-1: Select any three non-collinear tree trunks from the set of tree trunk locations, construct a triangle with their center coordinates as vertices, calculate the area of ​​the triangle using the determinant, set a minimum area threshold to filter out degenerate triangles with an area close to zero, and retain effective geometric features; Step 3-2: For each valid triangle, extract multi-dimensional geometric feature vectors of the three side lengths, three interior angles, and triangle area to form a feature description with geometric invariance; Step 4: Multi-dimensional similarity calculation: For the valid triangles generated in the current frame and the triangles in the historical keyframe triangle database, the similarity of side length, angle, and area are calculated respectively. The comprehensive similarity is obtained by weighted averaging, and potential loop closure candidate frames with high similarity are screened out. Step 5: Joint decision-making based on geometry and vision, and loop closure confirmation: Step 5-1: Run two loop closure detection paths in parallel. The visual path uses the DBoW2 bag-of-words model to encode the ORB features of the current frame and historical keyframes, calculates the bag-of-words distance between frames, and marks the visual loop closure candidate frame if the distance is less than the set threshold. The geometric path generates geometric loop closure candidate frames based on the matching results of step 4. Step 5-2: If the visual path detects a loop closure candidate frame, the triangle verification decision in this paper is called to perform a consistency check. If the decision passes, it is confirmed as a valid loop closure. In special cases, if the number of triangles in the current keyframe or candidate frame is less than the preset threshold or the candidate frame is not in the triangle database, the geometric decision will return a pass result by default. If the visual path does not detect a loop closure, but the geometric path detects a loop closure candidate frame, it is directly confirmed as a valid loop closure. Step 5-3: Input the effective loop closure results into the state estimator, and construct a sliding window nonlinear optimization problem in conjunction with the IMU pre-integration residual and the visual feature reprojection residual.

2. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 1, characterized in that... The specific steps of step 1-1 are as follows: Step 1-1-1: Perform online semantic segmentation inference based on a pre-trained model on the input RGB image, generate a trunk region mask, extract the mask and merge it into an initial trunk binary mask, thereby achieving the initial localization of the trunk region; Step 1-1-2: Combine the historical mask cache with the recent frame mask, adopt the attenuation fusion strategy for unstable areas, and then optimize the initial trunk binary mask by smoothing the edges with Gaussian blur and threshold binarization. Step 1-1-3: Output the optimized binary mask with the same size as the input image. Let the image pixel set be Define semantic mask To distinguish the tree trunk from the background area: 。 3. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 1, characterized in that... The specific steps of steps 1-2 are as follows: Step 1-2-1: Apply the tree trunk mask to the depth image to filter effective depth data, retaining only the depth data of regions with a mask value of 1. , Represents the pixel location of the image, i.e., the depth map for the tree trunk; Step 1-2-2: Combine the pose data from the camera with the visual inertial odometry. , the pixel coordinates of the tree trunk depth map With depth data Convert to 3D point cloud data. The 3D point cloud is defined by the formula: in, Represents the overall collection of three-dimensional point clouds. Represents the first in this point cloud set A three-dimensional point, Representing three-dimensional real space, Representing the first Three-dimensional points In the world coordinate system axis, axis, Axis coordinates , , Representing the first The points in the camera coordinate system , , coordinate, and These are the row and column numbers of the pixels in the depth image, respectively. and The pixel coordinates representing the center of the camera's imaging plane. and They represent cameras and Axial focal length.

4. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 1, characterized in that... The specific steps of step 2-1 are as follows: Define any point in the point cloud of - Neighborhood is: Among them, symbols represent of - Neighborhood set, Represents the distance threshold. and Representing any two 3D points in the point cloud, when Mark when the minimum number of points is met. Using the core points as the basis, a trunk cluster set is formed by connecting density-reachable points: Each cluster Corresponding to a single, independent tree trunk.

5. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 1, characterized in that... The specific steps of step 3-1 are as follows: Step 3-1-1: Construct a triangle for any three non-collinear tree trunks in each keyframe, with the coordinates of its three vertices as follows: in, for The center coordinates; Step 3-1-2, Area of ​​the triangle Calculated using determinant: Step 3-1-3: Employ a degenerate triangle filtering mechanism and set a minimum area threshold. Only retain those that meet the requirements. The triangular features.

6. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 1, characterized in that... In step 3-2, the feature vector of each triangle is as follows: in, The lengths of the three sides of the triangle. The three interior angles of a triangle Let be the area of ​​the triangle.

7. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 1, characterized in that... The specific steps of step 4 are as follows: Step 4-1: To achieve triangle matching with historical frames, a multi-dimensional similarity measurement strategy is designed for the two triangles. and Calculate the similarity of side lengths, angles, and areas respectively; Step 4-2: Obtain the overall similarity score through weighted averaging, and then filter the overall similarity scores. The keyframes corresponding to the historical triangles are used as candidate frames for geometric closure.

8. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 7, characterized in that... In step 4-1, the formulas for calculating side length similarity, angle similarity, and area similarity are as follows: In the formula, To determine the similarity of the side lengths of two triangles, triangles to be matched The The length of the strip, triangles in historical frames The The length of the strip, similarity of angles between two triangles triangles to be matched The The radian value of each interior angle. triangles in historical frames The The radian value of each interior angle. Let the area similarity of the two triangles be denoted as . triangles to be matched area, triangles in historical frames The area.

9. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 8, characterized in that... In step 4-2, the formula for calculating the overall similarity is as follows: in, The combined similarity between the two triangles is given by... This is a weighting coefficient for side length similarity, used to adjust the weight of side length similarity in the overall evaluation. This is a weighting coefficient for angle similarity, used to adjust the weight of angle similarity in the overall evaluation. This is a weighting coefficient for area similarity, used to adjust the weight of area similarity in the overall evaluation.

10. The UAV monocular vision-inertial SLAM loop closure detection method based on forest trunk geometry according to claim 1, characterized in that... The specific steps of step 5-3 are as follows: Step 5-3-1: Define the optimized state vector within the sliding window. Includes IMU state at each time point within the window, camera-IMU extrinsic parameters, and front-end pose. The correction amount and feature point location are integrated into the three types of residuals in the form of an information matrix. The Levenberg-Marquardt algorithm is used to iteratively solve the problem, and the cost function is minimized as shown in the following equation: in, Represents the cost function. This represents the summation of all relevant items within the window. Represents a robust kernel function. Represents the weighted L2 norm, This is the covariance matrix of the corresponding residuals. Represents the IMU pre-integration residual. Represents the visual reprojection residual. Represents the closure constraint residual. , , These represent the covariance matrices of the three types of residuals, respectively. Step 5-3-2: Maintain the window size through an edge-mapping strategy, retain historical constraint information, extract the world coordinate system pose of the latest frame based on the optimized state vector, and append it to the global trajectory list to output a real-time, high-precision trajectory.