A visual SLAM method based on target detection and geometric probability in dynamic scenes

By combining object detection and geometric probability methods in the visual SLAM system, the problem of insufficient positioning accuracy and map construction quality in the dynamic environment is solved, and higher positioning accuracy and map construction quality are achieved.

CN114943741BActive Publication Date: 2025-04-08ANHUI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210624407.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-02
Publication Date
2025-04-08
Estimated Expiration
2042-06-02

AI Technical Summary

Technical Problem

Traditional visual SLAM systems have poor positioning accuracy and graph building quality in dynamic environments, especially due to the existence of dynamic objects, the geometric constraint method is not effective.

Method used

The visual SLAM method based on object detection and geometric probability is adopted, and the image is divided into static and dynamic regions through object detection algorithm. The geometric probability of the dynamic region matching point is calculated using VSAC algorithm and counterpole constraints, and probability expansion is carried out to eliminate feature points that do not meet the probability requirements.

Benefits of technology

It improves the positioning accuracy and mapping quality of SLAM system in dynamic scenarios, ensuring real-time and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114943741B_ABST
    Figure CN114943741B_ABST
Patent Text Reader

Abstract

The present application provides a visual SLAM method based on target detection and geometric probability in a dynamic scene, the steps are: 1) collect the image to be processed, and use the target detection algorithm to divide the image to be processed into a static area and a dynamic area; 2) use the VSAC algorithm to calculate the basic matrix F of the matching points in the static area; 3) use the basic matrix F and the epipolar constraint to calculate the geometric probability of the matching points in the dynamic area; 4) fuse the geometric probabilities of the matching points of two consecutive frames in the dynamic area as the final geometric probability of the matching points in the current frame; 5) perform probability expansion on the unmatched points in the dynamic area to obtain the geometric probability of all feature points in the dynamic area, and eliminate the feature points that do not meet the probability requirements, and pass the remaining points to the subsequent tracking and mapping steps. The present application combines the target detection network with the traditional geometric method to meet the accuracy and real-time requirements of visual SLAM at the same time, which not only ensures real-time performance but also improves positioning accuracy and mapping quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a visual SLAM method, in particular to a visual SLAM method based on target detection and geometric probability in a dynamic scene. Background Art

[0002] SLAM (Simultaneous Localization and Mapping) technology is the core technology of intelligent robot applications. It can estimate its own position and build an environmental map in an unknown environment. Visual SLAM uses cameras as perception sensors. Due to its low cost, high precision and rich information, it has become an important research topic in recent years.

[0003] In the past few decades, many excellent visual SLAMs have emerged, such as ORB-SALM2, KinectFusion, SVO, and DSO; however, traditional visual SLAM systems usually work well in static environments, but when there are dynamic objects in the environment, they only use geometric constraints to eliminate dynamic points, so the effect is poor or even fails. With the development of deep learning technology, we can currently mark dynamic objects through semantic segmentation or target detection networks, and then eliminate all features of dynamic objects. However, the semantic segmentation network cannot guarantee accurate semantic segmentation while ensuring real-time performance; the target detection network can meet real-time requirements, but it will cause some static objects to be eliminated, reducing positioning accuracy and mapping quality. Summary of the invention

[0004] The purpose of the present invention is to provide a visual SLAM method based on target detection and geometric probability in dynamic scenes, which can effectively improve the positioning accuracy of the SLAM system in dynamic scenes.

[0005] The objective of the present invention is achieved through such a technical solution, and the specific steps are as follows:

[0006] 1) Collect the image to be processed and use the target detection algorithm to divide the image to be processed into static area and dynamic area;

[0007] 2) Use the VSAC algorithm to calculate the basic matrix F of the static area matching points;

[0008] 3) Calculate the geometric probability of matching points in the dynamic region using the fundamental matrix F and epipolar constraints;

