Image processing method and device and robot visual odometer

By using the K-means clustering algorithm to screen and remove dynamic feature points in the robot vision SLAM system, the problem of inaccurate pose estimation in dynamic environments is solved, and fast calculation and high-precision positioning are achieved.

CN118628568AActive Publication Date: 2024-09-10HARBIN ENG UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410789838.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-10
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

It is difficult for existing robot vision SLAM systems to track dynamic moving objects in real time in dynamic environments, resulting in inaccurate pose estimation and reduced robustness.

Method used

The mask extraction algorithm based on K-means clustering is used to obtain RGB images and depth map sequences, filter out targets and remove dynamic feature points, and generate the final segmentation mask extraction map to improve the positioning accuracy and robustness of the system.

Benefits of technology

It achieves fast calculation in dynamic scenes, improves positioning accuracy and robustness, and has a small root mean square error, which proves the superiority of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628568A
    Figure CN118628568A
Patent Text Reader

Abstract

The invention discloses an image processing method and device and a robot visual odometer, and relates to the technical field of computer vision. The method is characterized by comprising the following steps: acquiring an RGB image sequence and a depth map sequence containing a target; processing the RGB image sequence and the depth map sequence to obtain a target depth extraction map sequence; a K-means clustering-based mask extraction algorithm is utilized to screen out targets in the target depth extraction image sequence, and a target binary mask sequence is obtained; and an image sequence acquired by the camera on the robot is processed according to the process, so that the position and the posture of the robot are determined. The method is extremely high in calculation speed, and the effect better than that of instance segmentation can be achieved. Compared with a traditional method, the method has the advantages that the positioning precision and robustness in a dynamic scene are greatly improved, and the root-mean-square error is smaller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to an image processing method, device and robot visual odometer. Background Art

[0002] It is a challenge for a robot vision SLAM system to maintain robustness in a dynamic environment. Although the SLAM system has been successfully demonstrated in specific situations, the system's estimation of state variables may be affected by dynamically moving objects in the environment, and even cause the SLAM system to be unable to track. In a vision-based SLAM system, people walking dynamically in the environment enter the system through sensors, and the visual front-end extracts all feature points from the image without judgment, including non-static feature points generated by moving people. The system adds these feature points to the back-end optimization. As the human body moves, the feature points that should have been static undergo a huge offset, which makes the pose solved by the entire system no longer accurate, causing the robustness of the system to drop rapidly.

[0003] In the existing technology, scholars have carried out specific research work from different angles. For example, Runz et al. proposed MaskFusion in "Maskfusion: Real-time recognition, tracking and reconstruction of multiple moving objects". They used RGB-D cameras and instance-level semantic segmentation technology to generate semantic masks for moving objects, thereby realizing object detection and constructing a world map representation at the object level. Another example is Yu et al. proposed a robust semantic visual DS-SLAM for dynamic environments in "DS-SLAM: A semantic visual SLAM towards dynamic environments". The system introduced a semantic segmentation network model, shielded dynamic feature points through object masks, and used motion consistency detection methods for re-detection. Through two layers of screening, the dynamic feature points were shielded, thereby improving the accuracy of pose solution in dynamic environments. However, the above methods have a common important problem, that is, the system cannot run in real time. Summary of the invention

[0004] In view of the above problems, the present invention proposes an image processing method, device and robot visual odometer.

[0005] According to one aspect of the present invention, an image processing method is provided, the method comprising:

[0006] Get the RGB image sequence and depth map sequence containing the target;

[0007] Processing the RGB image sequence and the depth map sequence to obtain a target depth extraction map sequence;

[0008] The target is screened out from the target depth extraction image sequence using a mask extraction algorithm based on K-means clustering to obtain a target binary mask sequence.

[0009] Furthermore, after obtaining the target binary mask sequence, the dynamic feature points are removed to obtain the final segmentation mask extraction image.

[0010] Furthermore, the RGB image sequence and the depth map sequence are processed to obtain a target depth extraction map sequence, including: using a target detection model to detect the target in the RGB image sequence to obtain a detection frame; and according to the detection frame, segmenting the target in the detection frame from the depth map sequence to obtain a target depth extraction map sequence.

