Target detection method based on image semantic tag and point cloud data fusion
Through the fusion method of image semantic labels and point cloud data, the problem of low accuracy of three-dimensional target detection in the existing technology is solved, higher detection accuracy and precision are achieved, and the sensor calibration process is simplified.
Patent Information
- Application Number
- CN202410772784.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-18
AI Technical Summary
Three-dimensional target detection methods in the existing technology suffer from low detection accuracy due to the high complexity of the fusion strategy and the high requirements for sensor calibration.
Using a fusion method based on image semantic labels and point cloud data, the SLIC algorithm is used for superpixel segmentation and the GMA algorithm to extract optical flow features, combined with ISODATA clustering to generate a semantic label map, and a neural prior scene flow model is used to densify the point cloud. , generate a dense semantic point cloud for target detection.
It improves the accuracy and precision of target detection, reduces the need for sensor calibration, simplifies the fusion strategy, enhances image data processing and point cloud density, and can better reflect scene shape and object semantic characteristics.
Smart Images

Figure CN118799549A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology, and in particular to a target detection method, device and readable storage medium based on image semantic label and point cloud data fusion. Background Art
[0002] With the increasing popularity of commercial 3D scanners, multimodal fusion tasks and 3D object detection tasks have been widely and deeply studied in the fields of autonomous driving, robot navigation, etc.; however, missed detection and false detection of 3D object detection reduce the safety and efficiency of the system.
[0003] At present, the main point cloud 3D detection methods are: projection-based methods project 3D point cloud data onto a two-dimensional plane (such as a bird's-eye view or a front view), and then use traditional 2D target detection algorithms (such as Faster R-CNN, YOLO series) for processing. The limitation of this type of method is that important depth information may be lost during the projection process, resulting in reduced detection accuracy; voxel-based methods voxelize point cloud data (i.e., divide it into small cubes), and then apply 3D convolutional neural networks for analysis. The limitations of this type of method are the information loss in the voxelization process and the large demand for computing resources, especially for large-scale scenes; the development of PointNet and its variants realizes the direct processing of point cloud data, and performs target detection by learning the global feature representation of the point cloud. The limitations of this type of method are the low computational efficiency of processing a large number of points and sensitivity to noise and density changes; based on the defects of the above-mentioned technologies, multimodal fusion methods combining point cloud data with images or other sensor data have been effectively promoted. This type of method uses complementary information between different modalities for detection, but due to the high complexity of the fusion strategy of this type of method and the high requirement for calibration of different sensors, the accuracy of the model detection accuracy is affected. Summary of the invention
[0004] To this end, the technical problem to be solved by the present invention is to overcome the problem of low three-dimensional target detection accuracy caused by the high complexity of the fusion strategy and the high calibration requirements for different sensors in the prior art.
[0005] In order to solve the above technical problems, the present invention provides a target detection method based on image semantic label and point cloud data fusion, comprising:
[0006] The camera continuously shoots the current scene to obtain multiple frames of original images; the laser radar continuously scans the current scene to obtain multiple frames of original point clouds; the multiple frames of original images and multiple frames of original point clouds are temporally and spatially registered to obtain each frame of target image and each frame of target point cloud;
[0007] For any two adjacent target images, the SLIC algorithm is used to perform superpixel segmentation on the target image of the latter frame to obtain the static features of the target image of the latter frame; the GMA algorithm is used to extract the optical flow of the target image of the latter frame relative to the target image of the former frame to obtain the dynamic features of the target image of the latter frame; the static features and dynamic features of the target image of the latter frame are merged to obtain the merged features of each pixel in the target image of the latter frame; the ISODATA clustering algorithm is used to cluster the merged features of each pixel in the target image of the latter frame, and the semantic label map of the target image of the latter frame is generated according to the clustering results; the semantic label maps of the target images of the second frame to the last frame are obtained in sequence;
[0008] Based on the neural prior scene flow model, the target point clouds of the two adjacent frames are registered in turn, the target point cloud of the previous frame is moved to the target point cloud of the next frame, the densification of the target point cloud of the second frame to the target point cloud of the last frame is completed, and the dense point cloud from the second frame to the last frame is generated;
[0009] Generate a densified semantic point cloud from the second frame to the last frame according to the semantic label map from the second frame to the last frame and the dense point cloud from the second frame to the last frame; wherein each point cloud in each frame of the dense semantic point cloud contains coordinate information, RGB information and semantic information;
[0010] All the obtained densified semantic point clouds are input into the target detection network to complete the target detection task for the current scene.
[0011] Preferably, performing spatiotemporal registration on multiple frames of original images and multiple frames of original point clouds to obtain each frame of target image and each frame of target point cloud comprises:
[0012] According to the timestamp corresponding to each frame of the original image and the timestamp corresponding to each frame of the original point cloud, the original image and the original point cloud corresponding to each same timestamp are determined, the time registration of the original image and the original point cloud is completed, and the original image frames and the original point cloud frames after time registration are obtained;
[0013] The camera intrinsic parameter matrix is determined according to the focal length and light spot distance of the camera. The camera-radar extrinsic parameter matrix is determined according to the rotation matrix and translation matrix of the joint calibration of the camera and the lidar. The original image frames and the original point clouds of each frame after time registration are spatially registered according to the camera intrinsic parameter matrix and the camera-radar extrinsic parameter matrix to obtain the original image frames and the original point clouds of each frame after time-space registration as the target images of each frame and the target point clouds of each frame. Among them, each pixel point in the target image of each frame and each point in the target point cloud of each frame contain coordinate information and RGB information.
[0014] Preferably, the SLIC algorithm is used to perform superpixel segmentation on the target image of the t+1th frame, and the static features of the target image of the t+1th frame obtained include:
[0015] Based on the transformation principle of RGB color model and LAB color model, the target image of frame t+1 is transformed into LAB color model, and combined with the spatial coordinate information of the target image of frame t+1, the five-dimensional feature vectors of each group after the target image of frame t+1 is transformed into CIE-LAB color space are obtained; among which, the wth group of five-dimensional feature vectors is expressed as: C w =[l w ,a w ,b w ,x w ,y w ] T , l w 、a w 、b w Respectively represent the L, A, and B parameters of the w-th pixel, x w ,y w represents the spatial coordinates of the w-th pixel; R represents red information; G represents green information; B represents blue information; L represents brightness information; A represents the range from red to green; B represents the range from yellow to blue;
[0016] According to the number of pixels N of the target image in the t+1th frame and the preset number of superpixels K, the step size S is determined, and its expression is: Initialize each seed point according to the step size S; move each seed point to the position with the smallest gradient in the n*n neighborhood; where n=3;
[0017] Search and traverse the 2S×2S neighborhood around each seed point to obtain each pixel point in the neighborhood; calculate the distance between each pixel point in the neighborhood and the current seed point respectively, then the calculation formulas for the distance D' between the i-th pixel point in the neighborhood and the current seed point are:
[0018]
[0019] Among them, d c Indicates the color distance between the hth pixel in the neighborhood and the current seed point; d s Indicates the spatial distance between the hth pixel point in the neighborhood and the current seed point; l k 、a k 、b k Respectively represent the L, A, and B parameters of the current seed point; x k ,y k Respectively represent the spatial coordinates of the current seed point; l h 、a h 、b h Respectively represent the L, A, and B parameters of the h-th pixel in the neighborhood; x h ,y hThey represent the spatial coordinates of the h-th pixel in the neighborhood; m represents a fixed constant whose value range is [1,40]. The seed point corresponding to the minimum value of D' is taken as the cluster center of the h-th pixel in the neighborhood;
[0020] The iterative calculation is performed until the preset number of iterations is reached, and the final SLIC superpixel segmentation result is the static feature of the target image of the t+1th frame.
[0021] Preferably, the GMA algorithm is used to extract the optical flow of the target image of the t+1th frame relative to the target image of the tth frame, and the dynamic features of the target image of the t+1th frame are obtained, including:
[0022] Through the context encoder, a context feature map of each pixel in the target image of the t+1th frame is obtained; according to the projection of the context feature map of each pixel in the target image of the t+1th frame, a query feature map and a key feature map are obtained;
[0023] A motion feature map between corresponding pixels at the same position in the target image of the t-th frame and the target image of the t+1-th frame is extracted through a feature encoder; a value feature map is obtained according to the projection of the motion feature map between corresponding pixels at the same position in the target image of the t-th frame and the target image of the t+1-th frame;
[0024] According to the dot product of the query feature map and the key feature map, combined with softmax, the attention matrix is obtained; by aggregating the points mapped by the attention matrix and the value feature map, the global aggregate feature is obtained, and its expression is:
[0025]
[0026] in, represents the global aggregation feature of the i-th pixel in the target image of the t+1th frame; X i , X j Denote the context features of the i-th pixel and the j-th pixel in the target image of the t+1th frame respectively; Y i represents the motion feature between the i-th pixel in the target image of the t-th frame and the i-th pixel in the target image of the t+1-th frame; Y j represents the motion feature between the jth pixel in the target image of the tth frame and the jth pixel in the target image of the t+1th frame; M = H × W, H and W represent the dimensions of the feature; α represents a learnable parameter; θ, φ, σ represent the projection vectors of the query, key, and value, respectively; f(·) represents the similarity attention function;
[0027] The global aggregation features of each pixel in the target image of the t+1th frame are obtained in sequence, thereby obtaining the dynamic features of the target image of the t+1th frame.
[0028] Preferably, clustering the merged features of each pixel in the target image of the t+1th frame using the ISODATA clustering algorithm, and generating a semantic label map of the target image of the t+1th frame according to the clustering result includes:
[0029] S61: Set the expected number of classes N l , the number of initial cluster centers N c , and the number of iterations N s ; Select the initial cluster center;
[0030] S62: Allocate each pixel in the target image of the t+1th frame to each class according to the nearest neighbor rule;
[0031] S63: judging whether merging is required according to the minimum number of pixels in any class;
[0032] If the number of pixels in the current class is less than the minimum number of pixels in any class, the cluster center is cancelled and the number of cluster centers is updated to N. c -1; according to the updated number of cluster centers N c -1, assign each pixel in the target image of the t+1th frame to each class according to the nearest neighbor rule; calculate the cluster centers of each classified class, the average distance of each pixel in each class to the cluster center of the current class, and the overall average distance of each pixel to the cluster center of the current class;
[0033] If the number of pixels in the current class is not less than the minimum number of pixels in any class, the cluster center is retained, and the cluster centers of each class after classification, the average distance from each pixel in each class to the cluster center of the current class, and the overall average distance from each pixel to the cluster center of the current class are calculated;
[0034] S64: If the number of iterations Ip = N s , the clustering ends;
[0035] If N c ≤N l / 2, then perform a split operation; if N c ≥2N l , then perform a merge operation; if N l / 2 <N c <2N l , when the number of iterations Ip is an odd number, a split operation is performed, and when the number of iterations Ip is an even number, a merge operation is performed;
[0036] S65: If the number of iterations Ip = N s Or the process converges, the clustering ends; otherwise, the number of iterations is updated to Ip+1, and the iteration continues until the number of iterations Ip=N sOr the process converges and clustering ends;
[0037] Generate the semantic label map of the target image in the t+1th frame based on the clustering results.
[0038] Preferably, based on the neural prior scene flow model, the target point clouds of the t-th frame and the t+1-th frame are registered, the target point cloud of the t-th frame is moved to the target point cloud of the t+1-th frame, the densification of the target point cloud of the t+1-th frame is completed, and the dense point cloud of the t+1-th frame is generated, and its expression is:
[0039] PC' t+1 =PC t+1 +SF t,t+1
[0040] SF t,t+1 =F(PC t ,PC t+1 ,Θ t,t+1 )
[0041] Among them, PC' t+1 is the dense point cloud of the t+1th frame; PC t+1 is the target point cloud of the t+1th frame; SF(·) represents the scene flow estimation model; Θ t,t+1 Represents the set of model parameters between the point cloud points corresponding to each corresponding position in the target point cloud of the tth frame and the target point cloud of the t+1th frame.
[0042] Preferably, the camera intrinsic parameter matrix K is expressed as:
[0043]
[0044] Among them, (f u ,f v ) represents the focal length of the camera; (c u ,c v ) represents the optical center distance of the camera; based on the camera intrinsic parameter matrix, the point cloud is transformed from the camera coordinate system to the image projection coordinate system.
[0045] Preferably, the expression of the camera-radar external parameter matrix M is:
[0046]
[0047] Among them, r x 、r y 、r z Respectively represent the rotation error angles of the x, y, and z axes in the world coordinates; R(r x ,r y ,r z ) represents the rotation matrix; T represents the translation matrix; based on the camera-radar extrinsic matrix, the point cloud is transformed from the lidar coordinate system to the camera coordinate system.
[0048] The present invention also provides a target detection device based on image semantic label and point cloud data fusion, comprising:
[0049] Memory for storing computer programs;
[0050] A processor is used to implement the steps of the above-mentioned target detection method based on the fusion of image semantic tags and point cloud data when executing the computer program.
[0051] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned target detection method based on the fusion of image semantic labels and point cloud data are implemented.
[0052] The above technical solution of the present invention has the following beneficial effects compared with the prior art:
[0053] The object detection method based on image semantic label and point cloud data fusion described in the present invention firstly adopts superpixel segmentation to obtain static features of the target image from the second frame to the last frame of the current scene, adopts optical flow to extract dynamic features of the target image from the second frame to the last frame of the current scene, and clusters the features after merging the static features and dynamic features of the target image from the second frame to the last frame of the current scene through the ISODAT clustering algorithm, thereby extracting rich semantic labels of the target image from the second frame to the last frame of the current scene, and generating a semantic label map from the second frame to the last frame of the current scene, thereby enhancing the processing of image data; secondly, based on the neural prior scene flow model, densification of the target point cloud from the second frame to the last frame of the current scene is completed, and a dense point cloud from the second frame to the last frame of the current scene is generated, so as to increase the density of the target point cloud from the second frame to the last frame of the current scene, and facilitate revealing the details and key features of each object in the current scene; finally, through the semantic The label map and dense point cloud generate a densified semantic point cloud, which effectively integrates the semantic information in the image into the point cloud data, so that each point cloud point can not only fully reflect the shape and structure of the scene, but also accurately describe the semantic characteristics and dynamic changes of the object, thereby improving the accuracy of target detection in the current scene; in the above process, the present invention completes the fusion of the image-point cloud matching relationship under the same coordinate by calibrating different sensors only, without considering strategy fusion, thus avoiding the complexity of the fusion strategy; at the same time, the present invention reduces the need for precise calibration between sensors to a certain extent and improves the accuracy of target detection by densifying the point cloud and enhancing image data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein
[0055] Figure 1 It is a flow chart of a target detection method based on image semantic label and point cloud data fusion provided by the present invention;
[0056] Figure 2 It is a schematic diagram of spatiotemporal registration;
[0057] Figure 3 This is a schematic diagram of merging two frames of point cloud to achieve point cloud densification;
[0058] Figure 4 It is a schematic diagram of two frames of target point cloud, where: Figure 4 (a) in the figure shows a point cloud diagram of a frame in target detection example 1; Figure 4 (b) in the figure shows a point cloud diagram of a frame in target detection example 2;
[0059] Figure 5 It is a schematic diagram of two frames of dense point cloud, where Figure 5 (a) in the figure shows a schematic diagram of a dense point cloud in target detection example 1; Figure 5 (b) in the figure shows a schematic diagram of a dense point cloud in target detection example 2;
[0060] Figure 6 It is a schematic diagram of two frames of dense semantic point cloud, where Figure 6 (a) in the figure shows a schematic diagram of a dense semantic point cloud in target detection example 1; Figure 6 (b) in the figure shows a schematic diagram of a dense semantic point cloud in target detection example 2;
[0061] Figure 7 This is the result graph of target detection example 1;
[0062] Figure 8 This is the result image of target detection example 2. DETAILED DESCRIPTION
[0063] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0064] Reference Figure 1 As shown, Figure 1 A flow chart of a target detection method based on image semantic label and point cloud data fusion provided by the present invention; specifically comprising:
[0065] S1: Continuously shoot the current scene with a camera to obtain multiple frames of original images; continuously scan the current scene with a lidar to obtain multiple frames of original point clouds;
[0066] S2: Performing spatiotemporal registration on multiple frames of original images and multiple frames of original point clouds to obtain target images and target point clouds of each frame, including:
[0067] According to the timestamp corresponding to each frame of the original image and the timestamp corresponding to each frame of the original point cloud, the original image and the original point cloud corresponding to each same timestamp are determined, the time alignment of the original image and the original point cloud is completed, and the original image and the original point cloud of each frame after time alignment are obtained; Figure 2 As shown, since the frame rate of obtaining the original image is different from the frame rate of obtaining the original point cloud, each frame of the original image and each frame of the original point cloud are marked by a timestamp, that is, each frame of the original image corresponds to a timestamp, and each frame of the original point cloud corresponds to a timestamp. If the timestamp corresponding to the first appearance of the original image of the current frame is the same as the timestamp of the original point cloud of the current frame, the original image corresponding to the current timestamp is used as the first frame of the original image after time alignment, and the original point cloud corresponding to the current timestamp is used as the first frame of the original point cloud after time alignment. By analogy, the original images and original point clouds corresponding to the same timestamps are found, the time alignment of the original images and the original point clouds is completed, and the original images and original point clouds of each frame after time alignment are obtained.
[0068] According to the focal length and light spot distance of the camera, the camera intrinsic parameter matrix K is determined, and its expression is:
[0069]
[0070] Among them, (f u ,f v ) represents the focal length of the camera; (c u ,c v ) represents the optical center distance of the camera; based on the camera intrinsic parameter matrix, the point cloud is transformed from the camera coordinate system to the image projection coordinate system;
[0071] According to the joint calibration rotation matrix R and translation matrix T of the camera and lidar, the camera-radar external parameter matrix M is determined, and its expression is:
[0072]
[0073] Among them, r x 、r y 、r z Respectively represent the rotation error angles of the x, y, and z axes in the world coordinates; R(r x ,r y ,r z) represents the rotation matrix; T represents the translation matrix; based on the camera-radar extrinsic matrix, the point cloud is transformed from the lidar coordinate system to the camera coordinate system;
[0074] According to the camera intrinsic parameter matrix and the camera-radar extrinsic parameter matrix, the original images of each frame and the original point cloud of each frame after time registration are spatially registered to obtain the original images of each frame and the original point cloud of each frame after time-space registration as the target images of each frame and the target point cloud of each frame; wherein, the purpose of spatially registering the original images of each frame and the original point cloud of each frame after time registration is to make each pixel point in each frame target image and each point cloud point in each frame target point cloud contain coordinate information and RGB information, that is, whether each pixel point or each point cloud point contains structural features (XYZ) and color features (RGB), then in the subsequent processing steps of each frame target image and each frame point cloud, the features of each pixel point are consistent with the features of the point cloud points corresponding to each pixel point;
[0075] S3: For any two adjacent target frames, the SLIC algorithm is used to perform superpixel segmentation on the target image of the latter frame to obtain the static features of the target image of the latter frame, including:
[0076] Take the target image of frame t+1 as an example, where t≥1;
[0077] Based on the transformation principle of RGB color model and LAB color model, the target image of frame t+1 is transformed into LAB color model, and combined with the spatial coordinate information of the target image of frame t+1, the five-dimensional feature vectors of each group after the target image of frame t+1 is transformed into CIE-LAB color space are obtained; among which, the wth group of five-dimensional feature vectors is expressed as: C w =[l w ,a w ,b w ,x w ,y s ] T , l w 、a w 、b w Respectively represent the L, A, and B parameters of the w-th pixel, x w ,y w Represents the spatial coordinates of the w-th pixel; R represents red information; G represents green information; B represents blue information; L represents brightness information, and its value range is [0,100], representing from pure black to pure white; A represents the range from red to green, and its value range is [127,-128]; B represents the range from yellow to blue, and its value range is [127,-128];
[0078] According to the number of pixels N of the target image in the t+1th frame and the preset number of superpixels K, the step size S is determined, and its expression is: Initialize each seed point according to the step size S; move each seed point to the position with the smallest gradient in the n*m neighborhood; where n=3;
[0079] Search and traverse the 2S×2S neighborhood around each seed point to obtain each pixel point in the neighborhood; calculate the distance between each pixel point in the neighborhood and the current seed point respectively, then the calculation formulas for the distance D' between the i-th pixel point in the neighborhood and the current seed point are:
[0080]
[0081] Among them, d c Indicates the color distance between the hth pixel in the neighborhood and the current seed point; d s Indicates the spatial distance between the hth pixel point in the neighborhood and the current seed point; l k 、a k 、b k Respectively represent the L, A, and B parameters of the current seed point; x k ,y k Respectively represent the spatial coordinates of the current seed point; l h 、a h 、b h Respectively represent the L, A, and B parameters of the h-th pixel in the neighborhood; x h ,y h They represent the spatial coordinates of the h-th pixel in the neighborhood; m represents a fixed constant whose value range is [1,40]. The seed point corresponding to the minimum value of D' is taken as the cluster center of the h-th pixel in the neighborhood;
[0082] Iterate the calculation until the preset number of iterations is reached, and the final SLIC superpixel segmentation result is the static feature of the target image of the t+1th frame;
[0083] The static features of the second frame target image to the last frame target image can be obtained in sequence;
[0084] S4: Using the GMA algorithm, extract the optical flow of the target image in the subsequent frame relative to the target image in the previous frame, and obtain the dynamic features of the target image in the subsequent frame, including:
[0085] Take the target image of the tth frame and the t+1th frame as an example, where t≥1;
[0086] Through the context encoder, a context feature map of each pixel in the target image of the t+1th frame is obtained; according to the projection of the context feature map of each pixel in the target image of the t+1th frame, a query feature map and a key feature map are obtained;
[0087] Through the feature encoder, a motion feature map between corresponding pixels at the same position in the t-th frame target image and the t+1-th frame target image is extracted; according to the projection of the motion feature map between corresponding pixels at the same position in the t-th frame target image and the t+1-th frame target image, a value feature map is obtained; wherein, the motion feature between the corresponding pixel at the P position in the t-th frame target image and the corresponding pixel at the P position in the t+1-th frame target image is extracted; if the corresponding pixel at the P position is the p-th pixel, the motion feature between the p-th pixel in the t-th frame target image and the p-th pixel in the t+1-th frame target image is extracted;
[0088] According to the dot product of the query feature map and the key feature map, combined with softmax, the attention matrix is obtained; by aggregating the points mapped by the attention matrix and the value feature map, the global aggregate feature is obtained, and its expression is:
[0089]
[0090] in, represents the global aggregation feature of the i-th pixel in the target image of the t+1th frame; X i , X j Denote the context features of the i-th pixel and the j-th pixel in the target image of the t+1th frame respectively; Y i represents the motion feature between the i-th pixel in the target image of the t-th frame and the i-th pixel in the target image of the t+1-th frame; Y j represents the motion feature between the jth pixel in the target image of the tth frame and the jth pixel in the target image of the t+1th frame; M = H × W, H and W represent the dimensions of the feature; α represents a learnable parameter; θ, φ, σ represent the projection vectors of the query, key, and value, respectively; f(·) represents the similarity attention function;
[0091] The global aggregation features of each pixel in the target image of the t+1th frame are obtained in sequence, thereby obtaining the dynamic features of the target image of the t+1th frame;
[0092] The dynamic features of the second frame target image to the last frame target image are obtained in sequence;
[0093] S5: merging the static features and dynamic features of the target image of the subsequent frame to obtain the merged features of each pixel in the target image of the subsequent frame; and sequentially obtaining the merged features of each pixel in the target image of the second frame to the target image of the last frame;
[0094] S6: Using the ISODATA clustering algorithm, cluster the merged features of each pixel in the target image of the subsequent frame, and generate a semantic label map of the target image of the subsequent frame according to the clustering result, including:
[0095] Take the merged features of the target image in the t+1th frame as an example, where t≥1;
[0096] S61: Set the expected number of classes N l , the number of initial cluster centers N c , and the number of iterations N s ; Select the initial cluster center;
[0097] S62: Allocate each pixel in the target image of the t+1th frame to each class according to the nearest neighbor rule;
[0098] S63: judging whether merging is required according to the minimum number of pixels in any class;
[0099] If the number of pixels in the current class is less than the minimum number of pixels in any class, the cluster center is cancelled and the number of cluster centers is updated to N. c -1; according to the updated number of cluster centers N c -1, assign each pixel in the target image of the t+1th frame to each class according to the nearest neighbor rule; calculate the cluster centers of each classified class, the average distance of each pixel in each class to the cluster center of the current class, and the overall average distance of each pixel to the cluster center of the current class;
[0100] If the number of pixels in the current class is not less than the minimum number of pixels in any class, the cluster center is retained, and the cluster centers of each class after classification, the average distance from each pixel in each class to the cluster center of the current class, and the overall average distance from each pixel to the cluster center of the current class are calculated;
[0101] S64: If the number of iterations Ip = N s , the clustering ends;
[0102] If N c ≤N l / 2, then perform a split operation; if N c ≥2N l , then perform a merge operation; if N l / 2 <N c <2N l , when the number of iterations IP is an odd number, a split operation is performed, and when the number of iterations IP is an even number, a merge operation is performed;
[0103] S65: If the number of iterations Ip = N s Or the process converges, the clustering ends; otherwise, the number of iterations is updated to Ip+1, and the iteration continues until the number of iterations Ip=N s Or the process converges and clustering ends;
[0104] Generate the semantic label map of the target image of the t+1th frame based on the clustering results;
[0105] Obtain the semantic label map of the second frame target image to the last frame target image in sequence
[0106] S7: Based on the neural prior scene flow model, the target point clouds of two consecutive frames are registered in sequence, the target point cloud of the previous frame is moved to the target point cloud of the next frame, the densification of the target point cloud of the second frame to the target point cloud of the last frame is completed, and the dense point cloud from the second frame to the last frame is generated, including:
[0107] Take the target point cloud of the tth frame and the t+1th frame as an example, where t≥1;
[0108] Based on the neural prior scene flow model, the target point clouds of the t-th frame and the t+1-th frame are registered, the target point cloud of the t-th frame is moved to the target point cloud of the t+1-th frame, the densification of the target point cloud of the t+1-th frame is completed, and the dense point cloud of the t+1-th frame is generated. The expression is:
[0109] PC' t+1 =PC t+1 +SF t,t+1
[0110] SF t,t+1 =F(PC t ,PC t+1 ,Θ t,t+1 )
[0111] Among them, PC' t+1 is the dense point cloud of the t+1th frame; PC t+1 is the target point cloud of the t+1th frame; SF(·) represents the scene flow estimation model; Θ t,t+1 represents the set of model parameters between the point cloud points corresponding to each corresponding position in the target point cloud of the tth frame and the target point cloud of the t+1th frame, Θ t,t+1 ={θ1,θ2,...,θ Q}, Q represents the number of target point clouds / dense point clouds in each frame; where θ Q represents the model parameter between the point cloud point corresponding to the Q position in the target point cloud of the t-th frame and the point cloud point corresponding to the Q position in the target point cloud of the t+1-th frame; if the point cloud point corresponding to the Q position is the q-th point cloud point, then θ Q It can be expressed as the model parameter between the qth point cloud point in the target point cloud of the tth frame and the qth point cloud point in the target point cloud of the t+1th frame;
[0112] The densification of the target point cloud from the second frame to the last frame is completed in sequence, and the dense point cloud from the second frame to the last frame is generated. Figure 3 As shown;
[0113] S8: generating a densified semantic point cloud from the second frame to the last frame according to the semantic label map from the second frame to the last frame and the dense point cloud from the second frame to the last frame; wherein each point cloud in each frame of the dense semantic point cloud contains coordinate information, RGB information and semantic information;
[0114] S9: Input all the obtained densified semantic point clouds into the target detection network to complete the target detection task for the current scene.
[0115] Based on the above S7-S9, in a specific embodiment of the present invention, based on Figure 4 (a) in the equation, we get Figure 5 (a) in , thus we get Figure 6 (a) in the final result is Figure 7 The result diagram of target detection example 1 shown in the figure; based on Figure 4 (b) in the above equation, we get Figure 5 (b) in , thus obtaining Figure 6 (b) in the final result is Figure 8 The result graph of target detection example 2 is shown.
[0116] A specific embodiment of the present invention also provides a target detection device based on the fusion of image semantic labels and point cloud data, including: a memory for storing a computer program; a processor for implementing the steps of the above-mentioned target detection method based on the fusion of image semantic labels and point cloud data when executing the computer program.
[0117] A specific embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned target detection method based on the fusion of image semantic labels and point cloud data are implemented.
[0118] 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.
[0119] 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.
[0120] 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.
[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0122] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.
Claims
1. An object detection method based on image semantic label and point cloud data fusion, It is characterized in that include: Continuously shoot the current scene with the camera to obtain multiple frames of original images; Continuously scan the current scene through the laser radar to obtain multiple frames of original point clouds; Performing spatiotemporal registration on multiple frames of original images and multiple frames of original point clouds to obtain target images and target point clouds of each frame; For any two adjacent target frames, the SLIC algorithm is used to perform superpixel segmentation on the target image of the latter frame to obtain the static features of the target image of the latter frame. The GMA algorithm is used to extract the optical flow of the target image in the subsequent frame relative to the target image in the previous frame, and the dynamic characteristics of the target image in the subsequent frame are obtained; The static features and dynamic features of the target image of the subsequent frame are merged to obtain the merged features of each pixel in the target image of the subsequent frame; the merged features of each pixel in the target image of the subsequent frame are clustered using the ISODATA clustering algorithm, and a semantic label map of the target image of the subsequent frame is generated according to the clustering result; the semantic label maps of the target image of the second frame to the last frame are obtained in sequence; Based on the neural prior scene flow model, the target point clouds of the two adjacent frames are registered in turn, the target point cloud of the previous frame is moved to the target point cloud of the next frame, the densification of the target point cloud of the second frame to the target point cloud of the last frame is completed, and the dense point cloud from the second frame to the last frame is generated; Generate a densified semantic point cloud from the second frame to the last frame according to the semantic label map from the second frame to the last frame and the dense point cloud from the second frame to the last frame; wherein each point cloud in each frame of the dense semantic point cloud contains coordinate information, RGB information and semantic information; All the obtained densified semantic point clouds are input into the target detection network to complete the target detection task for the current scene.
2. According to claim 1, a target detection method based on image semantic label and point cloud data fusion, It is characterized in that The performing spatiotemporal registration of multiple frames of original images and multiple frames of original point clouds to obtain each frame of target image and each frame of target point cloud comprises: According to the timestamp corresponding to each frame of the original image and the timestamp corresponding to each frame of the original point cloud, the original image and the original point cloud corresponding to each same timestamp are determined, the time registration of the original image and the original point cloud is completed, and the original image frames and the original point cloud frames after time registration are obtained; The camera intrinsic parameter matrix is determined according to the focal length and light spot distance of the camera. The camera-radar extrinsic parameter matrix is determined according to the rotation matrix and translation matrix of the joint calibration of the camera and the lidar. According to the camera intrinsic parameter matrix and the camera-radar extrinsic parameter matrix, each frame of the original image and each frame of the original point cloud after time registration are spatially registered to obtain each frame of the original image and each frame of the original point cloud after time and space registration as each frame of the target image and each frame of the target point cloud. Among them, each pixel point in each frame of the target image and each point cloud point in each frame of the target point cloud contain coordinate information and RGB information.
3. According to claim 1, a target detection method based on image semantic label and point cloud data fusion, It is characterized in that Using the SLIC algorithm, the superpixel segmentation is performed on the target image of the t+1th frame, and the static features of the target image of the t+1th frame are obtained, including: Based on the transformation principle of RGB color model and LAB color model, the target image of frame t+1 is transformed into LAB color model, and combined with the spatial coordinate information of the target image of frame t+1, the five-dimensional feature vectors of each group after the target image of frame t+1 is transformed into CIE-LAB color space are obtained; among which, the wth group of five-dimensional feature vectors is expressed as: C w =[l w ,a w ,b w ,x w ,y s ] T , l w 、a w 、b w Respectively represent the L, A, and B parameters of the w-th pixel, x w ,y w represents the spatial coordinates of the w-th pixel; R represents red information; G represents green information; B represents blue information; L represents brightness information; A represents the range from red to green; B represents the range from yellow to blue; According to the number of pixels N of the target image in the t+1th frame and the preset number of superpixels K, the step size S is determined, and its expression is: Initialize each seed point according to the step size S; move each seed point to the position with the smallest gradient in the n*n neighborhood; where n=3; Search and traverse the 2S×2S neighborhood around each seed point to obtain each pixel point in the neighborhood; calculate the distance between each pixel point in the neighborhood and the current seed point respectively, then the calculation formulas for the distance D' between the i-th pixel point in the neighborhood and the current seed point are: Among them, d c Indicates the color distance between the hth pixel in the neighborhood and the current seed point; d s Indicates the spatial distance between the hth pixel point in the neighborhood and the current seed point; l k 、a k , b k Respectively represent the L, A, and B parameters of the current seed point; x k ,y k Respectively represent the spatial coordinates of the current seed point; l h 、a h , b h Respectively represent the L, A, and B parameters of the h-th pixel in the neighborhood; x h ,y h They represent the spatial coordinates of the h-th pixel in the neighborhood; m represents a fixed constant whose value range is [1,40]. The seed point corresponding to the minimum value of D' is taken as the cluster center of the h-th pixel in the neighborhood; The iterative calculation is performed until the preset number of iterations is reached, and the final SLIC superpixel segmentation result is the static feature of the target image of the t+1th frame.
4. According to claim 1, a target detection method based on image semantic label and point cloud data fusion, It is characterized in that Using the GMA algorithm, the optical flow of the target image of the t+1th frame relative to the target image of the tth frame is extracted, and the dynamic features of the target image of the t+1th frame are obtained, including: Through the context encoder, a context feature map of each pixel in the target image of the t+1th frame is obtained; according to the projection of the context feature map of each pixel in the target image of the t+1th frame, a query feature map and a key feature map are obtained; A motion feature map between corresponding pixels at the same position in the target image of the t-th frame and the target image of the t+1-th frame is extracted through a feature encoder; a value feature map is obtained according to the projection of the motion feature map between corresponding pixels at the same position in the target image of the t-th frame and the target image of the t+1-th frame; According to the dot product of the query feature map and the key feature map, combined with softmax, the attention matrix is obtained; by aggregating the points mapped by the attention matrix and the value feature map, the global aggregate feature is obtained, and its expression is: in, represents the global aggregation feature of the i-th pixel in the target image of the t+1th frame; X i , X j Denote the context features of the i-th pixel and the j-th pixel in the target image of the t+1th frame respectively; Y i represents the motion feature between the i-th pixel in the target image of the t-th frame and the i-th pixel in the target image of the t+1-th frame; Y j represents the motion feature between the jth pixel in the target image of the tth frame and the jth pixel in the target image of the t+1th frame; M = H × W, H and W represent the dimensions of the feature; α represents a learnable parameter; θ, φ, σ represent the projection vectors of the query, key, and value, respectively; f(·) represents the similarity attention function; The global aggregation features of each pixel in the target image of the t+1th frame are obtained in sequence, thereby obtaining the dynamic features of the target image of the t+1th frame.
5. The target detection method based on image semantic label and point cloud data fusion according to claim 1, It is characterized in that The ISODATA clustering algorithm is used to cluster the merged features of each pixel in the target image of the t+1th frame. The semantic label map of the target image of the t+1th frame is generated according to the clustering results, including: S61: Set the expected number of classes N l , the number of initial cluster centers N c , and the number of iterations N s ; Select the initial cluster center; S62: Allocate each pixel in the target image of the t+1th frame to each class according to the nearest neighbor rule; S63: judging whether merging is required according to the minimum number of pixels in any class; If the number of pixels in the current class is less than the minimum number of pixels in any class, the cluster center is cancelled and the number of cluster centers is updated to N. C -1; according to the updated number of cluster centers N C -1, assign each pixel in the target image of the t+1th frame to each class according to the nearest neighbor rule; calculate the cluster centers of each classified class, the average distance of each pixel in each class to the cluster center of the current class, and the overall average distance of each pixel to the cluster center of the current class; If the number of pixels in the current class is not less than the minimum number of pixels in any class, the cluster center is retained, and the cluster centers of each class after classification, the average distance from each pixel in each class to the cluster center of the current class, and the overall average distance from each pixel to the cluster center of the current class are calculated; S64: If the number of iterations Ip = N s , the clustering ends; If N c ≤N l / 2, then perform a split operation; if N c ≥2N l , then perform a merge operation; if N l / 2 <N c <2N l , when the number of iterations Ip is an odd number, a split operation is performed, and when the number of iterations Ip is an even number, a merge operation is performed; S65: If the number of iterations Ip = N s Or the process converges, the clustering ends; otherwise, the number of iterations is updated to Ip+1, and the iteration continues until the number of iterations Ip=N s Or the process converges and clustering ends; Generate the semantic label map of the target image in the t+1th frame based on the clustering results.
6. The target detection method based on image semantic label and point cloud data fusion according to claim 1, It is characterized in that Based on the neural prior scene flow model, the target point clouds of the t-th frame and the t+1-th frame are registered, the target point cloud of the t-th frame is moved to the target point cloud of the t+1-th frame, the densification of the target point cloud of the t+1-th frame is completed, and the dense point cloud of the t+1-th frame is generated. The expression is: PC’ t+1 =PC t+1 +SF t,t+1 SF t,t+1 =F(PC t ,PC t+1 ,Θ t,t+1 ) Among them, PC' t+1 is the dense point cloud of the t+1th frame; PC t+1 is the target point cloud of the t+1th frame; SF(·) represents the scene flow estimation model; Θ t,t+1 Represents the set of model parameters between the point cloud points corresponding to each corresponding position in the target point cloud of the tth frame and the target point cloud of the t+1th frame.
7. The target detection method based on image semantic label and point cloud data fusion according to claim 2, It is characterized in that The expression of the camera intrinsic parameter matrix K is: Among them, (f u ,f v ) represents the focal length of the camera; (c u ,c v ) represents the optical center distance of the camera; based on the camera intrinsic parameter matrix, the point cloud is transformed from the camera coordinate system to the image projection coordinate system.
8. The target detection method based on image semantic label and point cloud data fusion according to claim 2, Features ,The expression of the camera-radar external parameter matrix M is: Among them, r x 、r y 、r z Respectively represent the rotation error angles of the x, y, and z axes in the world coordinates; R(r x ,r y ,r z ) represents the rotation matrix; T represents the translation matrix; based on the camera-radar extrinsic matrix, the point cloud is transformed from the lidar coordinate system to the camera coordinate system.
9. An object detection device based on image semantic label and point cloud data fusion, It is characterized in that include: Memory for storing computer programs; A processor, used to implement the steps of a target detection method based on image semantic label and point cloud data fusion as described in any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a target detection method based on the fusion of image semantic labels and point cloud data as described in any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Intelligent park management system based on Internet of Things
CN120032373A
An Internet of Things-based intelligent park management system
CN120032373B
