Simultaneous localization and mapping method fusing enhanced YOLOv7

Through image deblurring and adaptive threshold ORB feature point extraction, combined with enhanced YOLOv7 and epipolar constraints to eliminate dynamic feature points, the problem of poor robustness of traditional SLAM in dynamic environments is solved, and the accuracy and robustness of positioning and mapping are improved. sex.

CN118776546APending Publication Date: 2024-10-15CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410734795.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Traditional visual SLAM has poor robustness in dynamic environments, resulting in poor image blur and poor feature point extraction. Static feature points are misjudged as dynamic feature points, affecting pose estimation accuracy and system robustness.

Method used

The DeblurGAN2 network is used for image deblurring, adaptive thresholds are introduced to improve ORB feature point extraction, the YOLOv7 algorithm is enhanced and combined with epipolar constraints to eliminate dynamic feature points, improving image quality and feature point accuracy.

Benefits of technology

It improves the accuracy and robustness of the SLAM system, enhances positioning and mapping capabilities in complex environments, and reduces feature point redundancy and misjudgment rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118776546A_ABST
    Figure CN118776546A_ABST
Patent Text Reader

Abstract

The invention requests to protect a simultaneous localization and mapping method fusing and enhancing YOLOv7. The method comprises the following steps: S1, acquiring environment information by using an RGB-D camera; s2, an image enhancement module is introduced for the problem of image blurring caused by robot movement and camera shaking, and an image obtained by a camera is preprocessed; s3, in a tracking thread, introducing an adaptive threshold to improve a traditional ORB feature point extraction method, and performing feature extraction on the preprocessed image; and S4, detecting a dynamic target by using an enhanced YOLOv7 algorithm, and removing dynamic feature points in combination with epipolar constraint. And S5, using the retained static feature points for pose estimation and subsequent mapping. According to the method, the dynamic feature points can be effectively eliminated, so that the robustness of an SLAM (colleague localization and mapping) system in a dynamic environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of mobile robot autonomous navigation, and specifically is a simultaneous positioning and mapping method that integrates enhanced YOLOv7. Background Art

[0002] Simultaneous Localization and Mapping (SLAM) refers to the robot completing its own positioning and building a map of the surrounding environment without any prior information. It plays a very important role in the field of mobile robots. Traditional visual SLAM relies on static assumptions, assuming that the surrounding environment is unchanged, but this assumption is not valid in real environments. Moving objects (such as pedestrians, moving cars, etc.) will inevitably appear in real environments. Dynamic environments will produce many incorrect data associations, resulting in reduced accuracy of visual SLAM systems, so traditional visual SLAM systems have poor robustness. In order to solve the problems of traditional visual SLAM, visual SLAM in dynamic environments came into being. The essence of visual SLAM in dynamic environments is to eliminate feature points belonging to dynamic objects to reduce the impact of dynamic objects on the SLAM system. According to the different methods used, it can be divided into dynamic visual SLAM based on geometry and dynamic visual SLAM based on deep learning. Dynamic visual SLAM based on geometry eliminates dynamic features by extracting geometric information of the environment. The commonly used method is the maximum consistency scheme. In addition, many visual SALM systems use multi-sensor fusion methods to detect dynamic targets in the environment. However, these methods can only work when there are fewer dynamic objects, and they cannot obtain high-level information in the environment, and their understanding of the environment is insufficient. Dynamic visual SLAM based on deep learning can also be called semantic SLAM. This method can not only obtain geometric information of unfamiliar environments and the motion state of robots, but also detect and identify targets in the scene and then remove dynamic feature points, so that robots can better understand the environment and work in more complex environments.