[0009] 4) The geometric probabilities of the matching points of two consecutive frames in the dynamic area are fused as the final geometric probability of the matching points of the current frame;

[0010] 5) Perform probability expansion on the unmatched points in the dynamic area to obtain the geometric probability of all feature points in the dynamic area, and remove the feature points that do not meet the probability requirements, and pass the remaining points to the subsequent tracking and mapping steps.

[0011] Furthermore, in step 1), the specific steps of using the target detection algorithm to divide the image to be processed into a static area and a dynamic area are:

[0012] 1-1) Use the Crowdhuman dataset to train the Yolov3 tiny object detection network to obtain the trained Yolov3 tiny network;

[0013] 1-2) Use the trained Yolov3 tiny network to divide the image to be processed into dynamic areas and static areas, and extract the feature points of the image to be processed.

[0014] Further, the specific steps of using the VSAC algorithm to calculate the static area matching point basic matrix F in step 2) are:

[0015] 2-1) Perform feature matching on the feature points in the static area. The number of matching points is recorded as N. The matching points are sorted according to their quality, and the minimum sample set is randomly sampled from the high-quality matching points. The basic matrix F is calculated using the numerical method. i ;

[0016] 2-2) Use the adaptive SPRT algorithm to determine the basic matrix F i Whether it satisfies the optimal basic matrix F best If the condition is met, go to step 2-3), if not, return to step 2-1);

[0017] 2-3) Determine whether the minimum sample set of the current basic matrix satisfies the determination condition that Q points are coplanar. If the determination condition is not satisfied, the current basic matrix is ​​not degenerate, and go to step 2-4);

[0018] If the judgment condition is met, randomly select samples outside the minimum sample set and update the current basic matrix F i By verifying the epipolar constraint, it is determined whether it satisfies the restriction condition that there are P points outside the non-dominant plane. If the restriction condition is satisfied, the current basic matrix is ​​not degenerate. If the restriction condition is not satisfied, and the process goes to step 2-4), the current basic matrix is ​​degenerate, the current basic matrix is ​​discarded, and the process returns to step 2-1);

[0019] 2-4) Calculate the basic matrix F i The corresponding number of internal points, if it is better than the current optimal F best If the number of internal points is large, the number of independent internal points is calculated. If the number of independent internal points is greater than the threshold F i Denoted as optimal Fbest , and go to step 2-5), otherwise return to step 2-1);

[0020] 2-5) Determine the current optimal F best Whether the local optimization conditions are met. If the local optimization conditions are met, use F best The interior point set of F best Perform local optimization. If the local optimization conditions are not met, return to step 2-1);

[0021] The judgment condition of the local optimization is: if the number of independent internal points is greater than the threshold And only when the minimum sample set of the current optimal basic matrix and the previous optimal basic matrix is ​​lower than 0.95 Jaccard index, the conditions for local optimization are met, otherwise the conditions for local optimization are not met;

[0022] The local optimization process is as follows: randomly selecting points greater than the minimum number of sample sets from the interior points corresponding to the optimal basic matrix, and iteratively calculating a better basic matrix using an analytical method;

[0023] 2-6) Determine whether the algorithm reaches the loop termination condition. If the loop termination condition is met, go to step 2-7). If the loop termination condition is not met, return to step 2-1). The judgment condition for loop termination is: n is greater than a preset threshold Where η represents the probability that all the currently randomly selected minimum sample sets contain at least one minimum sample set that is all internal points, which is calculated as follows:

[0024] η=(1-P g (1-α)) k

[0025] Where k is the current iteration number, P g represents the probability that all m points in the minimum sample set are internal points, and α represents the probability of rejecting a good model, which is calculated as follows:

[0026] P g =ε m

[0027] α≈1 / A

[0028]

[0029] 2-7) For the optimal F best Use the iterative least squares method for final optimization to obtain the final optimal F best , and the final optimal F best As the basic matrix F of the static area.