[0011] Furthermore, the targets selected from the target depth extraction image sequence using a mask extraction algorithm based on K-means clustering include:

[0012] Determine the window size of the target depth extraction map, and directly output the maximum depth value and the minimum depth value of the target depth extraction map if the window is smaller than a preset threshold; if the window is not smaller than the preset threshold, remove the 0 value and convert the two-dimensional depth map into one-dimensional data, where the elements in the one-dimensional data are defined as depth samples;

[0013] The one-dimensional data is classified into three categories, the number of clusters of the K-means clustering algorithm is set to 3, and K-means clustering is performed. The index of the smallest centroid cluster and the index of the second smallest centroid cluster are obtained from the clustering results.

[0014] Compare the sample quantities of the smallest centroid cluster and the second smallest centroid cluster, define the cluster with a larger sample quantity as a motion cluster, and calculate the standard deviation of the motion cluster;

[0015] If the standard deviation of the motion cluster is less than the empirical value, and the number of samples contained in the motion cluster is greater than the preset percentage of the total number of samples, the maximum depth value and the minimum depth value in the motion cluster are output;

[0016] If the standard deviation of the motion cluster is greater than the empirical value or the number of samples contained in the motion cluster is less than the preset percentage of the total number of samples, K-means clustering is performed again, the number of clusters is set to 2, and K-means clustering is performed again; and the obtained minimum centroid cluster is defined as the motion cluster, and the maximum depth and minimum depth in the minimum centroid cluster are output.

[0017] Furthermore, after obtaining the target binary mask sequence, removing the dynamic feature points includes: generating a mask pyramid based on the image pyramid; marking the feature points within the mask range according to the mask pyramid, and removing the dynamic feature points by prohibiting the feature points from generating map points.

[0018] According to another aspect of the present invention, an image processing device is provided, the device comprising:

[0019] An image sequence acquisition module, configured to acquire an RGB image sequence and a depth map sequence containing a target;

[0020] A target depth map extraction module, configured to process the RGB image sequence and the depth map sequence to obtain a target depth extraction map sequence;

[0021] The target segmentation mask extraction module is configured to use a mask extraction algorithm based on K-means clustering to screen out targets in the target depth extraction image sequence to obtain a target binary mask sequence.

[0022] Furthermore, it also includes a dynamic feature point removal module, which is configured to generate a mask pyramid based on the image pyramid after obtaining the target binary mask sequence; mark the feature points within the mask range according to the mask pyramid, and remove the dynamic feature points by prohibiting the feature points from generating map points, so as to obtain the final segmentation mask extraction map.

[0023] Furthermore, the target segmentation mask extraction module uses a K-means clustering-based mask extraction algorithm to filter out targets in the target depth extraction image sequence, including:

[0024] Determine the window size of the target depth extraction map, and directly output the maximum depth value and the minimum depth value of the target depth extraction map if the window is smaller than a preset threshold; if the window is not smaller than the preset threshold, remove the 0 value and convert the two-dimensional depth map into one-dimensional data, where the elements in the one-dimensional data are defined as depth samples;

[0025] The one-dimensional data is classified into three categories, the number of clusters of the K-means clustering algorithm is set to 3, and K-means clustering is performed. The index of the smallest centroid cluster and the index of the second smallest centroid cluster are obtained from the clustering results.

[0026] Compare the sample quantities of the smallest centroid cluster and the second smallest centroid cluster, define the cluster with a larger sample quantity as a motion cluster, and calculate the standard deviation of the motion cluster;

[0027] If the standard deviation of the motion cluster is less than the empirical value, and the number of samples contained in the motion cluster is greater than the preset percentage of the total number of samples, the maximum depth value and the minimum depth value in the motion cluster are output;

[0028] If the standard deviation of the motion cluster is greater than the empirical value or the number of samples contained in the motion cluster is less than the preset percentage of the total number of samples, K-means clustering is performed again, the number of clusters is set to 2, and K-means clustering is performed again; and the obtained minimum centroid cluster is defined as the motion cluster, and the maximum depth and minimum depth in the minimum centroid cluster are output.

[0029] According to another aspect of the present invention, a robot visual odometer is proposed. The visual odometer uses the above-mentioned image processing method to process an image sequence captured by a camera on the robot to determine the position and posture of the robot.