[0003] Although many semantic SLAMs currently have good effects in dynamic environments, they still have some problems. First, many semantic SLAM methods ignore the problem of unclear images due to camera shake during the movement of mobile robots, which leads to poor results in the system's extraction of geometric and semantic information. Second, deep learning methods such as semantic segmentation and target detection have limitations. Some methods only remove feature points based on the results of semantic segmentation or target detection, which will cause two problems: (1) Many static feature points are considered to be dynamic feature points and are removed, resulting in a reduction in useful features and the system being unable to perform pose estimation; (2) Some dynamic objects cannot be completely removed, affecting the accuracy and robustness of the subsequent system. Finally, the traditional ORB (Oriented FAST and Rotated BRIEF) feature point extraction method uses a fixed threshold, which is greatly affected by ambient light, resulting in the problem of failure to extract feature points and local feature point redundancy. Summary of the invention

[0004] The present invention aims to solve the above problems of the prior art. A simultaneous localization and mapping method integrating enhanced YOLOv7 is proposed. The technical solution of the present invention is as follows:

[0005] A simultaneous positioning and mapping method integrating enhanced YOLOv7, comprising the following steps:

[0006] S1. Use RGB-D camera to obtain environmental information for subsequent pose estimation and mapping;

[0007] S2. Introducing the image enhancement module. The image enhancement module refers to using the DeblurGAN2 network to deblur the acquired image to improve the image quality.

[0008] S3, in the tracking thread, introduce adaptive threshold to improve the traditional ORB feature point extraction method, and perform feature extraction on the preprocessed image;

[0009] S4. Use the enhanced YOLOv7 algorithm to detect dynamic targets. The enhanced YOLOv7 algorithm refers to first inserting the Sim (spatial information) attention module in the feature extraction stage of the YOLOv7 network to improve the performance of YOLOv7, and combining the polar line constraint to eliminate dynamic feature points;

[0010] S5, the retained static feature points are used for pose estimation and subsequent mapping.

[0011] Furthermore, the step S2 introduces an image enhancement module to pre-process the image obtained by the camera, specifically:

[0012] An image enhancement module is introduced in the framework of ORB-SLAM3. This module uses the DeblurGANv2 network to preprocess the images obtained by the camera. DeblurGANv2 uses MobileNet as the backbone network. MobileNet is a lightweight convolutional neural network architecture designed to achieve efficient computing on mobile and embedded devices while maintaining good accuracy. It adopts the design idea of ​​depthwise separable convolution. This structure can significantly reduce the number of parameters and computational complexity, making the model more efficient when running on mobile devices. .

[0013] Furthermore, in step S3, an adaptive threshold is introduced to improve the traditional ORB feature point extraction method, specifically as follows: an adaptive threshold selection method based on KSW (optimal histogram entropy method) entropy value is adopted to determine the global threshold T according to the grayscale distribution of the image. g The KSW entropy method refers to calculating the entropy of the image grayscale histogram, and using conditional probability to describe the grayscale value distribution of the target and background in the image, thereby defining the entropy of the target and background; using the probability of each grayscale value to approximate the possibility distribution of the grayscale value, and obtaining the global grayscale information of the image; this method is mainly divided into two steps: first, using the image grayscale histogram as an approximate estimate of the grayscale value probability distribution density function, and then using this function combined with the principle of entropy to construct the objective function to achieve the selection of the threshold.

[0014] Furthermore, the grayscale histogram of the image is used as an approximate estimate of the grayscale value probability distribution density function, and then the function is combined with the principle of entropy to construct the objective function to achieve the selection of the threshold, which specifically includes:

[0015] First, set a threshold t to divide the image with grayscale [0, L-1] into two categories [0, t] and [t+1, L-1], and use S1 and S2 to represent their corresponding pixel probability distributions, then S1 and S2 are expressed as:

[0016] S1={P0,P1,P2,...P t}

[0017] S2={P t+1 ,P t+2 ,P t+3 ,...P L-1}

[0018] Where P i Represents the probability of each gray level appearing, then, let Then the entropy of S1 and S2 is expressed as:

[0019]

[0020]