[0030] Further, in step 2-2), the adaptive SPRT algorithm is used to determine the basic matrix F i Whether it satisfies the optimal basic matrix F best The specific steps of the conditions are:

[0031] 2-2-1) Construct the basic matrix F i Limitations for using the adaptive SPRT algorithm:

[0032]

[0033] In the formula, and t v Respectively represent whether a point is the current basic matrix F when using and not using adaptive SPRT i The time of the inliers, α is the probability of rejecting a good model, E w (T) is the average number of tested points;

[0034] If satisfied, go to step 2-2-2); if not satisfied, go to step 2-3);

[0035] 2-2-2) Calculate the initial values ​​of the adaptive SPRT parameters: bad model interior point probability δ0 and good model interior point probability ε0:

[0036]

[0037]

[0038]

[0039] Where T is the total number of matching points, and the average number of inliers corresponding to the non-optimal basic matrix in the first n iterations is is the number of interior points corresponding to the current optimal basic matrix F, I δ is through δ0 and The estimated maximum number of interior points corresponding to the non-optimal basic matrix F;

[0040] Let the initial time j = 1, randomly select a matching point outside the minimum sample set, and calculate the SPRT likelihood ratio λ based on Wald j :

[0041]

[0042] In the formula, H b With H g Represent a bad model and a good model respectively, p(x r |H b ) is the probability that a point is a bad model internal point, p(x r |H g) is the probability that a point is a good model interior point; if the data point r is an interior point of the model, then x r =1, otherwise x r =0;

[0043] If j >A, then the current basic matrix is ​​a bad model, and return to step 2-1), where A is the decision threshold;

[0044] If j ≤A, and j>N, then the current basic matrix is ​​a good model, that is, it meets the conditions for becoming the optimal basic matrix, and go to step 2-3);

[0045] If j ≤A, and j≤N, then re-select a point, increment j by 1, and continue to calculate the Wald-based SPRT likelihood ratio until j>N.

[0046] Furthermore, the specific steps of using the basic matrix F and the epipolar constraint to calculate the geometric probability of the dynamic region matching point in step 3) are:

[0047] Use the fundamental matrix F to calculate the epipolar lines of the matching points in the dynamic region Then calculate the distance from the matching point to the epipolar line in the dynamic area

[0048]

[0049]

[0050] Where p′ i and p i is a pair of matching points, x, y, z are the vector parameter representations of the epipolar line;

[0051] The distance from the matching point to the epipolar line in the dynamic area Use binary Sigmod function to convert to geometric probability

[0052]

[0053] Where Dth is the threshold of the distance from static points and dynamic points to the polar line.

[0054] Furthermore, the specific steps of calculating the final geometric probability of the matching point of the current frame in step 4) are:

[0055] According to the previous frame point p′ i Probability value of state probability Predict the current frame point p i Probability value of state probability

[0056]

[0057] According to the previous frame point p′ i Variance of state probabilities Predict the current frame point p i Variance of state probabilities

[0058]

[0059] Where δ0 is the standard deviation of the state probability transition between matching points;

[0060] Calculate the Kalman gain k:

[0061]

[0062] Where δ1 is the standard deviation of the observed state probability of the key point;

[0063] According to point p i The observed state probability Update point p i The state probability of:

[0064]

[0065] In the formula, Represents point p i The state probability of the prediction result in the current frame, Represents point p i The final result of the state probability after passing through the Kalman filter;

[0066] Update point p i Variance of state probabilities:

[0067]

[0068] In the formula, is the current frame point p i The predicted value of the state probability variance.

[0069] Furthermore, in step 5), the probability of unmatched points in the dynamic area is expanded to obtain the geometric probability of all feature points in the dynamic area, and the specific steps of eliminating feature points that do not meet the probability requirements are as follows:

[0070] Search for adjacent feature points p around high-confidence feature points in the dynamic area that do not match the previous frame i , update the adjacent feature point p i The state probability