[0030] Furthermore, in a target detection thread that detects targets in the RGB image sequence using a target detection model, the front-end visual odometer uses a detection result of a previous frame by the target detection thread.

[0031] The beneficial technical effects of the present invention are:

[0032] The present invention proposes an image processing method, device and robot visual odometer. First, an RGB image sequence and a depth map sequence containing a target are obtained; the RGB image sequence and the depth map sequence are processed to obtain a target depth extraction map sequence; a mask extraction algorithm based on K-means clustering is used to filter out the target in the target depth extraction map sequence to obtain a target binary mask sequence; and the image sequence captured by the camera on the robot is processed according to the above process to determine the position and posture of the robot. The present invention has an extremely fast calculation speed and can achieve better results than instance segmentation.

[0033] The present invention was experimentally verified in a public data set, and conclusions were drawn through both qualitative and quantitative analysis methods. Compared with traditional methods, the present invention has greatly improved the accuracy and robustness of positioning in dynamic scenes. At the same time, compared with other methods, the root mean square error of the algorithm of the present invention is smaller, which proves the superiority of the algorithm of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The present invention can be better understood by referring to the description given below in conjunction with the accompanying drawings, which together with the following detailed description are included in this specification and form a part of this specification, and are used to further illustrate the preferred embodiments of the present invention and explain the principles and advantages of the present invention.

[0035] Figure 1 It is a schematic diagram of the flow chart of an embodiment of the present invention.

[0036] Figure 2 It is a flowchart of the YOLOv5 thread program in an embodiment of the present invention.

[0037] Figure 3Schematic diagram of the correspondence between the YOLO thread and the visual odometer thread in an embodiment of the present invention.

[0038] Figure 4 It is a design framework diagram of an improved visual odometer in an embodiment of the present invention.

[0039] Figure 5 It is a human body extraction image in an embodiment of the present invention; wherein (a) is a human body RGB extraction image; and (b) is a human body depth extraction image.

[0040] Figure 6 It is a human body extraction histogram in an embodiment of the present invention; wherein (a) is a human body RGB histogram; and (b) is a human body depth histogram.

[0041] Figure 7 It is a flow chart of a mask extraction algorithm based on K-means clustering in an embodiment of the present invention.

[0042] Figure 8 This is an example diagram of segmentation mask extraction in an embodiment of the present invention.

[0043] Fig. 9 It is a trajectory diagram under the fr3_s_half data set in an embodiment of the present invention; wherein (a) corresponds to ORB-SLAM2; and (b) corresponds to the present invention.

[0044] Fig.10 It is a trajectory diagram under the fr3_w_half data set in an embodiment of the present invention; wherein (a) corresponds to ORB-SLAM2; and (b) corresponds to the present invention. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the scheme of the present invention, exemplary implementations or embodiments of the present invention will be described below in conjunction with the accompanying drawings. Obviously, the described implementations or embodiments are only implementations or embodiments of a part of the present invention, not all of them. Based on the implementations or embodiments of the present invention, all other implementations or embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present invention.

[0046] An embodiment of the present invention provides an image processing method, the method comprising:

[0047] S1, obtain the RGB image sequence and depth map sequence containing the target;

[0048] S2. Process the RGB image sequence and the depth map sequence to obtain a target depth extraction map sequence;

[0049] S3. Filter out targets from the target depth extraction image sequence using a mask extraction algorithm based on K-means clustering to obtain a target binary mask sequence.

[0050] In this embodiment, preferably, after obtaining the target binary mask sequence, the method further includes S4: removing dynamic feature points to obtain a final segmentation mask extraction image.

[0051] In this embodiment, preferably, in S2, the RGB image sequence and the depth map sequence are processed to obtain a target depth extraction map sequence, including: using a target detection model to detect the target in the RGB image sequence to obtain a detection frame; and according to the detection frame, segmenting the target in the detection frame from the depth map sequence to obtain a target depth extraction map sequence.

[0052] In this embodiment, preferably, in S3, using a mask extraction algorithm based on K-means clustering to screen out targets in the target depth extraction image sequence includes:

[0053] Determine the window size of the target depth extraction map, and directly output the maximum depth value and the minimum depth value of the target depth extraction map if the window is smaller than a preset threshold; if the window is not smaller than the preset threshold, remove the 0 value and convert the two-dimensional depth map into one-dimensional data, where the elements in the one-dimensional data are defined as depth samples;

[0054] The one-dimensional data is classified into three categories, the number of clusters of the K-means clustering algorithm is set to 3, and K-means clustering is performed. The index of the smallest centroid cluster and the index of the second smallest centroid cluster are obtained from the clustering results.

[0055] Compare the sample quantities of the smallest centroid cluster and the second smallest centroid cluster, define the cluster with a larger sample quantity as a motion cluster, and calculate the standard deviation of the motion cluster;

[0056] If the standard deviation of the motion cluster is less than the empirical value, and the number of samples contained in the motion cluster is greater than the preset percentage of the total number of samples, the maximum depth value and the minimum depth value in the motion cluster are output;

[0057] If the standard deviation of the motion cluster is greater than the empirical value or the number of samples contained in the motion cluster is less than the preset percentage of the total number of samples, K-means clustering is performed again, the number of clusters is set to 2, and K-means clustering is performed again; and the obtained minimum centroid cluster is defined as the motion cluster, and the maximum depth and minimum depth in the minimum centroid cluster are output.

[0058] In this embodiment, preferably, the K-means clustering process in S3 includes: selecting the number of clusters; initializing cluster centers; assigning data points to the nearest cluster centers; updating cluster centers; repeating the assignment and updating; and determining the final clustering result.

[0059] In this embodiment, preferably, after obtaining the target binary mask sequence in S4, removing the dynamic feature points includes: generating a mask pyramid based on the image pyramid; marking the feature points within the mask range according to the mask pyramid, and removing the dynamic feature points by prohibiting the feature points from generating map points.

[0060] The embodiment of the present invention further provides an image processing device, the device comprising:

[0061] An image sequence acquisition module, configured to acquire an RGB image sequence and a depth map sequence containing a target;

[0062] A target depth map extraction module, configured to process the RGB image sequence and the depth map sequence to obtain a target depth extraction map sequence;

[0063] The target segmentation mask extraction module is configured to use a mask extraction algorithm based on K-means clustering to screen out targets in the target depth extraction image sequence to obtain a target binary mask sequence.

[0064] In this embodiment, preferably, it also includes a dynamic feature point removal module, which is configured to generate a mask pyramid based on the image pyramid after obtaining the target binary mask sequence; according to the mask pyramid, the feature points within the mask range are marked, and the dynamic feature points are removed by prohibiting the feature points from generating map points, so as to obtain the final segmentation mask extraction map.

[0065] In this embodiment, preferably, the target segmentation mask extraction module uses a K-means clustering-based mask extraction algorithm to filter out targets in the target depth extraction image sequence, including:

[0066] Determine the window size of the target depth extraction map, and directly output the maximum depth value and the minimum depth value of the target depth extraction map if the window is smaller than a preset threshold; if the window is not smaller than the preset threshold, remove the 0 value and convert the two-dimensional depth map into one-dimensional data, where the elements in the one-dimensional data are defined as depth samples;

[0067] The one-dimensional data is classified into three categories, the number of clusters of the K-means clustering algorithm is set to 3, and K-means clustering is performed. The index of the smallest centroid cluster and the index of the second smallest centroid cluster are obtained from the clustering results.

[0068] Compare the sample quantities of the smallest centroid cluster and the second smallest centroid cluster, define the cluster with a larger sample quantity as a motion cluster, and calculate the standard deviation of the motion cluster;

[0069] If the standard deviation of the motion cluster is less than the empirical value, and the number of samples contained in the motion cluster is greater than the preset percentage of the total number of samples, the maximum depth value and the minimum depth value in the motion cluster are output;

[0070] If the standard deviation of the motion cluster is greater than the empirical value or the number of samples contained in the motion cluster is less than the preset percentage of the total number of samples, K-means clustering is performed again, the number of clusters is set to 2, and K-means clustering is performed again; and the obtained minimum centroid cluster is defined as the motion cluster, and the maximum depth and minimum depth in the minimum centroid cluster are output.

[0071] The embodiment of the present invention further proposes a robot visual odometer, which uses the image processing method described in the above embodiment to process the image sequence captured by the camera on the robot to determine the position and posture of the robot. Specific embodiment 1