[0021] Then the entropy of the entire image is equal to the sum of the two types of entropy, expressed as H(S) = H(S1) + H(S2). Next, all gray levels t within the grayscale histogram range are traversed and the sum of the two types of entropy is calculated; then, the gray level corresponding to the maximum value is recorded as T max , the gray level corresponding to the minimum value is recorded as T min ; Then, the global optimal threshold T g It can be expressed as:

[0022] T g = k·|T max -T min |

[0023] Where k represents the scale factor. Assuming that point A(x0, y0) is a candidate feature point in the image, take a square area N with a side length of L with A as the center, then the local adaptive threshold T l It can be expressed as:

[0024]

[0025] In the above formula, represents the maximum grayscale value in region N, represents the minimum gray value in region N, It represents the grayscale average value of area N, and the proportional coefficient k is 3.

[0026] Furthermore, the step S4 uses the enhanced YOLOv7 algorithm to detect dynamic targets and removes dynamic feature points in combination with the polar line constraint, as follows:

[0027] The SimAM spatial information attention mechanism is introduced in YOLOv7; SimAM can model the relationship between features at multiple levels, and it can pay attention to low-level detail features and high-level semantic features at the same time; SimAM not only pays attention to the features of each channel, but also can explore the relationship between different channels; this attention mechanism enables SimAM to better learn the semantic connection between features and improve the representation ability of the model; SimAM introduces spatial information and pays attention to the spatial distribution of features; SimAM is adaptive, and it can automatically adjust the focus according to the different characteristics of the input data.

[0028] Furthermore, the specific steps of removing dynamic feature points in step S4 in combination with the epipolar constraint are as follows:

[0029] First, the dynamic feature points of two consecutive frames are matched, then the basic matrix is ​​solved, and finally the distance between the feature points of the current frame and its polar line is calculated. The larger the distance, the more likely it is a dynamic feature point; feature points with semantic information as static targets are selected and the basic matrix F between the two frames is calculated using the seven-point method based on RANSAC.

[0030] Furthermore, the use of the RANSAC-based seven-point method to calculate the basic matrix F between the two frames specifically includes:

[0031] According to the pinhole camera model, O1 and O2 represent the center of the camera, the camera motion between adjacent frames M1 and M2 is represented by R and t, P is a point in space, p1 and p2 represent the projection of point P on M1 and M2, and l1 and l2 represent two epipolar lines;

[0032] The homogeneous coordinates of p1 and p2 can be expressed as:

[0033] p1=[x1,y1,1], p2=[x2,y2,1]

[0034] Where x and y represent the pixel coordinates of the feature points, the epipolar line l2 can be expressed as:

[0035]

[0036] In the above formula, X, Y, and Z represent line vectors, and the polar constraint can be expressed as:

[0037]

[0038] Then, the distance between p2 and the corresponding epipolar line is defined as the offset distance, denoted by d, which is calculated as follows:

[0039]

[0040] It can be seen from the above formula that, ideally, when d = 0, it means that the feature point p2 of the current frame falls exactly on the polar line l2, so the feature point is a static feature point; but in actual situations, due to the influence of various types of noise, the offset distance is generally greater than zero but less than an empirical threshold ε, and the threshold is selected as 0.6. When d is less than ε, it means that the feature point is a static feature point;

[0041] The improved YOLOv7 algorithm is used to extract semantic information from the enhanced image frame, draw the detection frame, determine the position of each object in the image, and provide prior information of the target; then, it is further determined whether the feature points in the dynamic object detection frame satisfy the epipolar constraint. If a feature point in the detection frame does not satisfy the epipolar constraint, it is regarded as a dynamic feature point and is no longer used in subsequent tracking threads.

[0042] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the simultaneous positioning and mapping method of the fused enhanced YOLOv7 as described in any one of the items is implemented.

[0043] A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the simultaneous positioning and mapping method of the fused enhanced YOLOv7 as described in any one of the items.

[0044] The advantages and beneficial effects of the present invention are as follows:

[0045] The present invention aims at the problem of image blur caused by motion, and uses an image enhancement module based on the DeblurGAN2 network, which can effectively remove the blur of the image, improve the quality of the image, and facilitate the subsequent extraction of feature points. Then, the present invention introduces an adaptive threshold in the traditional ORB feature point extraction method, which helps the system to extract more high-quality feature points while reducing the redundancy of feature points. In addition, in order to reduce the impact of dynamic objects in the environment on the system, the present invention introduces an attention mechanism in the YOLOv7 network, improves the detection accuracy of YOLOv7, and then combines the polar line constraints to eliminate dynamic feature points. The above method improves the accuracy and robustness of the SLAM system. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is an overview of the system provided by the preferred embodiment of the present invention;

[0047] Figure 2 It is a schematic diagram of the polar line constraint provided by the present invention. DETAILED DESCRIPTION

[0048] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.

[0049] The technical solution of the present invention to solve the above technical problems is:

[0050] A simultaneous positioning and mapping method integrating enhanced YOLOv7, comprising the following steps:

[0051] S1. Use RGB-D camera to obtain environmental information for subsequent pose estimation and mapping;

[0052] S2, introduces an image enhancement module to address the image blur problem caused by robot movement and camera shaking, and pre-processes the image obtained by the camera;

[0053] S3, in the tracking thread, introduce adaptive threshold to improve the traditional ORB feature point extraction method, and perform feature extraction on the preprocessed image;

[0054] S4, use the enhanced YOLOv7 algorithm to detect dynamic targets and remove dynamic feature points in combination with polar line constraints;

[0055] S5, the retained static feature points are used for pose estimation and subsequent mapping.

[0056] Specifically, step S2 is as follows: an image enhancement module is introduced into the framework of ORB-SLAM3, and the module uses the DeblurGANv2 network to pre-process the images obtained by the camera. DeblurGANv2 uses a lightweight MobileNet as the backbone network, which is 20 times faster than DeblurGAN and has good real-time performance, meeting the real-time requirements of the SLAM system.

[0057] In step S3, an adaptive threshold is introduced to improve the traditional ORB feature point extraction method, specifically as follows: the present invention adopts an adaptive threshold selection method based on KSW entropy value, and determines the global threshold T according to the grayscale distribution of the image. g . The KSW entropy method refers to calculating the entropy of the grayscale histogram of the image, and using conditional probability to describe the grayscale value distribution of the target and background in the image, thereby defining the entropy of the target and background. The present invention uses the probability of each grayscale value to approximate the possibility distribution of the grayscale value, and obtains the global grayscale information of the image. The method is mainly divided into two steps: first, the image grayscale histogram is used as an approximate estimate of the grayscale value probability distribution density function, and then the function is used in combination with the principle of entropy to construct the objective function and realize the selection of the threshold. In this way, an adaptive threshold can be selected according to the grayscale value distribution of the image, thereby improving the adaptability of the ORB feature extraction algorithm.

[0058] First, set a threshold t to divide the image with grayscale [0, L-1] into two categories [0, t] and [t+1, L-1], and use S1 and S2 to represent their corresponding pixel probability distributions. Then S1 and S2 can be expressed as:

[0059] S1={P0,P1,P2,...P t}

[0060] S2={P t+1 , P t+2 , P t+3 , ...P L-1}

[0061] Where P i represents the probability of each gray level appearing. Then, let Then the entropy of S1 and S2 can be expressed as:

[0062]

[0063]

[0064] Then the entropy of the entire image is equal to the sum of the two types of entropy, expressed as H(S) = H(S1) + H(S2). Next, traverse all gray levels t within the grayscale histogram range and calculate the sum of the two types of entropy. Then, the gray level corresponding to the maximum value is recorded as T max , the gray level corresponding to the minimum value is recorded as T min Then, the global optimal threshold T g It can be expressed as:

[0065] T g = k·|T max -T min |