[0071]

[0072]

[0073] In the formula, p j For point p i Adjacent high confidence feature points, For point p j The state probability, For point p i Observation state probability; C is a constant, λ(d) represents the distance factor;

[0074] like If p is less than the preset threshold, i Divided into dynamic points;

[0075] like If the value is greater than the threshold, it is classified as a static point, and the dynamic points are removed. The static points in the dynamic area are added to the point set in the static area for subsequent positioning and mapping.

[0076] Due to the adoption of the above technical solution, the present invention has the following advantages:

[0077] 1. This application combines the target detection network with the traditional geometric method to simultaneously meet the accuracy and real-time requirements of visual SLAM, which not only ensures real-time performance but also improves positioning accuracy and mapping quality.

[0078] 2. This application uses a target detection algorithm to mark the dynamic and static areas of the image, combines the VSAC algorithm with the epipolar constraint, calculates the geometric probability of matching points in the dynamic area, improves the matching accuracy of image feature points in dynamic scenes, and improves positioning accuracy.

[0079] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] The accompanying drawings of the present invention are as follows.

[0081] Figure 1 The figure is a flow chart of the method of the present invention.

[0082] Figure 2 The present invention is a flow chart of a method for calculating a basic matrix of static area matching points using the VSAC algorithm. DETAILED DESCRIPTION

[0083] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0084] Embodiment 1:

[0085] 1. A visual SLAM method based on target detection and geometric probability in dynamic scenes, the specific steps are as follows:

[0086] 1) Collect the image to be processed and use the target detection algorithm to divide the image to be processed into static area and dynamic area; the specific steps are:

[0087] 1-1) Use the Crowdhuman dataset to train the Yolov3 tiny object detection network to obtain the trained Yolov3 tiny network;

[0088] 1-2) Use the trained Yolov3 tiny network to divide the image to be processed into dynamic areas and static areas, and extract the feature points of the image to be processed.

[0089] 2) Use the VSAC algorithm to calculate the basic matrix F of the static area matching points. The specific steps are:

[0090] 2-1) Perform feature matching on the feature points in the static area. The number of matching points is recorded as N. The matching points are sorted according to their quality, and the minimum sample set is randomly sampled from the high-quality matching points. The basic matrix F is calculated using the numerical method. i .

[0091] In the example of the present invention, the quality of the matching point is the distance from the feature point to the epipolar line, and the first quality is the result of the ratio test of the matching point.

[0092] 2-2) Use the adaptive SPRT algorithm to determine the basic matrix F i Whether it satisfies the optimal basic matrix F best If the conditions are met, go to step 2-3), if not, return to step 2-1). The specific steps are:

[0093] 2-2-1) Construct the basic matrix F i Limitations for using the adaptive SPRT algorithm:

[0094]

[0095] In the formula, and t v Respectively represent whether a point is the current basic matrix F when using and not using adaptive SPRT i The time of the inliers, α is the probability of rejecting a good model, E w (T) is the average number of tested points;

[0096] If satisfied, go to step 2-2-2); if not satisfied, go to step 2-3);

[0097] 2-2-2) Calculate the initial values ​​of the adaptive SPRT parameters: bad model interior point probability δ0 and good model interior point probability ε0:

[0098]

[0099]

[0100]

[0101] Where T is the total number of matching points, and the average number of inliers corresponding to the non-optimal basic matrix in the first n iterations is is the number of interior points corresponding to the current optimal basic matrix F, I δ is through δ0 and The estimated maximum number of interior points corresponding to the non-optimal basic matrix F;

[0102] Let the initial time j = 1, randomly select a matching point outside the minimum sample set, and calculate the SPRT likelihood ratio λ based on Wald j :

[0103]

[0104] In the formula, H b With H g Represent a bad model and a good model respectively, p(x r |H b ) is the probability that a point is a bad model internal point, p(x r |H g ) is the probability that a point is a good model interior point; if the data point r is an interior point of the model, then x r =1, otherwise x r =0;