[0073] The embodiment of the present invention provides a robot visual odometer, such as Figure 1 As shown in the figure, the present invention mainly focuses on the design problem of visual odometer for robots in indoor scenes with human motion. First, the YOLOv5 target detection algorithm is deployed, and different specific versions of YOLOv5 are manually selected to prepare for subsequent work; then a target detection program based on YOLOv5 is designed to realize human recognition in indoor dynamic environments; then an improved visual odometer framework is designed to extract human RGB images and depth images, and on this basis, the basic idea of ​​obtaining a two-dimensional mask of a human image is proposed; then a human mask extraction algorithm based on K-means clustering is proposed, K-means clustering is carried out, and the human mask extraction work in the final dynamic environment is realized. Finally, the superior performance of a series of algorithms proposed in the present invention is verified through comparative experiments.

[0074] 1) Deploy the YOLOv5 target detection algorithm

[0075] By adding the YOLOv5 target detection network to the front-end visual odometer, the RGB image of the sensor information is input, the image is converted into the input size of the network, and the output is the detection box, detection category, and detection confidence detected for the RGB image. In order to make the system have high consistency and achieve rapid deduction, the present invention implements the deduction of the YOLOv5 model on C++. In order to deploy the YOLOv5 model to the system, the present invention adopts the following steps:

[0076] Step 1: The trained model needs to be converted from the pt model to the onnx model;

[0077] Step 2: Convert the onnx model to a trtmodel model file through TensorRT, and convert the model using FP32 precision;

[0078] Step 3: In order to adapt to the computing power and real-time requirements of different devices, the YOLOv5 model supports the use of different variants, including: n, s, m, l, x. These five letters correspond to five different variants, and the computing power requirements and accuracy of the devices increase in sequence.

[0079] 2) Integrate the YOLOv5-based target detection program into the SLAM system

[0080] Add the model deduction process to the ORB-SLAM2 system, the program flow is as follows Figure 2 As shown. In the ORB-SLAM2 system, add a new thread to perform target detection and generate a human binary mask. The thread will wait for new image input. After receiving the new image, convert the RGB image to a grayscale image and adjust the image size to the input size of the model. After obtaining the detection result, traverse all the detection frames in the result and generate a Detection object for each detection frame. The constructor of Detection will constrain the original detection frame range to the image range and mark whether the detection frame intersects with the image boundary. If the detection frame is a person, the segmentation threshold will be calculated and the corresponding human binary mask will be generated.

[0081] In order to realize the task of real-time operation of the target detection algorithm, the present invention proposes an optimization scheme. During the deduction process of the YOLO thread, the front-end visual odometer will use the detection result of the previous frame by the YOLO thread. The timing diagram between the two threads is as follows: Figure 3 As shown in the figure, the optimized solution does not affect the positioning accuracy. At the i+3th frame, both the YOLO thread and the visual odometer thread start processing the frame. When it comes to the i+4th frame, the YOLO thread has not completed the deduction of the i+3 frame. Then the human body depth mask used by the visual odometer is generated by the i-th frame. Through this processing method, the advantages of multi-threading can be greatly utilized to improve both the operating efficiency and the dynamic positioning accuracy.

[0082] 3) Improved visual odometry framework

[0083] The present invention improves the front-end visual odometer for dynamic scenes, and the program framework diagram is designed as follows Figure 4 shown.

[0084] 31) Obtaining the RGB image and depth map of the human body: The sensor uses an RGB-D camera, and its RGB image is input into the YOLOv5 detection thread. The objects in the current image are obtained through forward deduction, and the detection frame and object label are output to the visual odometer. The visual odometer selects the object detection frame corresponding to the "human body" according to the object label information, and segments the part in the detection frame from the original depth map according to the detection frame, and obtains the depth map corresponding to the human body. The RGB image and depth map obtained after the detection frame segmentation are shown in the figure. Figure 5 As shown in Figure 1, a semantic segmentation network is used to extract the target contour in the RGB image.