[0066] Where k represents the proportional coefficient. Although the global threshold T g It can be adaptively selected according to the gray value distribution of the image, but it assumes that each area of ​​the image is under the same lighting conditions. When there are shadows in the local area of ​​the image, resulting in different contrasts in each area, the global threshold will no longer be applicable, which will reduce the effect of feature extraction. Therefore, when the lighting conditions change greatly, this paper adopts the local adaptive threshold T l To solve this problem. Assume that point A(x0, y0) is a candidate feature point in the image, and take a square area N with a side length of L with A as the center, then the local adaptive threshold T l It can be expressed as:

[0067]

[0068] In the above formula, represents the maximum grayscale value in region N, represents the minimum gray value in region N, It represents the grayscale average value of area N, and the proportional coefficient k is generally 3.

[0069] Then, in step S4, the enhanced YOLOv7 algorithm is used to detect dynamic targets, and the dynamic feature points are eliminated in combination with the polar line constraint, as follows: The present invention introduces SimAM (Spatial information Attention Mechanism) into YOLOv7 to improve the accuracy of YOLOv7.

[0070] Attention Mechanism is a commonly used technique in computer science and machine learning. In the attention mechanism, the output of each neuron depends not only on the output of all neurons in the previous layer, but also on the weights of different parts of the input data. This allows the model to pay more attention to the key information in the input sequence, thereby improving the accuracy and efficiency of the model. Another advantage of this module is that most operations are based on the defined energy function selection, avoiding excessive structural adjustments. SimAM has the following features:

[0071] 1. SimAM can model the relationship between features at multiple levels. It can pay attention to low-level detail features and high-level semantic features at the same time, so that the model can understand the input data more comprehensively. 2. SimAM not only pays attention to the features of each channel, but also can explore the relationship between different channels. This attention mechanism enables SimAM to better learn the semantic connection between features and improve the representation ability of the model. 3. SimAM introduces spatial information and pays attention to the distribution of features in space. This attention mechanism enables the model to locate the target area more accurately and improves the accuracy of target detection and segmentation. 4. SimAM is adaptive and can automatically adjust the focus according to the different characteristics of the input data. This adaptability enables SimAM to be applicable to various types of data and improves the generalization ability of the model. The attention mechanism is a plug-and-play module. In order to improve the detection accuracy of YOLOv7, the present invention inserts the SimAM module into the feature extraction enhancement network of YOLOv7 to improve the feature extraction ability of the YOLOv7 network.

[0072] At the same time, the specific steps of removing dynamic feature points in step S4 in combination with the epipolar constraint are as follows:

[0073] (1) The steps of epipolar constraint are to first match the dynamic feature points of two consecutive frames, then solve the basic matrix, and finally calculate the distance between the feature point of the current frame and its epipolar line. The larger the distance, the more likely it is a dynamic feature point. In order to obtain a relatively accurate basic matrix, this paper selects the feature points of static targets with semantic information and uses the seven-point method based on RANSAC to calculate the basic matrix F between the two frames. According to the pinhole camera model, Figure 2 As shown, O1 and O2 represent the center of the camera, the camera motion between adjacent frames M1 and M2 is represented by R and t, P is a point in space, p1 and p2 represent the projection of point P on M1 and M2, and l1 and l2 represent two epipolar lines.

[0074] The homogeneous coordinates of p1 and p2 can be expressed as:

[0075] p1=[x1,y1,1], p2=[x2,y2,1]

[0076] Where x and y represent the pixel coordinates of the feature points, the epipolar line l2 can be expressed as:

[0077]

[0078] In the above formula, X, Y, and Z represent line vectors, and the polar constraint can be expressed as:

[0079]

[0080] Then, the distance between p2 and the corresponding epipolar line is defined as the offset distance, denoted by d, which is calculated as follows:

[0081]