[0105] If j >A, then the current basic matrix is ​​a bad model, and return to step 2-1), where A is the decision threshold;

[0106] If j ≤A, and j>N, then the current basic matrix is ​​a good model, that is, it meets the conditions for becoming the optimal basic matrix, and go to step 2-3);

[0107] If j ≤A, and j≤N, then re-select a point, increment j by 1, and continue to calculate the Wald-based SPRT likelihood ratio until j>N.

[0108] In the present example, the model estimates the time t M The average number of models is calculated by calculating the time average of the basic matrix and the corresponding number of internal points in the first n iterations. The average number of valid basic matrices corresponding to each feature point in the first n iterations, where n<<N. The decision threshold A is calculated as:

[0109] A n+1 =K1 / K2+1+log(A n )

[0110] Among them, the initial value A0 is K1 / K2+1

[0111] K1=t M / P g

[0112]

[0113]

[0114] 2-3) Determine whether the minimum sample set of the current basic matrix satisfies the determination condition that Q points are coplanar. If the determination condition is not satisfied, the current basic matrix is ​​not degenerate, and go to step 2-4);

[0115] If the judgment condition is met, randomly select samples outside the minimum sample set and update the current basic matrix F i By verifying the epipolar constraint, it is determined whether it satisfies the restriction condition that there are P points outside the non-dominant plane. If the restriction condition is satisfied, the current basic matrix is ​​not degenerate. If the restriction condition is not satisfied, and the process goes to step 2-4), the current basic matrix is ​​degenerate, the current basic matrix is ​​discarded, and the process returns to step 2-1);

[0116] In the example of the present invention, Q is the threshold value of the number of coplanar points in the minimum sample set, and Q=5.

[0117] 2-4) Calculate the basic matrix F i The corresponding number of internal points, if it is better than the current optimal F best If the number of internal points is large, the number of independent internal points is calculated. If the number of independent internal points is greater than the threshold F i Denoted as optimal F best , and go to step 2-5), otherwise return to step 2-1).

[0118] In the example of the present invention, the definition of independent inliers is: excluding points in the minimum sample set, points near independent inliers, and points near the extreme lines of a pair of matching points, and points whose distance from the point to the extreme line is less than a threshold are called independent inliers.

[0119] The threshold calculation method of independent inliers is as follows: Calculate the median number of independent inliers corresponding to the valid basic matrices obtained in the first n (n<<N) iterations (excluding the optimal basic matrix and the basic matrix with a high overlap between the minimum sample set and the optimal matrix), and record it as

[0120] Will As the lambda of the Poisson distribution, calculate the 95% percentile of the Poisson distribution, calculate the average value of the number of independent inliers corresponding to the valid basic matrix obtained in the first n (n<<N) iterations that is less than the 95% percentile, and record it as the independent inlier threshold

[0121] 2-5) Determine the current optimal F best Whether the local optimization conditions are met. If the local optimization conditions are met, use F best The interior point set of F best Perform local optimization. If the local optimization conditions are not met, return to step 2-1);

[0122] The judgment condition of the local optimization is: if the number of independent internal points is greater than the threshold And only when the minimum sample set of the current optimal basic matrix and the previous optimal basic matrix is ​​lower than 0.95 Jaccard index, the conditions for local optimization are met, otherwise the conditions for local optimization are not met;

[0123] The local optimization process is as follows: randomly selecting points greater than the minimum number of sample sets from the interior points corresponding to the optimal basic matrix, and iteratively calculating a better basic matrix using an analytical method;

[0124] 2-6) Determine whether the algorithm reaches the loop termination condition. If the loop termination condition is met, go to step 2-7). If the loop termination condition is not met, return to step 2-1). The judgment condition for loop termination is: n is greater than a preset threshold Where η represents the probability that all the currently randomly selected minimum sample sets contain at least one minimum sample set that is all internal points, which is calculated as follows:

[0125] η=(1-P g (1-α)) k

[0126] Where k is the current iteration number, P g represents the probability that all m points in the minimum sample set are internal points, and α represents the probability of rejecting a good model, which is calculated as follows:

[0127] P g =ε m

[0128] α≈1 / A

[0129]

[0130] 2-7) For the optimal F best Use the iterative least squares method for final optimization to obtain the final optimal F best , and the final optimal F best As the basic matrix F of the static area.

[0131] 3) Use the basic matrix F and the epipolar constraint to calculate the geometric probability of the dynamic region matching points. The specific steps are:

[0132] Use the fundamental matrix F to calculate the epipolar lines of the matching points in the dynamic region Then calculate the distance from the matching point to the epipolar line in the dynamic area

[0133]

[0134]

[0135] Where p′ i and p i is a pair of matching points, x, y, z are the vector parameter representations of the epipolar line;

[0136] The distance from the matching point to the epipolar line in the dynamic area Use binary Sigmod function to convert to geometric probability

[0137]

[0138] Where Dth is the threshold of the distance from static points and dynamic points to the polar line.

[0139] 4) The geometric probabilities of the matching points of two consecutive frames in the dynamic area are fused as the final geometric probability of the matching points of the current frame. The specific steps are as follows:

[0140] According to the previous frame point p′ i Probability value of state probability Predict the current frame point p i Probability value of state probability

[0141]

[0142] According to the previous frame point p′ i Variance of state probabilities Predict the current frame point p i Variance of state probabilities

[0143]

[0144] Where δ0 is the standard deviation of the state probability transition between matching points;

[0145] Calculate the Kalman gain k:

[0146]

[0147] Where δ1 is the standard deviation of the observed state probability of the key point;

[0148] According to point p i The observed state probability Update point p i The state probability of:

[0149]

[0150] In the formula, Represents point p i The state probability of the prediction result in the current frame, Represents point p i The final result of the state probability after passing through the Kalman filter;

[0151] Update point p i Variance of state probabilities:

[0152]

[0153] In the formula, is the current frame point p i The predicted value of the state probability variance.

[0154] In the example of the present invention, the probability transfer of the matching points between two consecutive frames is defined to satisfy the Markov property, that is, the current state is only related to the previous state, and the filtered state probability can be obtained based on the Kalman filter.

[0155] 5) Perform probability expansion on the unmatched points in the dynamic area to obtain the geometric probability of all feature points in the dynamic area, and remove the feature points that do not meet the probability requirements, and pass the remaining points to the subsequent tracking and mapping steps. The specific steps are as follows:

[0156] Based on the idea that the states of adjacent feature points are similar in most cases, we search for adjacent feature points p that do not match the previous frame around the high-confidence feature points in the dynamic region. i , update the adjacent feature point p i The state probability

[0157]

[0158]

[0159] In the formula, p j For point p i Adjacent high confidence feature points, For point p j The state probability, For point p i Observation state probability; C is a constant, λ(d) represents the distance factor;

[0160] like If p is less than the preset threshold, i Divided into dynamic points;

[0161] like If the value is greater than the threshold, it is classified as a static point, and the dynamic points are removed. The static points in the dynamic area are added to the point set in the static area for subsequent positioning and mapping.

[0162] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0163] 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.

[0164] 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.

[0165] 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 The steps for the functions specified in one or more boxes.