[0085] 32) Obtain a two-dimensional mask of a human body image: Figure 6 It is a histogram corresponding to an RGB image and a depth map. It is difficult to see the pixel distribution of the human body in the image in the RGB histogram, but it can be seen from the depth histogram that the pixel intensity is roughly divided into two parts, which are: 40-57 and 58-80, and these two parts just correspond to the body depth range and the background depth range in the depth map. The present invention designs an algorithm for calculating the depth segmentation threshold, namely, a mask extraction algorithm based on K-means clustering. The algorithm directly obtains the lower and upper depth limits of the human body in the depth map, and selects parts of the human body in the depth map. The basis for segmentation is that the depth values ​​of the human body in the depth map are consistent.

[0086] To obtain the depth segmentation threshold of the human body through the depth map of the object, this process is actually the clustering process of the depth map of the object. If the foreground, middle ground and background in the depth map can be obtained through the clustering algorithm, then the corresponding human body depth segmentation threshold is obtained from it. The present invention adopts machine learning K-means clustering, which is the algorithm with the lowest complexity in clustering and meets the real-time requirements of the front-end visual odometer. The specific implementation steps based on the K-means clustering algorithm are as follows:

[0087] Step 1: Select the number of clusters (K);

[0088] Step 2: Initialize the cluster centers (Centroids);

[0089] Step 3: Assign data points to the nearest cluster center;

[0090] Step 4: Update cluster centers;

[0091] Step 5: Repeat Step 3 and Step 4;

[0092] Step 6: Determine the final clustering results.

[0093] Based on K-means clustering, the extracted depth map can be made into a sample set and input into the K-means clustering algorithm. Then, the depth segmentation threshold of the human body is calculated according to the clustering results. The specific program flow chart is as follows: Figure 7 The input of the program is the object depth map, and the output is the depth range of the object in the depth map, that is, the minimum depth value and the maximum depth value.

[0094] When the program receives the depth map of the object, it will first determine the window size. If it is too small, it will not be processed and the maximum value of the object's depth map will be directly returned as Max and the minimum value of the object's depth map will be returned as Min. If the window is not smaller than the set value, it will proceed to the next step, remove the 0 value caused by the abnormal camera depth, convert the two-dimensional depth map into one-dimensional data, and the elements in the one-dimensional data are called depth samples.

[0095] Since there are generally foreground, middle ground and background in an image, the present invention first classifies the data into three categories, sets the number of clusters of the K-means clustering algorithm to 3, and obtains the index of the minimum centroid cluster and the index of the second smallest centroid cluster from the clustering results. This is because the moving human body will be in the foreground or middle ground in the camera's field of view. By comparing the number of samples in these two clusters, the cluster with a larger number of samples is selected and defined as the motion cluster. The standard deviation of the motion cluster is calculated. The standard deviation can reflect the degree of discreteness of the depth samples in the motion cluster. The depth samples generated by the human body generally have strong consistency. Through multiple experiments, the present invention sets the empirical value of the standard deviation to 0.25.

[0096] If the standard deviation of a motion cluster is smaller than the empirical value, and the number of samples contained in the motion cluster is greater than 30% of the total number of samples, the motion cluster is considered to have strong consistency, and the maximum value in the motion cluster is returned as Max, and the minimum value is returned as Min; if the standard deviation of a motion cluster is larger than the empirical value or the number of samples contained in the motion cluster is less than 30% of the total number of samples, it means that there is no mid-ground in the scene, and K-means clustering is performed again with the number of clusters set to 2. The obtained minimum centroid cluster is defined as the motion cluster, and the maximum value in the motion cluster is returned as Max, and the minimum value is returned as Min.

[0097] After obtaining the binary mask of the human body in the image, since the system performs feature point recognition on the image pyramid, it is necessary to generate the same mask pyramid. According to the mask pyramid, the feature points within the mask range are marked, and the dynamic feature points are removed by prohibiting the feature points from generating map points, and these feature points are shielded in the back-end optimization.

[0098] The technical effect of the present invention is further verified through experiments.

[0099] Experiment 1-Human segmentation mask verification: Figure 8This is the result of segmentation mask extraction of dynamic human bodies in the fr3_w_xyz sequence in the TUM data set. The first row of pictures is the original picture of the data set, the second row of pictures is the depth map of the human body detection frame, and the third row is the extracted binary mask map. It can be seen from the extraction results that no matter there are multiple human bodies, the human body is blurred, or the human body observation is incomplete, the present invention can correctly extract the binary mask map of the human body.