[0082] From the above formula, we can see that, ideally, when d = 0, it means that the feature point p2 of the current frame falls exactly on the polar line l2, so the feature point is a static feature point. However, in reality, due to the influence of various types of noise, the offset distance is generally greater than zero but less than an empirical threshold ε. This paper selects the threshold as 0.6. When d is less than ε, it means that the feature point is a static feature point.

[0083] (2) The semantic information in the enhanced image frame is extracted through the improved YOLOv7 algorithm, the detection frame is drawn, the position of each object in the image is determined, and the prior information of the target is provided. Then, it is further determined whether the feature points in the dynamic object detection frame meet the epipolar constraint. If a feature point in the detection frame does not meet the epipolar constraint, it is regarded as a dynamic feature point and is no longer used in the subsequent tracking thread.

[0084] After that, after extracting feature points and removing the dynamic feature points, the static feature points are used for pose estimation and subsequent mapping.

[0085] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0086] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0087] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0088] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.

Claims

1. A simultaneous localization and mapping method integrating enhanced YOLOv7, characterized in that: The following steps are involved: S1. Use RGB-D camera to obtain environmental information for subsequent pose estimation and mapping; S2, introduces an image enhancement module, which uses the DeblurGAN2 network to deblur the acquired image; S3, in the tracking thread, introduce adaptive threshold to improve the traditional ORB feature point extraction method, and perform feature extraction on the preprocessed image; S4. Use the enhanced YOLOv7 algorithm to detect dynamic targets. The enhanced YOLOv7 algorithm refers to first inserting the Sim spatial information attention module into the feature extraction stage of the YOLOv7 network, and then combining the polar line constraint to eliminate dynamic feature points; S5, the retained static feature points are used for pose estimation and subsequent mapping.

2. According to claim 1, a simultaneous positioning and mapping method integrating enhanced YOLOv7, characterized in that: The step S2 introduces an image enhancement module to pre-process the image obtained by the camera, specifically: An image enhancement module is introduced in the framework of ORB-SLAM3, which uses the DeblurGANv2 network to preprocess the images obtained by the camera; DeblurGANv2 uses MobileNet as the backbone network. MobileNet refers to a lightweight convolutional neural network architecture that adopts the design concept of deep separable convolution.

3. The simultaneous positioning and mapping method of fusion enhanced YOLOv7 according to claim 1, characterized in that: In step S3, an adaptive threshold is introduced to improve the traditional ORB feature point extraction method, specifically as follows: an adaptive threshold selection method based on the entropy value of the KSW optimal histogram entropy method is adopted to determine the global threshold T according to the grayscale distribution of the image. g The KSW entropy method refers to calculating the entropy of the image grayscale histogram, and using conditional probability to describe the grayscale value distribution of the target and background in the image, thereby defining the entropy of the target and background; using the probability of each grayscale value to approximate the possibility distribution of the grayscale value, and obtaining the global grayscale information of the image; this method is mainly divided into two steps: first, using the image grayscale histogram as an approximate estimate of the grayscale value probability distribution density function, and then using this function combined with the principle of entropy to construct the objective function to achieve the selection of the threshold.

4. The simultaneous positioning and mapping method of fusion enhanced YOLOv7 according to claim 3, characterized in that: The method uses the image grayscale histogram as an approximate estimate of the grayscale value probability distribution density function, and then uses the function in combination with the principle of entropy to construct an objective function to achieve the selection of the threshold, which specifically includes: First, set a threshold t to divide the image with grayscale [0, L-1] into two categories [0, t] and [t+1, L-1], and use S1 and S2 to represent their corresponding pixel probability distributions, then S1 and S2 are expressed as: S1={P0,P1,P2,...P t } S2={P t+1 ,P t+2 ,P t+3 ,...P L-1 } Where P i Represents the probability of each gray level appearing, then, let Then the entropy of S1 and S2 is expressed as: Then the entropy of the entire image is equal to the sum of the two types of entropy, expressed as H(S) = H(S1) + H(S2). Next, all gray levels t within the grayscale histogram range are traversed and the sum of the two types of entropy is calculated; then, the gray level corresponding to the maximum value is recorded as T max , the gray level corresponding to the minimum value is recorded as T min ; Then, the global optimal threshold T g It can be expressed as: T g =k·|T max -T min | Where k represents the scale factor. Assuming that point A(x0,y0) is a candidate feature point in the image, take a square area N with a side length of L with A as the center, then the local adaptive threshold T l It can be expressed as: In the above formula, represents the maximum grayscale value in region N, represents the minimum gray value in region N, It represents the grayscale average value of area N, and the proportional coefficient k is 3.