[0166] Finally, 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 above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A visual SLAM method based on target detection and geometric probability in dynamic scenes, characterized in that: The specific steps are as follows: 1) Collect the image to be processed and use the target detection algorithm to divide the image to be processed into static area and dynamic area; 2) Use the VSAC algorithm to calculate the basic matrix F of the static area matching points; 3) Calculate the geometric probability of matching points in the dynamic region using the fundamental matrix F and epipolar constraints; 4) The geometric probabilities of the matching points of two consecutive frames in the dynamic area are fused as the final geometric probability of the matching points of the current frame; 5) Perform probability expansion on the unmatched points in the dynamic area to obtain the geometric probability of all feature points in the dynamic area, and remove the feature points that do not meet the probability requirements, and pass the remaining points to the subsequent tracking and mapping steps; The specific steps of using the VSAC algorithm to calculate the static area matching point basic matrix F in step 2) are: 2-1) Perform feature matching on the feature points in the static area. The number of matching points is recorded as N. The matching points are sorted according to their quality, and the minimum sample set is randomly sampled from the high-quality matching points. The basic matrix F is calculated using the numerical method. i ; 2-2) Use the adaptive SPRT algorithm to determine the basic matrix F i Whether it satisfies the optimal basic matrix F best If the condition is met, go to step 2-3), if not, return to step 2-1); 2-3) Determine whether the minimum sample set of the current basic matrix satisfies the determination condition that Q points are coplanar. If the determination condition is not satisfied, the current basic matrix is ​​not degenerate, and go to step 2-4); If the judgment condition is met, randomly select samples outside the minimum sample set and update the current basic matrix F i By verifying the epipolar constraint, it is determined whether it satisfies the restriction condition that there are P points outside the non-dominant plane. If the restriction condition is satisfied, the current basic matrix is ​​not degenerate. If the restriction condition is not satisfied, and the process goes to step 2-4), the current basic matrix is ​​degenerate, the current basic matrix is ​​discarded, and the process returns to step 2-1); 2-4) Calculate the basic matrix F i The corresponding number of internal points, if it is better than the current optimal F best If the number of internal points is large, the number of independent internal points is calculated. If the number of independent internal points is greater than the threshold F i Denoted as optimal F best , and go to step 2-5), otherwise return to step 2-1); 2-5) Determine the current optimal F best Whether the local optimization conditions are met. If the local optimization conditions are met, use F best The interior point set of F best Perform local optimization. If the local optimization conditions are not met, return to step 2-1); The judgment condition of the local optimization is: if the number of independent internal points is greater than the threshold And only when the minimum sample set of the current optimal basic matrix and the previous optimal basic matrix is ​​lower than 0.95 Jaccard index, the conditions for local optimization are met, otherwise the conditions for local optimization are not met; The local optimization process is as follows: randomly selecting points greater than the minimum number of sample sets from the interior points corresponding to the optimal basic matrix, and iteratively calculating a better basic matrix using an analytical method; 2-6) Determine whether the algorithm reaches the loop termination condition. If the loop termination condition is met, go to step 2-7). If the loop termination condition is not met, return to step 2-1). The judgment condition for loop termination is: n is greater than a preset threshold Where η represents the probability that all the currently randomly selected minimum sample sets contain at least one minimum sample set that is all internal points, which is calculated as follows: n=(1-P g (1-a)) k Where k is the current iteration number, P g represents the probability that all m points in the minimum sample set are internal points, and α represents the probability of rejecting a good model, which is calculated as follows: P g =e m α≈1 / A 2-7) For the optimal F best Use the iterative least squares method for final optimization to obtain the final optimal F best , and the final optimal F best As the basic matrix F of the static area; The specific steps of using the basic matrix F and the epipolar constraint to calculate the geometric probability of the dynamic region matching point in step 3) are: Use the fundamental matrix F to calculate the epipolar lines of the matching points in the dynamic region Then calculate the distance from the matching point to the epipolar line in the dynamic area Where p′ i and p i is a pair of matching points, x, y, z are the vector parameter representations of the epipolar line; The distance from the matching point to the epipolar line in the dynamic area Use binary Sigmod function to convert to geometric probability Where Dth is the threshold of the distance from static points and dynamic points to the polar line; The specific steps of calculating the final geometric probability of the matching point of the current frame in step 4) are: According to the previous frame point p i ′Probability value of state probability Predict the current frame point p i Probability value of state probability According to the previous frame point p i ′The variance of state probability Predict the current frame point p i Variance of state probabilities Where δ0 is the standard deviation of the state probability transition between matching points; Calculate the Kalman gain k: Where δ1 is the standard deviation of the observed state probability of the key point; According to point p i The observed state probability Update point p i The state probability of: In the formula, Represents point p i The state probability of the prediction result in the current frame, Represents point p i The final result of the state probability after passing through the Kalman filter; Update point p i Variance of state probabilities: In the formula, is the current frame point p i The predicted value of the state probability variance; In step 5), the probability of unmatched points in the dynamic area is expanded to obtain the geometric probability of all feature points in the dynamic area, and the specific steps of eliminating feature points that do not meet the probability requirements are as follows: Search for adjacent feature points p around high-confidence feature points in the dynamic area that do not match the previous frame i , update the adjacent feature point p i The state probability In the formula, p j For point p i Adjacent high confidence feature points, For point p j The state probability, For point p i Observation state probability; C is a constant, λ(d) represents the distance factor; like If p is less than the preset threshold, i Divide into dynamic points; like If the value is greater than the threshold, it is classified as a static point, and the dynamic points are removed. The static points in the dynamic area are added to the point set in the static area for subsequent positioning and mapping.