[0100] Experiment 2-Time Optimization Verification: A multi-threaded optimization method was designed. The specific running time comparison is shown in Table 1. Before optimization, the average processing time of the entire system for each frame was mostly around 55ms, which was exactly 16ms more than the average 38ms of the ORB-SLAM2 system. This 16ms is the time consumed by YOLO for deduction. After optimization, the average time consumption was reduced to 34ms, which is not only much faster than the sequential execution before optimization, but also faster than the ORB-SLAM2 system. This result is due to the fact that in dynamic scenes, the present invention shields dynamic feature points, and at the same time removes the additional computing consumption caused by dynamic feature points.

[0101] Table 1 Time consumption comparison between the present invention and ORB-SLAM2 on the walking sequence of fr3 (ms)

[0102]

[0103] Experiment 3-Verification of visual odometer function in dynamic scenes: The effectiveness of the algorithm of the present invention is verified by experiments in dynamic scenes in the public TUM dataset, and compared with the current excellent dynamic removal visual SLAM algorithm to demonstrate the superiority of the algorithm of the present invention. By displaying the trajectories calculated by the ORB-SLAM2 system and the improved system of the present invention in a three-dimensional coordinate system, as shown in the figure. Fig. 9 and Fig.10 As shown in the figure, the actual trajectory of the camera is represented by a black dotted line, and the system estimated trajectory is represented by a blue solid line. Fig. 9 The character in the figure sits on a chair and has only small movements. It can be seen from the three-dimensional trajectories of the two data sets that the error of the ORB-SLAM2 system is not too large overall. The estimated trajectory is roughly consistent with the true trajectory. Some errors are relatively large. After adding dynamic feature removal, the pose estimated by the present invention is more consistent with the true trajectory. Fig.10 The characters in the video are always moving, which greatly increases the dynamic feature points observed by the camera. The pose estimated by ORB-SLAM2 shows that there is a huge deviation in the estimation accuracy of the two data sets, and the entire system will no longer be stable. After adding dynamic feature removal, the pose calculated by the present invention is very consistent with the real trajectory.

[0104] In these two scene experiments, the present invention makes a three-dimensional display of the postures solved by the two systems. Through the three-dimensional graph, it can be intuitively understood that after adding dynamic feature removal, the accuracy of system positioning is no longer affected by dynamic characters. The more dynamic feature points there are, the more obvious the improvement of the system of the present invention is.

[0105] Through the above verification, it is proved that the present invention has relatively better performance in human segmentation mask, algorithm operation real-time, and visual odometer performance.

[0106] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments are contemplated within the scope of the invention thus described. The disclosure of the present invention is intended to be illustrative rather than restrictive of the scope of the invention, which is defined by the appended claims.

Claims

1. An image processing method, It is characterized in that include: Get the RGB image sequence and depth map sequence containing the target; Processing the RGB image sequence and the depth map sequence to obtain a target depth extraction map sequence; The target is screened out from the target depth extraction image sequence using a mask extraction algorithm based on K-means clustering to obtain a target binary mask sequence.

2. An image processing method according to claim 1, It is characterized in that After obtaining the target binary mask sequence, the dynamic feature points are removed to obtain the final segmentation mask extraction image.

3. An image processing method according to claim 1, It is characterized in that Processing the RGB image sequence and the depth map sequence to obtain a target depth extraction map sequence includes: using a target detection model to detect targets in the RGB image sequence to obtain a detection frame; and segmenting the target in the detection frame from the depth map sequence according to the detection frame to obtain a target depth extraction map sequence.