5. The simultaneous positioning and mapping method of fusion enhanced YOLOv7 according to claim 3, characterized in that: The step S4 uses the enhanced YOLOv7 algorithm to detect dynamic targets and removes dynamic feature points in combination with the polar line constraint, as follows: The SimAM spatial information attention mechanism is introduced in YOLOv7; SimAM can model the relationship between features at multiple levels, and it can pay attention to low-level detail features and high-level semantic features at the same time; SimAM not only pays attention to the features of each channel, but also can explore the relationship between different channels; this attention mechanism enables SimAM to better learn the semantic connection between features and improve the representation ability of the model; SimAM introduces spatial information and pays attention to the spatial distribution of features; SimAM is adaptive, and it can automatically adjust the focus according to the different characteristics of the input data.

6. The simultaneous positioning and mapping method of fusion enhanced YOLOv7 according to claim 1, characterized in that: The specific steps of removing dynamic feature points in step S4 in combination with the epipolar constraint are as follows: First, the dynamic feature points of two consecutive frames are matched, then the basic matrix is ​​solved, and finally the distance between the feature points of the current frame and its polar line is calculated. The larger the distance, the more likely it is a dynamic feature point; feature points with semantic information as static targets are selected and the basic matrix F between the two frames is calculated using the seven-point method based on RANSAC.

7. A simultaneous positioning and mapping method of fusion enhanced YOLOv7 according to claim 6, characterized in that: The method of using the RANSAC-based seven-point method to calculate the basic matrix F between two frames specifically includes: According to the pinhole camera model, O1 and O2 represent the center of the camera, the camera motion between adjacent frames M1 and M2 is represented by R and t, P is a point in space, p1 and p2 represent the projection of point P on M1 and M2, and l1 and l2 represent two epipolar lines; The homogeneous coordinates of p1 and p2 can be expressed as: p1=[x1,y1,1], p2=[x2,y2,1] Where x and y represent the pixel coordinates of the feature points, the epipolar line l2 can be expressed as: In the above formula, X, Y, and Z represent line vectors, and the polar constraint can be expressed as: Then, the distance between p2 and the corresponding epipolar line is defined as the offset distance, denoted by d, which is calculated as follows: It can be seen from the above formula that, ideally, when d = 0, it means that the feature point p2 of the current frame falls exactly on the polar line l2, so the feature point is a static feature point; but in actual situations, due to the influence of various types of noise, the offset distance is generally greater than zero but less than an empirical threshold ε, and the threshold is selected as 0.

6. When d is less than ε, it means that the feature point is a static feature point; The improved YOLOv7 algorithm is used to extract semantic information from the enhanced image frame, draw the detection frame, determine the position of each object in the image, and provide prior information of the target; then, it is further determined whether the feature points in the dynamic object detection frame satisfy the epipolar constraint. If a feature point in the detection frame does not satisfy the epipolar constraint, it is regarded as a dynamic feature point and is no longer used in subsequent tracking threads.

8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the simultaneous positioning and mapping method of the fused enhanced YOLOv7 as described in any one of claims 1 to 7 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the simultaneous positioning and mapping method of the fused enhanced YOLOv7 as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • SLAM dynamic disturbance suppression method based on fuzzy processing and target detection

    CN119515730A