Visual SLAM algorithm improvement method for collaborative operation of unmanned aerial vehicle and robot
Through the improved SuperPoint algorithm and SuperGlue closed-loop optimization algorithm, combined with GhostNet and B-spline curves, the positioning accuracy and robustness problems of traditional visual SLAM in low-texture scenes are solved, efficient feature extraction and closed-loop matching are achieved, and the Positioning accuracy and safe flight trajectory planning for power transmission lines.
Patent Information
- Application Number
- CN202410333852.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-22
- Publication Date
- 2024-08-30
AI Technical Summary
Traditional visual SLAM has serious mismatching in feature extraction in low-texture scenes such as power transmission lines, and its feature tracking performance is low under illumination changes, resulting in low positioning accuracy and poor robustness.
The improved SuperPoint algorithm is used combined with the GhostNet lightweight network for feature extraction and tracking, and SuperGlue's improved closed-loop optimization algorithm is used to construct a grid map of transmission lines based on visual SLAM, and the UAV flight trajectory is optimized through B-spline curves to avoid obstacle.
It improves the positioning accuracy and robustness of the visual SLAM system in transmission lines, reduces the instability of feature point extraction, enhances the accuracy of closed-loop matching and global relocation capabilities, and avoids the memory consumption of large-scale maps.
Smart Images