4. An image processing method according to claim 1, It is characterized in that The targets selected from the target depth extraction image sequence using the K-means clustering-based mask extraction algorithm include: Determine the window size of the target depth extraction map, and directly output the maximum depth value and the minimum depth value of the target depth extraction map if the window is smaller than a preset threshold; if the window is not smaller than the preset threshold, remove the 0 value and convert the two-dimensional depth map into one-dimensional data, where the elements in the one-dimensional data are defined as depth samples; The one-dimensional data is classified into three categories, the number of clusters of the K-means clustering algorithm is set to 3, and K-means clustering is performed. The index of the smallest centroid cluster and the index of the second smallest centroid cluster are obtained from the clustering results. Compare the sample quantities of the smallest centroid cluster and the second smallest centroid cluster, define the cluster with a larger sample quantity as a motion cluster, and calculate the standard deviation of the motion cluster; If the standard deviation of the motion cluster is less than the empirical value, and the number of samples contained in the motion cluster is greater than the preset percentage of the total number of samples, the maximum depth value and the minimum depth value in the motion cluster are output; If the standard deviation of the motion cluster is greater than the empirical value or the number of samples contained in the motion cluster is less than the preset percentage of the total number of samples, K-means clustering is performed again, the number of clusters is set to 2, and K-means clustering is performed again; and the obtained minimum centroid cluster is defined as the motion cluster, and the maximum depth and minimum depth in the minimum centroid cluster are output.

5. An image processing method according to claim 4, It is characterized in that After obtaining the target binary mask sequence, removing the dynamic feature points includes: generating a mask pyramid based on the image pyramid; marking the feature points within the mask range according to the mask pyramid, and removing the dynamic feature points by prohibiting the feature points from generating map points.

6. An image processing device, It is characterized in that include: An image sequence acquisition module, configured to acquire an RGB image sequence and a depth map sequence containing a target; A target depth map extraction module, configured to process the RGB image sequence and the depth map sequence to obtain a target depth extraction map sequence; The target segmentation mask extraction module is configured to use a mask extraction algorithm based on K-means clustering to screen out targets in the target depth extraction image sequence to obtain a target binary mask sequence.

7. An image processing device according to claim 6, It is characterized in that It also includes a dynamic feature point removal module, which is configured to generate a mask pyramid based on the image pyramid after obtaining the target binary mask sequence; mark the feature points within the mask range according to the mask pyramid, remove the dynamic feature points by prohibiting the feature points from generating map points, and obtain the final segmentation mask extraction map.

8. An image processing device according to claim 6, It is characterized in that The target segmentation mask extraction module uses a K-means clustering-based mask extraction algorithm to filter out targets in the target depth extraction image sequence, including: Determine the window size of the target depth extraction map, and directly output the maximum depth value and the minimum depth value of the target depth extraction map if the window is smaller than a preset threshold; if the window is not smaller than the preset threshold, remove the 0 value and convert the two-dimensional depth map into one-dimensional data, where the elements in the one-dimensional data are defined as depth samples; The one-dimensional data is classified into three categories, the number of clusters of the K-means clustering algorithm is set to 3, and K-means clustering is performed. The index of the smallest centroid cluster and the index of the second smallest centroid cluster are obtained from the clustering results. Compare the sample quantities of the smallest centroid cluster and the second smallest centroid cluster, define the cluster with a larger sample quantity as a motion cluster, and calculate the standard deviation of the motion cluster; If the standard deviation of the motion cluster is less than the empirical value, and the number of samples contained in the motion cluster is greater than the preset percentage of the total number of samples, the maximum depth value and the minimum depth value in the motion cluster are output; If the standard deviation of the motion cluster is greater than the empirical value or the number of samples contained in the motion cluster is less than the preset percentage of the total number of samples, K-means clustering is performed again, the number of clusters is set to 2, and K-means clustering is performed again; and the obtained minimum centroid cluster is defined as the motion cluster, and the maximum depth and minimum depth in the minimum centroid cluster are output.

9. A robot visual odometer, It is characterized in that The image processing method described in any one of claims 1 to 5 is used to process the image sequence captured by the camera on the robot to determine the position and posture of the robot.

10. A robot visual odometer according to claim 9, It is characterized in that In the target detection thread that detects the target in the RGB image sequence using the target detection model, the front-end visual odometer uses the detection result of the target detection thread on the previous frame.

Citation Information

Patent Citations

  • Image clustering result evaluation method and apparatus

    CN108564102A

  • Vehicle-mounted point cloud clustering method based on context characteristics and graph cut algorithm

    CN110046661A

  • Depth map optimization method and device, equipment and storage medium

    CN114842063A

  • Image processing method and device, equipment, storage medium and program product

    CN114972433A

  • Visual SLAM optimization method in dynamic scene based on deep learning and GPU acceleration

    CN118097265A