2. A visual SLAM method based on target detection and geometric probability in a dynamic scene as claimed in claim 1, characterized in that: The specific steps of using the target detection algorithm in step 1) to divide the image to be processed into static areas and dynamic areas are: 1-1) Use the Crowdhuman dataset to train the Yolov3 tiny object detection network to obtain the trained Yolov3 tiny network; 1-2) Use the trained Yolov3 tiny network to divide the image to be processed into dynamic areas and static areas, and extract the feature points of the image to be processed.

3. A visual SLAM method based on target detection and geometric probability in a dynamic scene as claimed in claim 1, characterized in that: Step 2-2) uses the adaptive SPRT algorithm to determine the basic matrix F i Whether it satisfies the optimal basic matrix F best The specific steps of the conditions are: 2-2-1) Construct the basic matrix F i Limitations for using the adaptive SPRT algorithm: In the formula, and t v Respectively represent whether a point is the current basic matrix F when using and not using adaptive SPRT i The time of the inliers, α is the probability of rejecting a good model, E w (T) is the average number of tested points; If satisfied, go to step 2-2-2); if not satisfied, go to step 2-3); 2-2-2) Calculate the initial values ​​of the adaptive SPRT parameters: bad model interior point probability δ0 and good model interior point probability ε0: Where T is the total number of matching points, and the average number of internal points corresponding to the non-optimal basic matrix in the first n iterations is is the number of interior points corresponding to the current optimal basic matrix F, I δ is through δ0 and The estimated maximum number of interior points corresponding to the non-optimal basic matrix F; Let the initial time j = 1, randomly select a matching point outside the minimum sample set, and calculate the SPRT likelihood ratio λ based on Wald j : In the formula, H b With H g Represent a bad model and a good model respectively, p(x r |H b ) is the probability that a point is a bad model internal point, p(x r |H g ) is the probability that a point is a good model interior point; if the data point r is an interior point of the model, then x r =1, otherwise x r =0; If j >A, then the current basic matrix is ​​a bad model, and return to step 2-1), where A is the decision threshold; If j ≤A, and j>N, then the current basic matrix is ​​a good model, that is, it meets the conditions for becoming the optimal basic matrix, and go to step 2-3); If j ≤A, and j≤N, then re-select a point, increment j by 1, and continue to calculate the Wald-based SPRT likelihood ratio until j>N.

Citation Information

Patent Citations

  • SLAM method of RGB-D camera in dynamic scene

    CN111914832A

  • Visual SLAM method and device based on dynamic target detection

    CN112435278A