Figure CN118570420A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle control, and in particular to a method for improving a visual SLAM algorithm for collaborative operation of a unmanned aerial vehicle and a robot. Background Art
[0002] The feature texture in the transmission line is weak, and the transmission towers of various tower shapes are all spatial truss structures. In order to improve the accuracy of the visual odometer, the feature extraction method used needs to fully describe the feature information of the transmission line. Traditional visual SLAM uses feature associations between image pairs by tracking artificially designed point features. FAST corner points and BRIEF descriptors are used by ORBSLAM2 / 3 for feature extraction and matching in the visual odometer module due to their small computational complexity and rotation and scale invariance. However, in low-texture scenes such as transmission lines, a large number of mismatches will still occur; VINS-Mono, as a classic visual inertial SLAM, uses the Harris feature point detection algorithm and tracks feature points through the optical flow algorithm, but the feature tracking performance is low in scenes with obvious lighting changes; although artificially designed point features are easy to extract and describe, the stability of artificially designed point features is low due to the imbalance of scenes and lighting perspectives, which has a great impact on the robustness of the algorithm. Summary of the invention
[0003] In view of the above existing problems, the present invention is proposed.
[0004] Therefore, the present invention provides a method for improving a visual SLAM algorithm for collaborative operation of a drone and a robot, which can solve problems that traditional methods cannot solve.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions, a method for improving a visual SLAM algorithm for collaborative operation of a drone and a robot, comprising:
[0006] The improved SuperPoint algorithm is used to improve the feature extraction and feature tracking modules, and the GhostNet lightweight network is used to replace the VGG-like encoding layer in the SuperPoint network; a closed-loop optimization algorithm based on the SuperGlue improvement is constructed; and a transmission line grid map based on visual SLAM is constructed.
[0007] As a preferred solution of the visual SLAM algorithm improvement method for cooperative operation of drones and robots described in the present invention, the improved SuperPoint algorithm includes: in order to improve the positioning accuracy of the visual SLAM system in the power transmission line, a visual inertial odometer based on a self-supervised feature extraction network is used, and the visual odometer is implemented by combining SuperPoint feature points with the LK optical flow method. Feature tracking does not rely on the SuperPoint descriptor feature map for feature matching between frames to ensure the real-time performance of the system. The decoding thread of the feature description is only turned on during relocation and closed-loop optimization. The loss function is as follows:
[0008] L(X,X′,D,D′,Y,Y′,S)
[0009] =L p (X,Y)+L p (X′,Y′)+λL d (D,D′,S)
[0010] Among them, X and D are the feature extraction map and feature description map of the input SuperPoint network, respectively, Y is the feature point label value, and X′, Y′ and D′ are generated after homography transformation; S is described by the formula, L p and L d They represent the feature extraction loss function and the feature description loss function respectively. As shown in the formula, the hyperparameter λ is used to maintain the feature extraction loss and the feature description loss:
[0011]
[0012] Among them, H c ,W c Respectively represent the height and width of the feature extraction graph; x hw and hw Represent the values of X and Y at (h,w) respectively.
[0013] As a preferred solution of the improved method of visual SLAM algorithm for cooperative operation of drones and robots described in the present invention, wherein: the improved SuperPoint algorithm also includes:
[0014] l p The specific formula is as follows:
[0015]
[0016] In the formula, l p So that x hw The value of the channel corresponding to the label value y is as large as possible, hw The value of the kth channel is given by x hwk express;
[0017] Feature description loss function L d The specific formula is as follows:
[0018]
[0019] Where, d hw ,d h′w′ represents the value of D, D′ at (h, w), (h′, w′). After downsampling by the shared encoder, the points in the output feature description map correspond to the image units of 8×8 pixels in the input image frame; s hwh′w′ To judge d hw The corresponding input image center position passes through the original Figure 1 After the homography transformation, is it in d′ h′w′ Corresponding to the center position of the input image unit; s hwh′w′ To judge d hw ,d′ h′w′ Whether the corresponding positions in the original image are close; hwh′w′ =1 indicates positive correspondence, otherwise it indicates negative correspondence;
[0020] s hwh′w′ With l d The specific formula is as follows:
[0021]
[0022] In the formula, p hw and p h′w′ Indicates that hw and d h′w′ The corresponding center position of the input image unit; Hp hw Indicates that p hw Do the same homography transformation as the original image:
[0023] l d (d; d′; s) = λ d ·s·max(0,m p -d T d′)+(1-s)·max(0,d T d′-m n )
[0024] In the formula, the hyperparameter λ d Used to balance the positive and negative corresponding loss values within the descriptor, the hyperparameter m p is the positive corresponding threshold, m n It is the negative corresponding threshold.
[0025] As a preferred solution of the visual SLAM algorithm improvement method for cooperative operation of drones and robots described in the present invention, the construction of the improved closed-loop optimization algorithm based on SuperGlue includes: constructing a global relocalization algorithm for a drone dense point cloud map based on SuperGlue, and the visual SLAM relocalization module includes three parts: loop detection, feature matching between loop candidates, and pose graph optimization; loop detection mainly realizes the function of searching for robot position information based on the global map. When the camera passes through the historical position again, loop detection can quickly compare the current frame with the historical frame. If the similarity between the two frames is higher than the threshold, the historical frame is used as the loop frame, and the transformation matrix between the current frame and the loop frame is further solved through feature matching to form a closed-loop constraint term; pose graph optimization usually adds a closed-loop constraint term to the overall objective function, and performs nonlinear optimization to optimize the closed loop and correct the global pose;
[0026] SuperGlue provides more accurate feature matching and outliers for the loop detection thread of visual SLAM than the brute force matching algorithm. The loss function is constructed by the content aggregation mechanism proposed based on the attention mechanism, which enables SuperGlue to match 2D image features while perceiving 3D scenes. The network of the SuperGlue algorithm consists of an attention graph neural network and an optimal matching layer module; the feature points and feature descriptors extracted by the deep neural network are encoded into a feature matching vector f through the attention GNN structure, and the feature matching performance of the vector is enhanced by the self-attention mechanism and the cross-attention mechanism; the optimal matching layer first solves the matching score matrix according to the inner product of the feature matching vector, and then solves the optimal feature allocation matrix through the Sinkhorn algorithm.
[0027] As a preferred solution of the improved method of visual SLAM algorithm for collaborative operation of drones and robots described in the present invention, the attention graph neural network includes a complete graph and each feature point a in the image as a node to simulate the process of human brain browsing image information for matching, including two different undirected edges: Intra-image edgesε for connecting internal feature points of the image self and Crossedgesε used to connect feature point a with all other feature points cross ; The expression representing the ath element of image A at layer L, information m ε→a Aggregate all feature point information {b:(a,b)∈ε}, where ε∈{ε self ,ε cross}; Therefore, all feature a in image A pass the updated residual information as follows:
[0028]
[0029] Where [·||·] represents a series operation, MLP is a multilayer perceptron; when the number of layers L is an odd number or an even number, ε corresponds to ε cross ,ε self ; through m ε The update is alternated between self and cross to simulate the process of human brain matching images; local feature points are obtained through convolution, and the key point encoder is used to map the key point coordinates p and the descriptor d obtained by SuperPoint into a vector f, and a more representative feature descriptor f is obtained by alternating between self and cross. a , as follows:
[0030]
[0031] Where W and b are weights and biases, and image B is processed similarly to image A. For M and N local feature points in images A and B, the optimized matching layer first constructs the distribution matrix P∈[0,1] M×N , satisfying P1 N ≤1 M , For all possible matching points, the descriptor obtained by calculating the inner product of the GNN part The similarity of , then the matching pair score is as follows:
[0032]
[0033] Similar to standard graph matching, the assignment matrix P is calculated by the score matrix S∈R M×N Get and maximize the total score∑ a, b S a,b P a,b , the maximum total score is transformed into the optimal transmission problem; in order to remove the mismatched feature points, the dusbin channel is added to the last row and column of the score matrix S to obtain the augmented matrix S; in addition, entropy regularization is added in combination with the Sinkhorn algorithm to limit the complexity of the optimal transmission problem;
[0034] Pose graph optimization can not only improve the inter-frame cumulative error in the global map, but also merge the current map with the preloaded map to correct the positioning error. Due to the accumulation of drift errors, the current frame i and the loop frame j exist in different coordinate systems w, w′. The goal of the relocalization module is to correct the coordinate system after the error accumulation to the original world coordinate system w. Through the SuperGlue network, the matching point pairs of the two frames can be obtained, and the relative pose T of the loop frame and the current frame can be solved using PnP. ij, used for pose graph optimization; since the gravity vector has been corrected in the system initialization phase, the pitch angle φ and roll angle θ can be observed according to the gravity direction during pose graph optimization, so only the position p(x, y, z) and yaw angle Optimize and summarize that when loop detection is successful, the residual term between loop frame j and current frame i is:
[0035]
[0036]
[0037]
[0038]
[0039] Where the superscript hat is the noisy measurement value, the sets Q and Γ represent the sequence edges and loop edges in the factor graph respectively, and for the closed loop edge set, the huber function is used to reduce the impact of false loops.
[0040] As a preferred solution of the visual SLAM algorithm improvement method for cooperative operation of drones and robots described in the present invention, the construction of a grid map of power transmission lines based on visual SLAM includes, through multiple observations, finally judging the state of a point, a point in the map is represented in the form of probability, the probability of a point usually occupied by an obstacle is represented as p (s = 0), the probability of a free point is represented as p (s = 1), and the sum of the two probabilities is 1; the ratio of the two is introduced as the state of the grid:
[0041]
[0042] When the depth camera observes new data, the grid state needs to be updated:
[0043]
[0044] When z occurs, the current state of the grid can be derived by Bayes' theorem:
[0045]
[0046]
[0047] Substituting in:
[0048]
[0049] Taking the logarithm of both sides, the grid state is expressed as the logarithm of probability:
[0050]
[0051] It can be seen from the formula that the current grid state logOdd(s|z) can be obtained from the current measurement value The sum of the last measurement value logOdd(s) represents that in order to balance the computational complexity and the perception range of the drone, the local mapping range is set to. The algorithm first projects the observed depth point cloud to the world coordinates, and then uses a loop to traverse all grids. If a grid in the map is in a new observation, the current grid state is updated, otherwise the previous grid state is used; after each update, the threshold is used to determine whether the current grid is occupied.
[0052] As a preferred solution of the visual SLAM algorithm improvement method for cooperative operation of drones and robots described in the present invention, the construction of a transmission line grid map based on visual SLAM also includes parameterization of drone flight trajectory and obstacle distance estimation. B-splines are often used for curve design and curve fitting, which are determined by three major factors, namely control points, nodes and orders, which are defined as follows:
[0053]
[0054] Among them, P i ,i=0,1,…,N is the control point, N i,k (t), i = 0, 1, ..., N is the i-th k-order B-spline basis function; the B-spline basis function is a piecewise k + 1-order polynomial, which is uniquely determined by the node vector, and the node vector U = {u0, u1, u2, ..., u m ∣u0≤u1≤…≤u m , m=N+k-1} is a non-decreasing number set. If the nodes are evenly spaced, it is called a uniform B-spline. The i-th k-order B-spline basis function defined by the Cox-de Boor recursive formula is:
[0055]
[0056]
[0057] The convex hull property of the B-spline curve shows that the spline curve is contained in the convex hull of the control polyline if u is in the knot interval [u i ,u i+1 ), then the spline curve at the control point {P i-k ,P i-k+1 ,…,P i The flight trajectory is determined by the control points. The optimization algorithm makes the control points stay away from obstacles. The flight trajectory is confined to the convex hull composed of the control points, ensuring that the flight trajectory is also in a safe area away from obstacles.
[0058] As a preferred solution of the visual SLAM algorithm improvement method for the cooperative operation of drones and robots described in the present invention, the construction of the power transmission line grid map based on visual SLAM also includes that the l-th order derivative of the k-th order B-spline curve is a kl-th order B-spline curve, which ensures the continuity of the speed and acceleration of the trajectory represented by the B-spline; in order to simplify the difficulty of trajectory optimization and improve efficiency, the flight trajectory of the drone is parameterized as a uniform B-spline, and the optimization variable is the control point P i ; B-spline nodes are uniformly spaced at equal intervals Δt = u i+1 -u i , then, the speed, acceleration and maneuverability of the flight trajectory can be determined by the control point P i Difference obtained:
[0059]
[0060] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, steps of an improved method for a visual SLAM algorithm for collaborative operation of a drone and a robot are implemented.
[0061] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, steps of a method for improving a visual SLAM algorithm for collaborative operation of a drone and a robot are implemented.
[0062] Beneficial effects of the present invention: In order to improve the positioning accuracy of the visual SLAM system in the power transmission line, the present invention adopts a visual inertial odometer based on a self-supervised feature extraction network. Unlike traditional visual SLAM, after extracting feature points through a deep neural network, high-quality feature point extraction can be ensured for each frame of the image. However, in the power transmission line, the feature point extraction is unstable due to the rapid change of illumination. Therefore, the present invention uses an improved SuperPoint algorithm to improve the feature extraction and feature tracking modules for the VINS-Mono framework, so that the VI-SLAM system has strong robustness for low-light scenes.
[0063] The visual SLAM relocalization module designed by the present invention mainly includes three parts: loop detection, feature matching between loop candidates, and pose graph optimization. Loop detection mainly realizes the function of searching for robot position information based on the global map. When the camera passes through the historical position again, loop detection can quickly compare the current frame with the historical frame. If the similarity between the two frames is higher than the threshold, the historical frame can be used as a loop frame, and the transformation matrix between the current frame and the loop frame can be further solved through spatial feature matching to form a closed-loop constraint term. Pose graph optimization usually adds a closed-loop constraint term to the overall objective function and performs nonlinear optimization to optimize the closed loop and correct the global pose. Among them, the accuracy of matching between loop frames directly affects the positioning and global relocalization accuracy of the SLAM system. Therefore, the present invention proposes an improved closed-loop optimization algorithm based on SuperGlue.
[0064] The present invention constructs a grid map of the local environment based on a depth camera, avoiding the memory consumption caused by storing large-scale maps in an onboard computer. Secondly, based on the good convex hull characteristics of B-splines, the trajectory is parameterized using B-splines, and the distance between the UAV flight trajectory and obstacles is modeled. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0066] Figure 1 A schematic diagram of a deep neural network feature extraction and description algorithm based on improved SuperPoint for an improved method of visual SLAM algorithm for collaborative operation of drones and robots provided by an embodiment of the present invention.
[0067] Figure 2 A feature matching effect diagram of the HPatches data set of an improved method for a visual SLAM algorithm for collaborative operation of a drone and a robot provided by an embodiment of the present invention.
[0068] Figure 3 A comparison chart of homography estimation accuracy of an improved method for a visual SLAM algorithm for collaborative operation of a drone and a robot provided by an embodiment of the present invention.
[0069] Figure 4 A schematic diagram of a closed-loop optimization algorithm based on SuperGlue for an improved method of a visual SLAM algorithm for collaborative operation of a drone and a robot provided by an embodiment of the present invention.
[0070] Figure 5A local grid map of a power transmission line constructed by an improved method of a visual SLAM algorithm for collaborative operation of a drone and a robot is provided in one embodiment of the present invention.
[0071] Figure 6 A B-spline convex hull characteristic diagram of an improved method for a visual SLAM algorithm for collaborative operation of a drone and a robot provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0072] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0073] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0074] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0075] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0076] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0077] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0078] Example 1
[0079] Reference Figure 1 , which is the first embodiment of the present invention, and provides a method for improving a visual SLAM algorithm for collaborative operation of a drone and a robot, comprising:
[0080] S1: Use the improved SuperPoint algorithm to improve the feature extraction and feature tracking modules, and use the GhostNet lightweight network to replace the VGG-like encoding layer in the SuperPoint network.
[0081] The improved SuperPoint algorithm includes: in order to improve the positioning accuracy of the visual SLAM system in the power transmission line, a visual inertial odometer based on a self-supervised feature extraction network is used. The visual odometer is implemented by combining SuperPoint feature points with the LK optical flow method. Feature tracking does not rely on the SuperPoint descriptor feature map for feature matching between frames to ensure the real-time performance of the system. The decoding thread of the feature description is only turned on during relocation and closed-loop optimization. The loss function is as follows:
[0082] L(X,X′,D,D′,Y,Y′,S)
[0083] =L p (X,Y)+L p (X′,Y′)+λL d (D,D′,S)
[0084] Among them, X and D are the feature extraction map and feature description map of the input SuperPoint network, respectively, Y is the feature point label value, and X′, Y′ and D′ are generated after homography transformation; S is described by the formula, L p and L d They represent the feature extraction loss function and the feature description loss function respectively. As shown in the formula, the hyperparameter λ is used to maintain the feature extraction loss and the feature description loss:
[0085]
[0086] Among them, H c ,W c Respectively represent the height and width of the feature extraction graph; xhw and hw Represent the values of X and Y at (h,w) respectively.
[0087] l p The specific formula is as follows:
[0088]
[0089] In the formula, l p So that x hw The value of the channel corresponding to the label value y is as large as possible, hw The value of the kth channel is given by x hwk express;
[0090] Feature description loss function L d The specific formula is as follows:
[0091]
[0092] Where, d hw ,d h′w′ represents the value of D, D′ at (h, w), (h′, w′). After downsampling by the shared encoder, the points in the output feature description map correspond to the image units of 8×8 pixels in the input image frame; s hwh′w′ To judge d hw The corresponding input image center position passes through the original Figure 1 After the homography transformation, is it in d′ h′w′ Corresponding to the center position of the input image unit; s hwh′w′ To judge d hw ,d′ h′w′ Whether the corresponding positions in the original image are close; hwh′w′ =1 indicates positive correspondence, otherwise it indicates negative correspondence;
[0093] s hwh′w′ With l d The specific formula is as follows:
[0094]
[0095] In the formula, p hw and p h′w′ Indicates that hw and d h′w′ The corresponding center position of the input image unit; Hp hw Indicates that p hw Do the same homography transformation as the original image:
[0096] l d (d; d′; s) = λ d ·s·max(0,m p -dT d′)+(1-s)·max(0,d T d′-m n )
[0097] In the formula, the hyperparameter λ d Used to balance the positive and negative corresponding loss values within the descriptor, the hyperparameter m p is the positive corresponding threshold, m n It is the negative corresponding threshold.
[0098] S2: Build an improved closed-loop optimization algorithm based on SuperGlue.
[0099] The construction of the improved closed-loop optimization algorithm based on SuperGlue includes: constructing a global relocalization algorithm for a dense point cloud map of a UAV based on SuperGlue, and the visual SLAM relocalization module includes three parts: loop detection, feature matching between loop candidates, and pose graph optimization; loop detection mainly realizes the function of searching for robot position information based on a global map. When the camera passes through a historical position again, loop detection can quickly compare the current frame with the historical frame. If the similarity between the two frames is higher than a threshold, the historical frame is used as a loop frame, and the transformation matrix between the current frame and the loop frame is further solved through feature matching to form a closed-loop constraint item; pose graph optimization usually adds a closed-loop constraint item to the overall objective function, and performs nonlinear optimization to optimize the closed loop and correct the global pose;
[0100] SuperGlue provides more accurate feature matching and outliers for the loop detection thread of visual SLAM than the brute force matching algorithm. The loss function is constructed by the content aggregation mechanism proposed based on the attention mechanism, which enables SuperGlue to match 2D image features while perceiving 3D scenes. The network of the SuperGlue algorithm consists of an attention graph neural network and an optimal matching layer module; the feature points and feature descriptors extracted by the deep neural network are encoded into a feature matching vector f through the attention GNN structure, and the feature matching performance of the vector is enhanced by the self-attention mechanism and the cross-attention mechanism; the optimal matching layer first solves the matching score matrix according to the inner product of the feature matching vector, and then solves the optimal feature allocation matrix through the Sinkhorn algorithm.
[0101] The attention graph neural network includes a complete graph and each feature point a in the image as a node to simulate the process of the human brain browsing image information for matching, including two different undirected edges: Intra-image edges ε for connecting internal feature points of the image self and Cross edges ε used to connect feature point a with all other feature points cross ; The expression representing the ath element of image A at layer L, information m ε→a Aggregate all feature point information {b:(a,b)∈ε}, where ε∈{ε self ,ε cross}; Therefore, all feature a in image A pass the updated residual information as follows:
[0102]
[0103] Where [·||·] represents a series operation, MLP is a multilayer perceptron; when the number of layers L is an odd number or an even number, ε corresponds to ε cross ,ε self ; through m ε The update is alternated between self and cross to simulate the process of human brain matching images; local feature points are obtained through convolution, and the key point encoder is used to map the key point coordinates p and the descriptor d obtained by SuperPoint into a vector f, and a more representative feature descriptor f is obtained by alternating between self and cross. a , as follows:
[0104]
[0105] Where W and b are weights and biases, and image B is processed similarly to image A. For M and N local feature points in images A and B, the optimized matching layer first constructs the distribution matrix P∈[0,1] M×N ,satisfy For all possible matching points, the descriptor obtained by calculating the inner product of the GNN part The similarity of , then the matching pair score is as follows:
[0106]
[0107] Similar to standard graph matching, the assignment matrix P is calculated by the score matrix S∈R M×N Get and maximize the total score∑ a, b S a,b P a,b , the maximum total score is transformed into the optimal transmission problem; in order to remove the mismatched feature points, the dusbin channel is added to the last row and column of the score matrix S to obtain the augmented matrix S; in addition, entropy regularization is added in combination with the Sinkhorn algorithm to limit the complexity of the optimal transmission problem;
[0108] Pose graph optimization can not only improve the inter-frame cumulative error in the global map, but also merge the current map with the preloaded map to correct the positioning error. Due to the accumulation of drift errors, the current frame i and the loop frame j exist in different coordinate systems w, w′. The goal of the relocalization module is to correct the coordinate system after the error accumulation to the original world coordinate system w. Through the SuperGlue network, the matching point pairs of the two frames can be obtained, and the relative pose T of the loop frame and the current frame can be solved using PnP. ij , used for pose graph optimization; since the gravity vector has been corrected in the system initialization phase, the pitch angle φ and roll angle θ can be observed according to the gravity direction during pose graph optimization, so only the position p(x, y, z) and yaw angle Optimize and summarize that when loop detection is successful, the residual term between loop frame j and current frame i is:
[0109]
[0110]
[0111]
[0112]
[0113] Where the superscript hat is the noisy measurement value, the sets Q and Γ represent the sequence edges and loop edges in the factor graph respectively, and for the closed loop edge set, the huber function is used to reduce the impact of false loops.
[0114] S3: Construct a grid map of power transmission lines based on visual SLAM.
[0115] The construction of the power transmission line grid map based on visual SLAM includes, through multiple observations, finally judging the state of a point, a point in the map is represented in the form of probability, usually the probability of a point occupied by an obstacle is represented as p (s = 0), the probability of a free point is represented as p (s = 1), and the sum of the two probabilities is 1; the ratio of the two is introduced as the state of the grid:
[0116]
[0117] When the depth camera observes new data, the grid state needs to be updated:
[0118]
[0119] When z occurs, the current state of the grid can be derived by Bayes' theorem:
[0120]
[0121]
[0122] Substituting in:
[0123]
[0124] Taking the logarithm of both sides, the grid state is expressed as the logarithm of probability:
[0125]
[0126] It can be seen from the formula that the current grid state logOdd(s|z) can be obtained from the current measurement value The sum of the last measurement value logOdd(s) represents that in order to balance the computational complexity and the perception range of the drone, the local mapping range is set to. The algorithm first projects the observed depth point cloud to the world coordinates, and then uses a loop to traverse all grids. If a grid in the map is in a new observation, the current grid state is updated, otherwise the previous grid state is used; after each update, the threshold is used to determine whether the current grid is occupied.
[0127] UAV flight trajectory parameterization and obstacle distance estimation, B-spline is often used for curve design and curve fitting, which is determined by three major factors, namely control points, nodes and orders, which are defined as follows:
[0128]
[0129] Among them, P i ,i=0,1,…,N is the control point, N i,k (t), i = 0, 1, ..., N is the i-th k-order B-spline basis function. The B-spline basis function is a piecewise k + 1-order polynomial, which is uniquely determined by the node vector. The node vector U = {u0, u1, u2, ..., u m ∣u0≤u1≤…≤u m , m=N+k-1} is a non-decreasing number set. If the nodes are evenly spaced, it is called a uniform B-spline. The i-th k-order B-spline basis function defined by the Cox-de Boor recursive formula is:
[0130]
[0131]
[0132] The convex hull property of the B-spline curve shows that the spline curve is contained in the convex hull of the control polyline if u is in the knot interval [u i ,u i+1 ), then the spline curve at the control point {P i-k ,P i-k+1 ,…,P iThe flight trajectory is determined by the control points. The optimization algorithm makes the control points stay away from obstacles. The flight trajectory is confined to the convex hull composed of the control points, ensuring that the flight trajectory is also in a safe area away from obstacles.
[0133] The l-order derivative of the k-order B-spline curve is the kl-order B-spline curve, which ensures the continuity of the velocity and acceleration of the trajectory represented by the B-spline. In order to simplify the difficulty of trajectory optimization and improve the efficiency, the flight trajectory of the UAV is parameterized as a uniform B-spline, and the optimization variable is the control point P. i ; B-spline nodes are uniformly spaced at equal intervals Δt = u i+1 -u i , then, the speed, acceleration and maneuverability of the flight trajectory can be determined by the control point P i Difference obtained:
[0134]
[0135] Example 2
[0136] Reference Figure 1-Figure 6 , which is an embodiment of the present invention, provides a method for improving the visual SLAM algorithm for collaborative operation of drones and robots. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.
[0137] In order to improve the positioning accuracy of the visual SLAM system in the power transmission line, a visual inertial odometer based on a self-supervised feature extraction network is used. Unlike traditional visual SLAM, after extracting feature points through a deep neural network, high-quality feature point extraction can be ensured for each frame of the image. However, in the power transmission line, due to the rapid change of light, the feature point extraction is unstable. Therefore, this paper uses the improved SuperPoint algorithm to improve the feature extraction and feature tracking modules for the VINS-Mono framework, so that the VI-SLAM system has strong robustness for low-light scenes. SuperPoint is a self-supervised full convolutional network encoding layer, feature detection layer and decoding layer to form its network framework. When processing the input image, SuperPoint uses a VGG-like encoding layer to reduce the dimension of the image. However, the architecture has a large number of network layers, and the amount of redundant information in the extracted high-dimensional features is large, so there is room for improvement. GhostNet uses a similar residual block structure, which is conducive to expanding the receptive field range of the feature map by expanding first and then compressing; at the same time, a series of linear operations are added to make the network pay more attention to the key information in the feature data, so the robustness of the image features is improved. This paper uses GhostNet lightweight network to replace the VGG-like encoding layer in the SuperPoint network, improving its feature encoding capability while ensuring the real-time operation of the system. The feature detection layer and feature description layer use the original decoding layer structure. The improved network framework is as follows: Figure 1 shown.
[0138] The visual odometer is implemented by combining SuperPoint feature points with the LK optical flow method. Feature tracking does not rely on the SuperPoint descriptor feature map for inter-frame feature matching to ensure the real-time performance of the system. The decoding thread of the feature description is only enabled during relocalization and closed-loop optimization. The loss function is shown in formula (2-1):
[0139]
[0140] In formula (2-1), X and D are the feature extraction graph and
[0141] ″′
[0142] Feature description graph, Y is the feature point label value, after homography transformation, X, Y and D are generated. S is described by formula (2-5), L p and L d They represent the feature extraction loss function and the feature description loss function respectively, as shown in formulas (2-2) and (2-3). The hyperparameter λ is used to maintain the feature extraction loss and the feature description loss.
[0143]
[0144] Among them, H c ,W c Respectively represent the height and width of the feature extraction graph. hw and hw Represents the values of X and Y at (h,w). p The specific formula is as follows.
[0145]
[0146] In formula (2-3), l p So that x hw The value of the channel corresponding to the label value y is as large as possible, hw The value of the kth channel is given by x hwk Represents. Feature description loss function L d The specific formula is as follows:
[0147]
[0148] In formula (2-4), d hw ,d h′w′ represents the value of D, D′ at (h, w), (h′, w′). After downsampling by the shared encoder, the points in the output feature description map correspond to the image units of 8×8 pixels in the input image frame; s hwh′w′ To judge dhw The corresponding input image center position passes through the original Figure 1 After the homography transformation, is it in d′ h′w′ Corresponding to the center position of the input image unit; s hwh′w′ To judge d hw ,d′ h′w′ Whether the corresponding positions in the original image are close; hwh′w′ =1 indicates positive correspondence, otherwise it indicates negative correspondence; s hwh′w′ With l d The specific formula is as follows:
[0149]
[0150] In formula (2-5), p hw and p h′w′ Indicates that hw and d h′w′ The corresponding center position of the input image unit; Hp hw Indicates that p hw Do the same homography transformation as the original image:
[0151] l d (d; d′; s) = λ d ·s·max(0,m p -d T d′)+(1-s)·max(0,d T d′-m n ) (2-6)
[0152] In formula (2-6), the hyperparameter λ d Used to balance the positive and negative corresponding loss values within the descriptor, the hyperparameter m p is the positive corresponding threshold, m n It is the negative corresponding threshold.
[0153] To ensure that the improved SuperPoint network meets the requirements of real-time operation. The training data is preprocessed in a multi-scale and multi-homography manner to improve the repeatability and adaptability of feature points. The first 7 layers of the GhostNet network are embedded in SuperPoint, the first layer is the input layer, and the last 6 layers use the GhostNet bottleneck module. The width coefficient is 1.25 to enrich the feature information. The MS-COCO dataset is converted into a grayscale image. The improved network model is self-supervised trained on the PyTorch1.2 framework. The hyperparameter settings are consistent with SuperPoint. The Adam optimizer is used, the learning rate is set to 0.001, and the batch size is set to 16.
[0154] The intuitive feature matching results of using VGG, MoblieNetV3 and GhostNet3 feature extraction networks on the dataset are as follows Figure 2 As shown in the figure, the illumination change scene and the perspective change scene are considered, the feature extraction threshold is set to 0.01, the descriptor matching threshold is set to 0.5, RANSAC is used to select matching points, and the feature point repeatability (Repeatability) and the mean average precision (mAP) of the descriptor matching are used as the performance indicators of feature point detection and descriptor matching.
[0155] The Hpatches dataset is used to evaluate the homography estimation accuracy of the deep neural network improved with different encoding layers. The experimental results are shown in Table 1.
[0156] Table 1 Comparison results of feature detection and matching performance
[0157]
[0158] By analyzing Table 1 and Figure 3 It can be concluded that: in the scene of changing illumination, the feature point repetition index is higher than that of the traditional artificial feature detectors Harris and Shi tomasi; in the scene of changing perspective, the feature point repetition of the three networks is comparable to the performance of the traditional artificial feature detector. Among them, the feature extraction performance of the feature detection network using GhostNet encoding is better.
[0159] The visual SLAM relocalization module designed in this paper mainly includes three parts: loop detection, feature matching between loop candidates, and pose graph optimization. Loop detection mainly realizes the function of searching for robot position information based on the global map. When the camera passes through the historical position again, loop detection can quickly compare the current frame with the historical frame. If the similarity between the two frames is higher than the threshold, the historical frame can be used as a loop frame. The transformation matrix between the current frame and the loop frame is further solved through spatial feature matching to form a closed-loop constraint term. Pose graph optimization usually adds closed-loop constraints to the overall objective function and performs nonlinear optimization to optimize the closed loop and correct the global pose. Among them, the accuracy of matching between loop frames directly affects the positioning and global relocalization accuracy of the SLAM system. Therefore, this paper proposes an improved closed-loop optimization algorithm based on SuperGlue. The overall block diagram of the algorithm is shown in the following figure. Figure 4 shown.
[0160] As an efficient feature matching algorithm, SuperGlue can provide more accurate feature matching for the loop detection thread of visual SLAM than the brute force matching algorithm and filter out outliers. Its loss function is constructed by NN, and the content aggregation mechanism proposed based on the attention mechanism enables SuperGlue to match 2D image features while perceiving 3D scenes. The network of the SuperGlue algorithm is mainly composed of the attention graph neural network and the optimal matching layer module. The feature points and feature descriptors extracted by the deep neural network are encoded into the feature matching vector f through the attention GNN structure, and the feature matching performance of the vector is enhanced by the self-attention mechanism and the cross-attention mechanism; the optimal matching layer first solves the matching score matrix according to the inner product of the feature matching vector, and then solves the optimal feature allocation matrix through the Sinkhom algorithm.
[0161] (1) Attention Graph Neural Network
[0162] Through a complete graph and each feature point a in the image as a node, the process of human brain browsing image information for matching is simulated. This graph includes two different undirected edges: Intra-image edges ε used to connect feature points inside the image self and Cross edges ε used to connect feature point a in this graph A with all feature points in other graphs B cross . The expression representing the ath element of image A at layer L, information m ε→a Aggregate all feature point information {b:(a,b)∈ε}, where ε∈{ε self ,ε cross}. Therefore, all feature a in image A pass the updated residual information as follows.
[0163]
[0164] Where [·||·] represents a series operation, and MLP is a multilayer perceptron. When the number of layers L is an odd number or an even number, ε corresponds to ε cross ,ε self . By m ε The update is alternated between self and cross to simulate the process of human brain matching images. Local feature points are obtained through convolution, and the key point encoder is used to map the key point coordinates p and the descriptor d obtained through SuperPoint into a vector f. A more representative feature descriptor f is obtained by alternating between self and cross. a , as shown below.
[0165]
[0166] Where W and b are weights and biases, and image B is processed similarly to image A.
[0167] (2) Optimizing the matching layer
[0168] For M and N local feature points in images A and B, the optimized matching layer first constructs the assignment matrix P∈[0,1] M×N ,satisfy For all possible matching points, the descriptor obtained by calculating the inner product of the GNN part The similarity of , then the matching pair score is as follows.
[0169]
[0170] Similar to standard graph matching, the assignment matrix P is calculated by the score matrix S∈R M×N Get and maximize the total score∑ a, b S a,b P a,b , the maximum total score is transformed into the optimal transmission problem. In order to remove the mismatched feature points, the dusbin channel is added to the last row and column of the score matrix S to obtain the augmented matrix S; in addition, entropy regularization is added in combination with the Sinkhorn algorithm to limit the complexity of the optimal transmission problem.
[0171] (3) Pose graph optimization
[0172] Pose graph optimization can not only improve the inter-frame cumulative error in the global map, but also merge the current map with the preloaded map to correct the positioning error. Due to the accumulation of drift errors, the current frame i and the loop frame j exist in different coordinate systems w, w′. The goal of the relocalization module is to correct the coordinate system after the error accumulation to the original world coordinate system w. Through the SuperGlue network, the matching point pairs of the two frames can be obtained, and the relative pose T between the loop frame and the current frame can be solved using PnP. ij , used for pose graph optimization. Since the gravity vector has been corrected in the system initialization phase, the pitch angle φ and roll angle θ can be observed according to the gravity direction during pose graph optimization. Therefore, only the position p(x, y, z) and yaw angle It is concluded that when the loop detection is successful, the residual term between the loop frame j and the current frame i is:
[0173]
[0174]
[0175]
[0176]
[0177] Where the superscript hat is the noisy measurement value, the sets Q and Γ represent the sequence edges and loop edges in the factor graph respectively, and for the closed loop edge set, the huber function is used to reduce the impact of false loops.
[0178] This paper constructs a grid map of the local environment based on the depth camera, avoiding the memory consumption caused by storing large-scale maps in the onboard computer. Secondly, based on the good convex hull characteristics of B-splines, B-splines are used to parameterize the trajectory and model the distance between the UAV flight trajectory and obstacles.
[0179] (1) Construction and maintenance of local grid maps of transmission lines
[0180] The sparse point cloud generated by visual SLAM is often difficult to be used directly by the motion planning system, and the measurement error of the sensor also leads to inaccurate obstacle judgment. Therefore, a suitable map representation method will help reduce the difficulty of motion planning and improve the reliability of planning. Grid maps are widely used in robot motion planning systems. They transform continuous physical space into discrete grids with a certain resolution. Each grid has two states: occupied and unoccupied. The motion planning system can directly determine whether a grid is occupied to determine whether the grid is an obstacle. From the final state, a point in the map is either occupied or free, and its state is determined. However, there are errors in the sensor, and a single observation may be wrong. Therefore, a point in the map may lead to an incorrect state judgment due to inaccurate observation. Therefore, we need to observe multiple times to finally determine the state of a point. A point in the map can be represented in the form of probability. The probability of a point occupied by an obstacle is usually expressed as p(s=0), and the probability of a free point is expressed as p(s=1). The sum of the two probabilities is 1. The ratio of the two is introduced as the state of the grid:
[0181]
[0182] When the depth camera observes new data, the grid state needs to be updated:
[0183]
[0184] When z occurs, the current state of the grid can be derived by Bayes' theorem:
[0185]
[0186]
[0187] Substituting equation (2-16) and equation (2-17) into equation (2-15), we can get:
[0188]
[0189] Taking the logarithm of both sides, the grid state is expressed as the logarithm of probability:
[0190]
[0191] From formula (2-19), we can know that the current grid state log Odd (s|z) can be obtained from the current measurement value and the sum of the last measured value log Odd(s). In order to balance the computational complexity and the perception range of the drone, the local mapping range is set to. The algorithm first projects the observed depth point cloud to the world coordinates, and then uses a loop to traverse all grids. If a grid in the map is in a new observation, the grid state is updated using formula (2-19), otherwise the previous grid state is used. After each update, the threshold is used to determine whether the grid is occupied. The grid map also needs to be further expanded according to the radius of the drone. The advantage is that the drone can be regarded as a particle when performing motion planning in the configuration space, which simplifies the difficulty of motion planning. Figure 5 A schematic diagram of the transmission line grid map after expansion processing is given.
[0192] (2) UAV flight trajectory parameterization and obstacle distance estimation
[0193] B-spline is often used for curve design and curve fitting. It is determined by three major factors: control points, nodes, and order. The definitions are as follows:
[0194]
[0195] Among them, P i ,i=0,1,…,N is the control point, N i,k (t), i = 0, 1, ..., N is the i-th k-order B-spline basis function. The B-spline basis function is a piecewise k + 1-order polynomial, which is uniquely determined by the node vector. The node vector U = {u0, u1, u2, ..., u m ∣u0≤u1≤…≤u m , m=N+k-1} is a non-decreasing number set. If the nodes are evenly spaced, it is called a uniform B-spline. The i-th k-th order B-spline basis function defined by the Cox-de Boor recursive formula is:
[0196]
[0197]
[0198] The convex hull property of the B-spline curve shows that the spline curve is contained in the convex hull of the control line. i ,ui+1 ), then the spline curve at the control point {P i-k ,P i-k+1 ,…,P i}. Figure 6 As shown, the flight trajectory is determined by the control points. The optimization algorithm makes the control points stay away from obstacles. The flight trajectory is confined to the convex hull composed of the control points, ensuring that the flight trajectory is also in a safe area away from obstacles.
[0199] The l-th order derivative of the k-th order B-spline curve is the kl-th order B-spline curve. This excellent property ensures the continuity of the velocity and acceleration of the trajectory represented by the B-spline. The good characteristics of the B-spline make it very suitable for the trajectory planning of UAVs. In order to simplify the difficulty of trajectory optimization and improve efficiency, the flight trajectory of the UAV is parameterized as a uniform B-spline, and the optimization variable is the control point P i The nodes of the B-spline are uniformly spaced at intervals of Δt = u i+1 -u i Then, the speed, acceleration and maneuverability of the flight trajectory can be determined by the control point P i Difference obtained:
[0200]
[0201] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
[0202] Example 3
[0203] The third embodiment of the present invention is different from the first two embodiments in that:
[0204] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0205] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0206] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0207] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0208] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0209] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0210] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. An improved method for visual SLAM algorithm for collaborative operation between drones and robots. Features: include, The improved SuperPoint algorithm is used to improve the feature extraction and feature tracking modules, and the GhostNet lightweight network is used to replace the VGG-like encoding layer in the SuperPoint network; Build an improved closed-loop optimization algorithm based on SuperGlue; Construct a grid map of power transmission lines based on visual SLAM.
2. The method for improving the visual SLAM algorithm for collaborative operation of a drone and a robot as claimed in claim 1, Features: The improved SuperPoint algorithm includes: in order to improve the positioning accuracy of the visual SLAM system in the power transmission line, a visual inertial odometer based on a self-supervised feature extraction network is used. The visual odometer is implemented by combining SuperPoint feature points with the LK optical flow method. Feature tracking does not rely on the SuperPoint descriptor feature map for feature matching between frames to ensure the real-time performance of the system. The decoding thread of the feature description is only turned on during relocation and closed-loop optimization. The loss function is as follows: L(X,X′,D,D′,Y,Y′,S) =L p (X,Y)+L p (X′,Y′)+λL d (D,D′,S) Among them, X and D are the feature extraction map and feature description map of the input SuperPoint network, respectively, Y is the feature point label value, and X′, Y′ and D′ are generated after homography transformation; S is described by the formula, L p and L d They represent the feature extraction loss function and the feature description loss function respectively. As shown in the formula, the hyperparameter λ is used to maintain the feature extraction loss and the feature description loss: Among them, H c ,W c Respectively represent the height and width of the feature extraction graph; x hw and hw Represent the values of X and Y at (h,w) respectively.
3. The method for improving the visual SLAM algorithm for collaborative operation of a drone and a robot as described in claim 2, Features: The improved SuperPoint algorithm also includes: l p The specific formula is as follows: In the formula, l p So that x hw The value of the channel corresponding to the label value y is as large as possible, hw The value of the kth channel is given by x hwk express; Feature description loss function L d The specific formula is as follows: Where, d hw ,d h′w′ represents the value of D, D′ at (h, w), (h′, w′). After downsampling by the shared encoder, the points in the output feature description map correspond to the image units of 8×8 pixels in the input image frame; s hwh′w′ To judge d hw After the center position of the corresponding input image is transformed into the same homography as the original image, is it in d′? h′w′ Corresponding to the center position of the input image unit; s hwh′w′ To judge d hw ,d′ h′w′ Whether the corresponding positions in the original image are close; hwh′w′ =1 indicates positive correspondence, otherwise it indicates negative correspondence; s hwh′w′ With l d The specific formula is as follows: In the formula, p hw and p h′w′ Indicates that hw and d h′w′ The center position of the corresponding input image unit; Hp hw Indicates that p hw Do the same homography transformation as the original image: L d (d;d′;s)=λ d ·s·max(0,m p -d T d′)+(1-s)·max(0,d T d′-m n ) In the formula, the hyperparameter λ d Used to balance the positive and negative corresponding loss values within the descriptor, the hyperparameter m p is the positive corresponding threshold, m n It is the negative corresponding threshold.
4. The method for improving the visual SLAM algorithm for collaborative operation of a drone and a robot as described in claim 3, Features: The construction of the improved closed-loop optimization algorithm based on SuperGlue includes: constructing a global relocalization algorithm for a dense point cloud map of a UAV based on SuperGlue, and the visual SLAM relocalization module includes three parts: loop detection, feature matching between loop candidates, and pose graph optimization; loop detection mainly realizes the function of searching for robot position information based on a global map. When the camera passes through a historical position again, loop detection can quickly compare the current frame with the historical frame. If the similarity between the two frames is higher than a threshold, the historical frame is used as a loop frame, and the transformation matrix between the current frame and the loop frame is further solved through feature matching to form a closed-loop constraint item; pose graph optimization usually adds a closed-loop constraint item to the overall objective function, and performs nonlinear optimization to optimize the closed loop and correct the global pose; SuperGlue provides more accurate feature matching and outliers for the loop detection thread of visual SLAM than the brute force matching algorithm. The loss function is constructed by the content aggregation mechanism proposed based on the attention mechanism, which enables SuperGlue to match 2D image features while perceiving 3D scenes. The network of the SuperGlue algorithm consists of an attention graph neural network and an optimal matching layer module; the feature points and feature descriptors extracted by the deep neural network are encoded into a feature matching vector f through the attention GNN structure, and the feature matching performance of the vector is enhanced by the self-attention mechanism and the cross-attention mechanism; the optimal matching layer first solves the matching score matrix according to the inner product of the feature matching vector, and then solves the optimal feature allocation matrix through the Sinkhorn algorithm.
5. The method for improving the visual SLAM algorithm for collaborative operation of a drone and a robot as claimed in claim 4, Features: The attention graph neural network includes a complete graph and each feature point a in the image as a node to simulate the process of the human brain browsing image information for matching, including two different undirected edges: Intra-image edges ε for connecting internal feature points of the image self and Cross edges ε used to connect feature point a with all other feature points cross ; The expression representing the ath element of image A at layer L, information m ε→a Aggregate all feature point information {b:(a,b)∈ε}, where ε∈{ε self ,ε cross }; Therefore, all feature a in image A pass the updated residual information as follows: Where [·∥·] represents a serial operation, MLP is a multilayer perceptron; when the number of layers L is an odd number or an even number, ε corresponds to ε cross ,ε self ; through m ε The update is alternated between self and cross to simulate the process of human brain matching images; local feature points are obtained through convolution, and the key point encoder is used to map the key point coordinates p and the descriptor d obtained by SuperPoint into a vector f, and a more representative feature descriptor f is obtained by alternating between self and cross. a , as follows: Where W and b are weights and biases, and image B is processed similarly to image A. For M and N local feature points in images A and B, the optimized matching layer first constructs the distribution matrix P∈[0,1] M×N , satisfying P1 N ≤1 M , For all possible matching points, the descriptor obtained by calculating the inner product of the GNN part The similarity of , then the matching pair score is as follows: Similar to standard graph matching, the assignment matrix P is calculated by the score matrix S∈R M×N Get and maximize the total score∑ a,b S a, b P a,b , the maximum total score is transformed into the optimal transmission problem; in order to remove the mismatched feature points, the dusbin channel is added to the last row and column of the score matrix S to obtain the augmented matrix S; in addition, entropy regularization is added in combination with the Sinkhorn algorithm to limit the complexity of the optimal transmission problem; Pose graph optimization can not only improve the inter-frame cumulative error in the global map, but also merge the current map with the preloaded map to correct the positioning error. Due to the accumulation of drift errors, the current frame i and the loop frame j exist in different coordinate systems w, w′. The goal of the relocalization module is to correct the coordinate system after the error accumulation to the original world coordinate system w. Through the SuperGlue network, the matching point pairs of the two frames can be obtained, and the relative pose T of the loop frame and the current frame can be solved using PnP. ij , used for pose graph optimization; since the gravity vector has been corrected in the system initialization phase, the pitch angle φ and roll angle θ can be observed according to the gravity direction during pose graph optimization, so only the position p(x, y, z) and yaw angle Optimize and summarize that when loop detection is successful, the residual term between loop frame j and current frame i is: Where the superscript hat is the noisy measurement value, the sets Q and Γ represent the sequence edges and loop edges in the factor graph respectively, and for the closed loop edge set, the huber function is used to reduce the impact of false loops.
6. The method for improving the visual SLAM algorithm for collaborative operation of a drone and a robot as claimed in claim 5, Features: The construction of the power transmission line grid map based on visual SLAM includes, through multiple observations, finally judging the state of a point, a point in the map is represented in the form of probability, usually the probability of a point occupied by an obstacle is represented as p (s = 0), the probability of a free point is represented as p (s = 1), and the sum of the two probabilities is 1; the ratio of the two is introduced as the state of the grid: When the depth camera observes new data, the grid state needs to be updated: When z occurs, the current state of the grid can be derived by Bayes' theorem: Substituting in: Taking the logarithm of both sides, the grid state is expressed as the logarithm of probability: It can be seen from the formula that the current grid state logOdd(s|z) can be obtained from the current measurement value The sum of the last measurement value logOdd(s) represents that in order to balance the computational complexity and the perception range of the drone, the local mapping range is set to. The algorithm first projects the observed depth point cloud to the world coordinates, and then uses a loop to traverse all grids. If a grid in the map is in a new observation, the current grid state is updated, otherwise the previous grid state is used; after each update, the threshold is used to determine whether the current grid is occupied.
7. The method for improving the visual SLAM algorithm for collaborative operation of a drone and a robot as claimed in claim 6, Features: The construction of the transmission line grid map based on visual SLAM also includes the parameterization of the UAV flight trajectory and the estimation of the obstacle distance. B-spline is often used for curve design and curve fitting, which is determined by three major factors, namely control points, nodes and orders, which are defined as follows: Among them, P i ,i=0,1,…,N is the control point, N i,k (t), i = 0, 1, ..., N is the i-th k-order B-spline basis function; the B-spline basis function is a piecewise k + 1-order polynomial, uniquely determined by the node vector, the node vector U = {u 0 ,u 1 ,u 2 ,…,u m ∣u 0 ≤u 1 ≤…≤u m , m=N+k-1} is a non-decreasing number set. If the nodes are evenly spaced, it is called a uniform B-spline. The i-th k-order B-spline basis function defined by the Cox-de Boor recursive formula is: The convex hull property of the B-spline curve shows that the spline curve is contained in the convex hull of the control polyline if u is in the knot interval [u i ,u i+1 ), then the spline curve at the control point {P i-k ,P i-k+1 ,…,P i The flight trajectory is determined by the control points. The optimization algorithm makes the control points stay away from obstacles. The flight trajectory is confined to the convex hull composed of the control points, ensuring that the flight trajectory is also in a safe area away from obstacles.
8. The method for improving the visual SLAM algorithm for collaborative operation of a drone and a robot as claimed in claim 7, Features: The construction of a power transmission line grid map based on visual SLAM also includes: The l-order derivative of the k-order B-spline curve is the kl-order B-spline curve, which ensures the continuity of the velocity and acceleration of the trajectory represented by the B-spline. In order to simplify the difficulty of trajectory optimization and improve the efficiency, the flight trajectory of the UAV is parameterized as a uniform B-spline, and the optimization variable is the control point P. i ; B-spline nodes are uniformly spaced at equal intervals Δt = u i+1 -u i , then, the speed, acceleration and maneuverability of the flight trajectory can be determined by the control point P i Difference obtained:
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Multi-view engine jet pipe swing angle measuring method based on non-cooperative measurement
CN119540461A
Livestock and poultry inspection robot based on multi-sensor fusion and SLAM method
CN120422190A
Real-time feature extraction network and construction method
CN122223357A
