Target detection method, device and electronic equipment
By generating hash maps and linked lists in intelligent driving, the problem of low target detection accuracy caused by the sparsity of point cloud data in intelligent driving is solved, efficient processing of target point cloud data is achieved, and detection accuracy is improved.
Patent Information
- Application Number
- CN202111514441.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-12-13
AI Technical Summary
In intelligent driving, the accuracy of target detection based on point cloud data is low, mainly because point cloud data is sparse data and traditional processing methods are not effective.
By generating hash maps and linked lists, the calculation and generation of mapping matrices in sparse convolution are realized, improving the processing effect of target point cloud data.
It improves the accuracy of target detection, is suitable for processing sparse data, and improves the effect of target detection.
Smart Images

Figure CN114266992B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a target detection method, device and electronic device. Background Art
[0002] With the development of computing technology, the research on intelligent driving is becoming more and more extensive. In the process of intelligent driving, target detection is a very important link, and the accuracy of target detection will affect the safety of autonomous driving. In related technologies, laser radar is often used to obtain point cloud data in front of the vehicle, and target detection is performed based on the point cloud data. However, since point cloud data is sparse data, the effect of processing point cloud data using traditional processing methods is not good, resulting in low accuracy of target recognition. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a target detection method, device and electronic device, which can improve the accuracy of target recognition, and the technical solution is as follows.
[0004] On the one hand, an embodiment of the present application provides a target detection method, the method comprising:
[0005] Acquire a first feature matrix, a first spatial matrix, and an initial number of valid points of the target point cloud data, wherein the first feature matrix is used to record the initial features corresponding to each point in the target point cloud data, and the first spatial matrix is used to record the spatial position of each point in the target point cloud data;
[0006] Based on the first spatial matrix and the initial valid number of points, generating a point matrix corresponding to the target point cloud data, the point matrix being used to record coordinates of points that may be output in the target point cloud data;
[0007] Based on the point matrix, a hash map corresponding to the target point cloud data is generated, wherein the hash map includes a plurality of non-empty local linked lists, and the number of the non-empty local linked lists is the same as the number of final valid points;
[0008] Based on the hash map, generating a second spatial matrix corresponding to the target point cloud data, wherein the second spatial matrix is used to record the spatial position of each output point;
[0009] Based on the first feature matrix, the number of the final valid points, and the second space matrix, it is determined whether the target point cloud data includes a target object.
[0010] In a possible implementation, generating a point matrix corresponding to the target point cloud data based on the first spatial matrix and the initial valid point number includes:
[0011] Based on the first spatial matrix and the initial number of valid points, determining the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data;
[0012] Based on the center positions of the multiple groups of convolution kernels corresponding to each point in the target point cloud data, a point matrix corresponding to the target point cloud data is determined.
[0013] In a possible implementation, determining the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix and the initial valid point number includes:
[0014] When the number of processing points does not exceed the initial valid number of points, the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data is determined based on the first spatial matrix, the size of the sparse convolution kernel and the internal offset of the sparse convolution kernel.
[0015] In a possible implementation, generating a hash map corresponding to the target point cloud data based on the point matrix includes:
[0016] Performing hash mapping on the coordinates of each point in the point matrix to obtain a hash value corresponding to each point in the point matrix, wherein the hash value is an index of the corresponding hash matrix, the length of the hash matrix is greater than the number of points in the point matrix, and the length of the hash matrix is positively correlated with the number of points in the point matrix;
[0017] The hash values corresponding to the points in the point matrix are combined to obtain a hash map corresponding to the target point cloud data.
[0018] In a possible implementation, combining the hash values corresponding to the points in the point matrix to obtain a hash map corresponding to the target point cloud data includes:
[0019] For the hash value corresponding to the i-th point in the point matrix, if the hash value corresponding to the i-th point does not exist in the hash map, the hash value corresponding to the i-th point is put into the hash map as the starting point of the current non-empty local linked list in the hash map, and i is a positive integer.
[0020] In a possible implementation, the method further includes:
[0021] In a case where a hash value corresponding to the i-th point exists in the hash map, determine whether the coordinates of the i-th point are the same as the coordinates of the point corresponding to the same hash value in the hash map; in a case where the coordinates of the i-th point are the same as the coordinates of the point corresponding to the same hash value in the hash map, store the coordinates of the i-th point at the end of the current non-empty local linked list.
[0022] In a possible implementation, generating a second spatial matrix corresponding to the target point cloud data based on the hash map includes:
[0023] Each node of the plurality of non-empty local linked lists in the hash map is traversed, and points corresponding to different coordinates are sequentially filled into the initial space matrix to obtain the second space matrix, where the initial space matrix is a blank matrix.
[0024] In a possible implementation, determining whether the target point cloud data includes a target object based on the first feature matrix, the final number of valid points, and the second space matrix includes:
[0025] generating a mapping matrix based on the position of each point in the second spatial matrix in the second spatial matrix;
[0026] Based on the mapping matrix, the first feature matrix, and the final number of valid points, it is determined whether the target point cloud data includes the target object.
[0027] In a possible implementation, the determining whether the target point cloud data includes the target object based on the mapping matrix, the first feature matrix, and the final number of valid points includes:
[0028] Based on the mapping matrix, determining the index corresponding to each point in the first feature matrix;
[0029] When the index of the first point in the first feature matrix meets the target condition, convolution processing is performed on the initial features of the first point in the first feature matrix to obtain the target features of the first point; based on the index of the first point, the target features of the first point are added to the second feature matrix, and the dimension of the second feature matrix is the same as the number of the final valid points;
[0030] When the index of the second point in the first feature matrix meets the target condition, determining the initial feature of the second point in the first feature matrix as the target feature of the second point; and adding the target feature of the second point to the second feature matrix based on the index of the second point;
[0031] Based on the second feature matrix, it is determined whether the target point cloud data contains the target object.
[0032] In a possible implementation manner, determining whether the target point cloud data includes the target object based on the second feature matrix includes:
[0033] Performing convolution, full connection and activation processing on the second feature matrix to obtain eigenvalues corresponding to the second feature matrix, wherein the eigenvalues are used to indicate the probability that the target point cloud data contains the target object;
[0034] When the eigenvalue is greater than or equal to the eigenvalue threshold, it is determined that the target point cloud data contains the target object.
[0035] In one aspect, a target detection device is provided, comprising:
[0036] An acquisition module, used to acquire a first feature matrix, a first space matrix and an initial valid number of points of the target point cloud data, wherein the first feature matrix is used to record the initial features corresponding to each point in the target point cloud data, and the first space matrix is used to record the spatial position of each point in the target point cloud data;
[0037] A point matrix generation module, used to generate a point matrix corresponding to the target point cloud data based on the first spatial matrix and the initial valid points, wherein the point matrix is used to record the coordinates of points that may be output in the target point cloud data;
[0038] A hash map generation module, used to generate a hash map corresponding to the target point cloud data based on the point matrix, wherein the hash map includes a plurality of non-empty local linked lists, and the number of the non-empty local linked lists is the same as the number of final valid points;
[0039] A second spatial matrix generating module, used to generate a second spatial matrix corresponding to the target point cloud data based on the hash map, wherein the second spatial matrix is used to record the spatial position of each output point;
[0040] A determination module is used to determine whether the target point cloud data includes a target object based on the first feature matrix, the number of the final valid points and the second space matrix.
[0041] In one possible implementation, the point matrix generation module is used to determine the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix and the initial valid number of points; and determine the point matrix corresponding to the target point cloud data based on the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data.
[0042] In one possible implementation, the point matrix generation module is used to determine the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix, the size of the sparse convolution kernel, the sliding step size of the sparse convolution kernel, and the internal offset of the sparse convolution kernel, when the number of processing points does not exceed the initial valid number of points.
[0043] In a possible implementation, the hash map generation module is used to perform hash mapping on the coordinates of each point in the point matrix to obtain a hash value corresponding to each point in the point matrix, the hash value is the index of the corresponding hash matrix, the length of the hash matrix is greater than the number of points in the point matrix, and the length of the hash matrix is positively correlated with the number of points in the point matrix; the hash values corresponding to each point in the point matrix are combined to obtain a hash map corresponding to the target point cloud data.
[0044] In one possible implementation, the hash map generation module is used to, for the hash value corresponding to the i-th point in the point matrix, if there is no local linked list at the hash value corresponding to the i-th point in the hash map, place the i-th point into the hash map according to the hash value as the starting point of the non-empty local linked list corresponding to the current hash value in the hash map, where i is a positive integer.
[0045] In a possible implementation, the device further includes:
[0046] a coordinate determination module, configured to determine whether the coordinates of the i-th point are the same as the coordinates of the point corresponding to the non-empty local linked list when there is a non-empty local linked list at the hash value corresponding to the i-th point in the hash map;
[0047] A storage module, used for storing the coordinates of the i-th point into the end of the current non-empty local linked list when the coordinates of the i-th point are the same as the coordinates of the point corresponding to the non-empty linked list;
[0048] The storage module is also used to, when the coordinates of the i-th point are different from the coordinates of the point corresponding to the non-empty linked list, search backward sequentially until the first hash value that does not exist in the local linked list is found; put the i-th point into the hash map according to the hash value as the starting point of the non-empty local linked list corresponding to the current hash value in the hash map.
[0049] In a possible implementation, the second spatial matrix generation module is used to traverse each node of the multiple non-empty local linked lists in the hash map, and fill the points corresponding to different coordinates into the initial spatial matrix in turn to obtain the second spatial matrix, where the initial spatial matrix is a blank matrix.
[0050] In a possible implementation, the determination module is used to generate a mapping matrix based on the positions of each point in the second spatial matrix in the second spatial matrix; and determine whether the target object is included in the target point cloud data based on the mapping matrix, the first feature matrix, and the final number of valid points.
[0051] In a possible implementation, the determination module is used to determine the index corresponding to each point in the first feature matrix based on the mapping matrix; when the index of the first point in the first feature matrix meets the target condition, convolution processing is performed on the initial feature of the first point in the first feature matrix to obtain the target feature of the first point; based on the index of the first point, the target feature of the first point is added to the second feature matrix, and the dimension of the second feature matrix is the same as the number of the final valid points; when the index of the second point in the first feature matrix meets the target condition, the initial feature of the second point in the first feature matrix is determined as the target feature of the second point; based on the index of the second point, the target feature of the second point is added to the second feature matrix; based on the second feature matrix, it is determined whether the target point cloud data contains the target object.
[0052] In a possible implementation, the determination module is used to perform convolution, full connection and activation processing on the second feature matrix to obtain an eigenvalue corresponding to the second feature matrix, and the eigenvalue is used to indicate the probability that the target object is included in the target point cloud data; when the eigenvalue is greater than or equal to the eigenvalue threshold, it is determined that the target point cloud data contains the target object.
[0053] In one aspect, an electronic device is provided, the electronic device comprising:
[0054] At least one processor and a memory in communication with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the aforementioned target detection method.
[0055] In one aspect, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions for causing the computer to execute the aforementioned target detection method.
[0056] On the one hand, an embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions, which, when executed by a computer, enable the computer to execute the aforementioned target detection method.
[0057] Through the technical solution provided in the embodiment of the present application, the calculation and generation of the mapping matrix in the sparse convolution is realized based on the hash map and the linked list, and the processing effect on sparse data such as target point cloud data is better. Through this processing method, the accuracy of target detection is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0059] Figure 1 A schematic diagram of an implementation environment of a target detection method according to an embodiment of the present application;
[0060] Figure 2 A flow chart of a target detection method according to an embodiment of the present application;
[0061] Figure 3 A flow chart of a target detection method according to an embodiment of the present application;
[0062] Figure 4 A schematic diagram of a convolution kernel center according to an embodiment of the present application;
[0063] Figure 5 A schematic diagram of a hash linked list according to an embodiment of the present application;
[0064] Figure 6 A schematic diagram of a processing flow based on a mapping matrix according to an embodiment of the present application;
[0065] Figure 7 A schematic diagram of the structure of a target detection device according to an embodiment of the present application;
[0066] Figure 8 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0067] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0068] The following describes the implementation methods of the present application through specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.
[0069] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structures and / or functions described herein are merely illustrative. Based on this application, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement an apparatus and / or practice a method.
[0070] It should also be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner. The drawings only show the components related to the present application rather than being drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0071] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0072] The following is an explanation of the nouns involved in the embodiments of the present application:
[0073] The convolution operation is a basic operator used for feature extraction in the field of deep learning, and plays a vital role in data feature extraction and feature expression of deep learning models.
[0074] Sparse convolution is a variant of convolution operation. Its purpose is to use the sparsity of data to improve the speed of convolution operation without changing the output result.
[0075] Figure 1 is a schematic diagram of the implementation environment of the target detection method provided in the embodiment of the present application, see Figure 1 The implementation environment includes a terminal 110 and a server 140.
[0076] The terminal 110 is connected to the server 140 via a wireless network or a wired network. Optionally, the terminal 110 is a vehicle-mounted terminal, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart watch, etc., but is not limited thereto. The terminal 110 is installed and runs an application that supports target detection.
[0077] Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0078] Optionally, terminal 110 generally refers to one of multiple terminals, and the embodiment of the present application only takes terminal 110 as an example.
[0079] Those skilled in the art will appreciate that the number of the above terminals may be more or less. For example, there may be only one terminal, or there may be dozens or hundreds of terminals, or a greater number, and the above implementation environment may also include other terminals. The embodiment of the present application does not limit the number and device type of the terminals.
[0080] After introducing the implementation environment of the embodiments of the present application, the application scenarios of the embodiments of the present application are described below. It should be noted that in the following description, the terminal is the terminal 110 in the above implementation environment, and the server is the server 140 in the above implementation environment.
[0081] The target detection method provided by the embodiment of the present application can be applied to the scene of identifying the target in front during the driving process of the vehicle. The vehicle can obtain the target point cloud data through the laser radar during the driving process, and the target point cloud data corresponds to the point cloud data of the target object in front of the vehicle. The terminal on the vehicle can obtain the target point cloud data, process the target point cloud data, and obtain the first feature matrix, the first spatial matrix and the initial valid point number of the target point cloud data, wherein the first matrix of the target point cloud data records the initial features corresponding to each point in the target point cloud data, and the initial features are also the high-dimensional representation of the corresponding points in the target point cloud data. The first spatial matrix is used to record the spatial position of each point in the target point cloud data, and the first spatial matrix can also reflect the positional relationship between different points in the target point cloud data. The initial valid point number is also the number of valid points in the target point cloud data. Based on the first spatial matrix and the initial valid point number, the terminal generates a point number matrix corresponding to the target point cloud data, and the point number matrix is used to record the coordinates of the points that may be output in the target point cloud data. Based on the point matrix, the terminal generates a hash map corresponding to the target point cloud data, and the hash map includes multiple non-empty local linked lists, and the number of the non-empty local linked lists is the same as the number of final valid points. Based on the hash map, the terminal generates a second spatial matrix corresponding to the target point cloud data, and the second spatial matrix is used to record the spatial position of each output point. Based on the first feature matrix, the number of final valid points and the second spatial matrix, the terminal determines whether the target point cloud data includes a target object, wherein the target object can be a pedestrian, a vehicle and an obstacle in front of the vehicle, etc., which is not limited in the embodiment of the present application.
[0082] It should be noted that the above description is based on an example of a terminal on a vehicle executing the technical solution provided in the embodiment of the present application. In other possible implementations, the technical solution provided in the embodiment of the present application may also be executed by a server, and the embodiment of the present application does not limit this.
[0083] After introducing the implementation environment and application scenarios of the embodiments of the present application, the target detection method provided by the embodiments of the present application is described in conjunction with the accompanying drawings. Figure 2 , an object detection method provided in an embodiment of the present application, taking the execution subject as a terminal as an example, the method includes:
[0084] 201. The terminal obtains a first feature matrix, a first spatial matrix and an initial number of valid points of target point cloud data, wherein the first feature matrix is used to record the initial features corresponding to each point in the target point cloud data, and the first spatial matrix is used to record the spatial position of each point in the target point cloud data.
[0085] Among them, the target point cloud data is the point cloud data collected by the laser radar during the driving process of the vehicle, and the target point cloud data can reflect the situation in front of the vehicle.
[0086] 202. The terminal generates a point matrix corresponding to the target point cloud data based on the first spatial matrix and the initial valid point number, where the point matrix is used to record coordinates of points that may be output in the target point cloud data.
[0087] 203. The terminal generates a hash map corresponding to the target point cloud data based on the point matrix, where the hash map includes a plurality of non-empty local linked lists, and the number of the non-empty local linked lists is the same as the number of final valid points.
[0088] 204. The terminal generates a second spatial matrix corresponding to the target point cloud data based on the hash map, where the second spatial matrix is used to record the spatial position of each output point.
[0089] 205. The terminal determines whether the target point cloud data includes a target object based on the first feature matrix, the number of the final valid points, and the second space matrix.
[0090] Among them, the target object is a vehicle, a pedestrian or an obstacle, which is not limited in the embodiments of the present application.
[0091] Through the technical solution provided in the embodiment of the present application, the calculation and generation of the mapping matrix in the sparse convolution is realized based on the hash map and the linked list, and the processing effect on sparse data such as target point cloud data is better. Through this processing method, the accuracy of target detection is improved.
[0092] It should be noted that the above steps 201-205 are a brief description of the embodiment of the present application. The technical solution provided by the embodiment of the present application will be described in detail below with reference to some examples. Taking the electronic device as a terminal as an example, see Figure 3 , methods include:
[0093] 301. The terminal obtains target point cloud data.
[0094] The terminal is a vehicle-mounted terminal on the vehicle, and the vehicle-mounted terminal is connected to a laser radar on the vehicle. The target point cloud data is sparse data. In some embodiments, the target point cloud data is the point cloud data currently collected by the vehicle, and can also be referred to as the point cloud data of the current frame.
[0095] In a possible implementation, while the vehicle is traveling, the terminal acquires target point cloud data through a laser radar.
[0096] 302. The terminal obtains a first feature matrix, a first spatial matrix and an initial number of valid points of the target point cloud data, wherein the first feature matrix is used to record the initial features corresponding to each point in the target point cloud data, and the first spatial matrix is used to record the spatial position of each point in the target point cloud data.
[0097] In a possible implementation, the terminal performs feature extraction on the target point cloud data to obtain a first feature matrix of the target point cloud data. The terminal generates a first spatial matrix of the target point cloud data based on the coordinates of each point in the target point cloud data. The terminal obtains the initial number of valid points in the target point cloud data. In some embodiments, the initial number of valid points is set by a technician according to actual conditions, and the embodiments of the present application do not limit this.
[0098] For example, the terminal performs convolution processing on the target point cloud data based on sparse convolution to obtain the initial features corresponding to each point in the target point cloud data. The terminal splices the initial features corresponding to each point in the target point cloud data to obtain the first feature matrix of the target point cloud data. The terminal obtains the coordinates of each point in the target point cloud data, fills the coordinates of each point into the blank matrix, and obtains the first spatial matrix. The terminal obtains the initial valid number of points of the target point cloud data. In some embodiments, the terminal performs convolution processing on the target point cloud data based on sparse convolution to obtain the initial features corresponding to each point in the target point cloud data, that is, the terminal performs convolution processing on the target point cloud data through a sparse convolution kernel to obtain the initial features corresponding to each point in the punctuation point cloud data. Some parameters of the sparse convolution kernel are introduced below.
[0099] See Table 1, which provides two-dimensional data and the relevant parameters of the sparse convolution kernel with a batch size of 1.
[0100] Table 1
[0101] Parameter name Parameter Value meaning kernel_size (k1, k2) Convolution kernel size stride (s1, s2) Convolution kernel sliding step padding (p1, p2) Number of zero padding in feature map max_valid_out (M,) Maximum number of output points allowed out_shape (H, W) Output feature map size
[0102] Among the above parameters, kernel_size, stride, and padding have the same meaning as the related parameters in the ordinary convolution layer. k1 represents the length of the convolution kernel, and k2 represents the width of the convolution kernel. max_valid_out represents the maximum number of output points allowed by the current sparse convolution layer. When the number of points in a frame of point cloud data exceeds M during calculation, the excess part will be directly discarded to improve the calculation efficiency.
[0103] In some embodiments, the first characteristic matrix, the first spatial matrix and the initial number of valid points of the target point cloud data in the above implementation are three inputs for subsequent processing, see Table 2, and the three inputs are represented as follows.
[0104] Table 2
[0105]
[0106] Among them, sparse data is also the target point cloud data, N represents the maximum number of input points allowed by the current sparse convolution calculation, C1 represents the number of features of a sparse point, that is, the number of features of a point in the target point cloud data; each row in in_features represents the C1 feature values contained in a sparse point, and the two integer data in each row of in_coors represent the two-dimensional spatial coordinates of each sparse point, where each row of in_features and in_coors corresponds one to one, and together represent the same sparse point in space; in_valid has only one integer data, which represents the actual number of valid points of the current sparse data, and its value is less than or equal to N value; in the above type description, float32 indicates that each number in the data is 32-bit floating point data, and int32 indicates that each data bit in the data is 32-bit integer data.
[0107] In addition, the sparse convolution input data also includes the convolution kernel used for feature extraction. For relevant information about the convolution kernel, see Table 3:
[0108] Table 3
[0109] name size type meaning weights (k1, k2, C1, C2) float32 Convolution kernel weights
[0110] Among them, C2 is the number of output feature channels, weights is the weight matrix of the convolution kernel, and the terminal processes the target point cloud data through the convolution kernel to obtain the first feature matrix.
[0111] 303. The terminal generates a point matrix corresponding to the target point cloud data based on the first spatial matrix and the initial valid point number, where the point matrix is used to record the coordinates of points that may be output in the target point cloud data.
[0112] In a possible implementation, the terminal determines the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix and the initial valid number of points. The terminal determines the point number matrix corresponding to the target point cloud data based on the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data.
[0113] In order to explain the above implementation more clearly, the above implementation will be explained in two parts below.
[0114] In the first part, the terminal determines the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix and the initial number of valid points.
[0115] In one possible implementation, when the number of processing points does not exceed the initial valid number of points, the terminal determines the center positions of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix, the size of the sparse convolution kernel, the sliding step of the sparse convolution kernel, and the internal offset of the sparse convolution kernel.
[0116] For example, the terminal determines the center position of the convolution kernel by using the following formula (1).
[0117]
[0118] Among them, coor mid The center position of the convolution kernel, which is also the center coordinate, coor in Indicates the input position of the corresponding point, that is, the coordinates of the corresponding point in the first spatial matrix. i indicates the dimension index of the current point. In two-dimensional data, i is 0 or 1. j is the internal offset of the convolution kernel in the current dimension. In two-dimensional data, when the kernel size is [3, 3], j is 0, 1 or 2. p[i] indicates the number of paddings in the current dimension, k[i] indicates the size of the convolution kernel in the current dimension, and s[i] indicates the sliding step size in the current dimension. % indicates the remainder operation, that is, any calculated coor mid The sum of p[i] and p[i] must be an integer multiple of the sliding step of the current dimension, otherwise, the current calculation process is considered invalid, and the invalid convolution kernel center coordinates will no longer participate in various subsequent calculation processes. In some embodiments, when the number of calculated two-dimensional points exceeds in_valid (initial valid point number), all subsequent calculation processes are considered invalid.
[0119] The first part is explained below through a specific example.
[0120] For a sparse convolution kernel with kernel size [3, 3], stride [1, 1], and padding [0, 0], the spatial coordinate position of a two-dimensional sparse point is in When it is [10, 20], the possible positions of the convolution kernel center are calculated in sequence according to the above formula (1):
[0121] When j = 0, i = 0, coor in =10, p[i]=0, k[i]=3, s[i]=1, substituting into formula (1) we can get coor mid =9; when j = 0, i = 1, coor in =20, p[i]=0, k[i]=3, s[i]=1, substituting into the formula we get coor mid=19. Therefore, the coordinates of the center position of this group of convolution kernels are [9, 19]. The coordinates of each dimension are judged in turn to see whether they satisfy the above integer divisibility relationship. If they do, the center position of the convolution kernel is effectively calculated.
[0122] It should be noted that the above is an example of determining the center position of the convolution kernel corresponding to a point in the target point cloud data. In the actual processing process, the terminal performs cyclic iterative calculations based on the above concept to generate several sets of coordinate information. When the convolution kernel size is [3, 3], 9 sets of convolution kernel center position coordinates can be obtained, such as Figure 4 As shown, nine groups of convolution kernel centers surround the coor in At the same time, according to the integer divisibility relationship, the nine sets of center coordinates in the current state are all valid calculations.
[0123] In the second part, the terminal determines the point matrix corresponding to the target point cloud data based on the center positions of multiple groups of convolution kernels corresponding to each point in the target point cloud data.
[0124] In a possible implementation, the terminal divides the center positions of the multiple groups of convolution kernels corresponding to each point in the target point cloud data by the sliding step size of the sparse convolution kernel to obtain the output coordinates of each point. The terminal combines the output coordinates of each point in the target point cloud data to obtain a point matrix corresponding to the target point cloud data.
[0125] For example, the terminal determines the output coordinates of each point in the target point cloud data by using the following formula (2).
[0126] coor out [i, j] = coor mid [i,j] / s[i] (2)
[0127] Among them, coor out Represents the output coordinates, i represents the dimension index of the current point, j represents the internal offset of the convolution kernel under the current dimension, and s[i] represents the sliding step size of the current dimension.
[0128] for Figure 4 For the nine sets of convolution kernel centers shown, nine sets of valid output coordinates can be obtained.
[0129] 304. The terminal generates a hash map corresponding to the target point cloud data based on the point matrix, where the hash map includes a plurality of non-empty local linked lists, and the number of the non-empty local linked lists is the same as the number of final valid points.
[0130] In a possible implementation, the terminal performs hash mapping on the coordinates of each point in the point matrix to obtain a hash value corresponding to each point in the point matrix, the hash value is the index of the corresponding hash matrix, the length of the hash matrix is greater than the number of points in the point matrix, and the length of the hash matrix is positively correlated with the number of points in the point matrix. The terminal combines the hash values corresponding to each point in the point matrix to obtain a hash map corresponding to the target point cloud data.
[0131] In order to explain the above implementation more clearly, the above implementation will be explained in two parts below.
[0132] In the first part, the terminal performs hash mapping on the coordinates of each point in the point matrix to obtain the hash value corresponding to each point in the point matrix.
[0133] In a possible implementation, the terminal obtains the maximum number of output points corresponding to the target point cloud data. The terminal determines the maximum index value of the hash matrix based on the maximum number of output points, and the maximum index value is greater than the maximum number of output points. The terminal obtains the hash value corresponding to each point in the point matrix based on the maximum index value and the coordinates of each point in the point matrix.
[0134] For example, the terminal can determine the maximum output point number corresponding to the target point cloud data through the following formula (3), and obtain the hash value corresponding to each point in the point matrix through the following formula (4).
[0135] max_out_coors=N*k_vol (3)
[0136] in, max_out_coors is the maximum number of output points, dim represents the dimension of the target point cloud data, in two-dimensional data, dim = 2; k_vol represents the accumulation of each dimension of the convolution kernel, and N is the number of points of the target point cloud data.
[0137] hash_idx[i]=hash_func(coors out [i])%K,i∈[0,max_out_coors) (4)
[0138] Among them, hash_func(*) represents the calculation method of mapping multi-dimensional space coordinates to one-dimensional indexes, % represents the remainder calculation, which can ensure that the calculated output hash_idx is always less than the K value; hash_idx represents the index of the hash matrix obtained after the hash mapping calculation of each output coordinate in the point matrix, that is, the hash value.
[0139] In some embodiments, in a two-dimensional sparse convolution, hash_func can be implemented according to the following formula (5):
[0140] hash_idx[i]=coors[0]*W+coors[1] (5)
[0141] Among them, W is the width of the output feature map, coors[1] is the column number of the current point, and coors[0] is the row number of the current point.
[0142] In the second part, the terminal combines the hash values corresponding to each point in the point matrix to obtain a hash map corresponding to the target point cloud data.
[0143] In one possible implementation, for the hash value corresponding to the i-th point in the point matrix, if there is no local linked list at the hash value corresponding to the i-th point in the hash map, the i-th point is placed in the hash map according to the hash value as the starting point of the non-empty local linked list corresponding to the current hash value in the hash map, and i is a positive integer.
[0144] In a possible implementation, when there is a non-empty local linked list at the hash value corresponding to the i-th point in the hash map, determine whether the coordinates of the i-th point are the same as the coordinates of the point corresponding to the non-empty linked list. When the coordinates of the i-th point are the same as the coordinates of the point corresponding to the non-empty linked list, store the coordinates of the i-th point at the end of the current non-empty local linked list. When the coordinates of the i-th point are different from the coordinates of the point corresponding to the non-empty linked list, search backwards in sequence until the first hash value that does not exist in the local linked list is found, and then put the i-th point into the hash map according to the hash value as the starting point of the non-empty local linked list corresponding to the current hash value in the hash map.
[0145] It should be noted that the above is an example of a terminal processing process. In the actual processing process, the terminal loops in sequence until the hash mapping of all coordinates is completed. In some embodiments, the following may be generated: Figure 5 The hash list distribution shown in the figure, where the coordinates corresponding to each key value in the hash map are not repeated. Figure 5 , a hash map with a length of K (maximum index value) can calculate and generate m non-empty local linked lists, where m<=K. Each non-empty local linked list represents all possible input relationships contained in an output coordinate of the sparse convolution calculation, so the number of final output points of the sparse convolution is m. When m is greater than the parameter M, M local linked lists are randomly retained, the excess parts are marked as invalid linked lists, and m is rewritten to M; finally, m is written to out_valid to mark the actual number of valid output points.
[0146] Table 4 records the corresponding representation of the output data.
[0147] Table 4
[0148]
[0149] Among them, M represents the maximum number of output points allowed. When the number of points of a frame of data exceeds M in actual calculation, the excess will be directly discarded; C2 represents the number of channels of the output feature. Similarly, each row of data in out_features and out_coors also maintains a one-to-one correspondence. out_valid only contains an integer data, which represents the number of valid points output in actual calculation. This value should be less than or equal to M.
[0150] 305. The terminal generates a second spatial matrix corresponding to the target point cloud data based on the hash map, where the second spatial matrix is used to record the spatial position of each output point.
[0151] In a possible implementation, the terminal traverses each node of multiple non-empty local linked lists in the hash map, and fills points corresponding to different coordinates into the initial space matrix in turn to obtain the second space matrix, where the initial space matrix is a blank matrix.
[0152] For example, the terminal creates an output coordinate matrix out_coors, which is also a second spatial matrix, with a size of (M, 2) based on M. The terminal loops through each node of each valid non-empty local linked list and writes each different output coordinate into out_coors in turn as the sparse coordinate output result of the sparse convolution.
[0153] 306. The terminal determines whether the target point cloud data includes a target object based on the first feature matrix, the final number of valid points, and the second space matrix.
[0154] In a possible implementation, the terminal generates a mapping matrix based on the positions of each point in the second space matrix in the second space matrix. The terminal determines whether the target point cloud data includes the target object based on the mapping matrix, the first feature matrix, and the number of the final valid points.
[0155] In order to explain the above implementation more clearly, the above implementation will be explained in two parts below.
[0156] In the first part, the terminal generates a mapping matrix based on the positions of each point in the second space matrix.
[0157] For example, the terminal creates a mapping matrix IndexPairs with a length of max_out_coors and a value of -1 to record the output position to which the current coordinate is mapped. The terminal updates the position of the current output sparse coordinate in out_coors and writes it to IndexPairs as the basis for coordinate mapping in subsequent steps. The updated write position of IndexPairs is the global_offset value recorded by the node. For the processing process of the first part of the above steps 305 and 306, see Figure 6 .
[0158] In the second part, the terminal determines whether the target point cloud data includes the target object based on the mapping matrix, the first feature matrix, and the number of the final valid points.
[0159] In a possible implementation, the terminal determines the index corresponding to each point in the first feature matrix based on the mapping matrix. When the index of the first point in the first feature matrix meets the target condition, the terminal performs convolution processing on the initial feature of the first point in the first feature matrix to obtain the target feature of the first point. Based on the index of the first point, the terminal adds the target feature of the first point to the second feature matrix, and the dimension of the second feature matrix is the same as the number of the final valid points. When the index of the second point in the first feature matrix meets the target condition, the terminal determines the initial feature of the second point in the first feature matrix as the target feature of the second point. Based on the index of the second point, the target feature of the second point is added to the second feature matrix. Based on the second feature matrix, the terminal determines whether the target object is included in the target point cloud data.
[0160] The following describes a method for the terminal to determine whether the target point cloud data includes the target object based on the second feature matrix.
[0161] In a possible implementation, the terminal performs convolution, full connection and activation processing on the second feature matrix to obtain an eigenvalue corresponding to the second feature matrix, and the eigenvalue is used to indicate the probability that the target object is included in the target point cloud data. When the eigenvalue is greater than or equal to the eigenvalue threshold, the terminal determines that the target point cloud data contains the target object.
[0162] For example, the terminal creates an output feature matrix out_features with a size of (M, C2) and an initial value of 0 based on the M value calculated in the previous step, and then completes the feature calculation of the sparse input point in the following steps:
[0163] 1. For the i-th input point, take out the current point feature in_features[i];
[0164] 2. For the j-th convolution kernel weight vector, take out the current convolution kernel weights[j];
[0165] 3. Obtain the output index out_idx corresponding to the current input according to the following formula (6):
[0166] out_idx[i, j]=IndexPairs[i*k_vol+j] (6)
[0167] 4. If out_idx is -1, it indicates that there is no valid mapping relationship here. Otherwise, convolution calculation is performed based on the feature values taken out in steps 1 and 2 and the convolution kernel weights, and then the calculation results are accumulated to out_features[i] according to the position identified by out_idx;
[0168] 5. Iterate all sparse input points and all convolution kernel weights in sequence to complete the feature calculation process of the entire sparse data.
[0169] Through the technical solution provided in the embodiment of the present application, the calculation and generation of the mapping matrix in the sparse convolution is realized based on the hash map and the linked list, and the processing effect on sparse data such as target point cloud data is better. Through this processing method, the accuracy of target detection is improved.
[0170] The technical solution provided in the embodiment of the present application realizes the calculation and generation of the mapping matrix in sparse convolution based on hash map and linked list, and uses -1 to identify invalid sparse mapping relationship. At the same time, the process can synchronously complete the generation and calculation of output sparse coordinates; then, the input sparse features, convolution kernel weights and mapping matrix are used to iterate the calculation process of sparse features according to the constraint conditions. The solution is relatively simple in process and highly controllable, and can achieve optimization and balance between speed and space.
[0171] The technical solution provided in the embodiment of the present application adopts a hash map with a space complexity of , which can avoid the phenomenon of explosive growth of space occupancy caused by the increase in the number of input sparse data points; according to the mapping rules, a number of smaller hash lists of output coordinates are created, and the idea of divide and conquer is used to complete the statistics of the output coordinates and the generation of the mapping matrix, which reduces the data space for comparison between coordinates and improves the calculation speed.
[0172] Corresponding to the above method embodiment, see Figure 7 The embodiment of the present application also provides a target detection device 700, including: an acquisition module 701, a point matrix generation module 702, a hash map generation module 703, a second space matrix generation module 704 and a determination module 705.
[0173] The acquisition module 701 is used to obtain the first feature matrix, the first spatial matrix and the initial valid number of points of the target point cloud data, wherein the first feature matrix is used to record the initial features corresponding to each point in the target point cloud data, and the first spatial matrix is used to record the spatial position of each point in the target point cloud data.
[0174] The point matrix generating module 702 is used to generate a point matrix corresponding to the target point cloud data based on the first spatial matrix and the initial valid points, and the point matrix is used to record the coordinates of points that may be output in the target point cloud data.
[0175] The hash map generation module 703 is used to generate a hash map corresponding to the target point cloud data based on the point matrix, and the hash map includes multiple non-empty local linked lists, and the number of the non-empty local linked lists is the same as the number of final valid points.
[0176] The second spatial matrix generating module 704 is used to generate a second spatial matrix corresponding to the target point cloud data based on the hash map, and the second spatial matrix is used to record the spatial position of each output point.
[0177] The determination module 705 is used to determine whether the target point cloud data includes a target object based on the first feature matrix, the number of the final valid points and the second space matrix.
[0178] In a possible implementation, the point matrix generation module 702 is used to determine the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix and the initial valid number of points. Based on the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data, determine the point matrix corresponding to the target point cloud data.
[0179] In one possible implementation, the point matrix generation module 702 is used to determine the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix, the size of the sparse convolution kernel, the sliding step size of the sparse convolution kernel, and the internal offset of the sparse convolution kernel, when the number of processing points does not exceed the initial valid number of points.
[0180] In a possible implementation, the hash map generation module 703 is used to perform hash mapping on the coordinates of each point in the point matrix to obtain a hash value corresponding to each point in the point matrix, the hash value is the index of the corresponding hash matrix, the length of the hash matrix is greater than the number of points in the point matrix, and the length of the hash matrix is positively correlated with the number of points in the point matrix. The hash values corresponding to each point in the point matrix are combined to obtain a hash map corresponding to the target point cloud data.
[0181] In one possible implementation, the hash map generation module 703 is used to place the i-th point in the point matrix into the hash map according to the hash value, as the starting point of the non-empty local linked list corresponding to the current hash value in the hash map, when there is no local linked list at the hash value corresponding to the i-th point in the hash map, where i is a positive integer.
[0182] In a possible implementation, the device further includes:
[0183] The coordinate determination module is used to determine whether the coordinates of the i-th point are the same as the coordinates of the point corresponding to the non-empty local linked list when there is a non-empty local linked list at the hash value corresponding to the i-th point in the hash map.
[0184] The storage module is used to store the coordinates of the i-th point into the end of the current non-empty local linked list when the coordinates of the i-th point are the same as the coordinates of the point corresponding to the non-empty linked list.
[0185] The storage module is also used to sequentially search backwards when the coordinates of the i-th point are different from the coordinates of the point corresponding to the non-empty linked list until the first hash value that does not exist in the local linked list is found. The i-th point is placed in the hash map according to the hash value as the starting point of the non-empty local linked list corresponding to the current hash value in the hash map.
[0186] In a possible implementation, the second spatial matrix generation module 704 is used to traverse each node of multiple non-empty local linked lists in the hash map, and fill the points corresponding to different coordinates into the initial spatial matrix in turn to obtain the second spatial matrix, which is a blank matrix.
[0187] In a possible implementation, the determination module 705 is used to generate a mapping matrix based on the positions of each point in the second space matrix in the second space matrix, and determine whether the target point cloud data includes the target object based on the mapping matrix, the first feature matrix, and the number of the final valid points.
[0188] In a possible implementation, the determination module 705 is used to determine the index corresponding to each point in the first feature matrix based on the mapping matrix. When the index of the first point in the first feature matrix meets the target condition, the feature initial feature of the first point in the first feature matrix is convolved to obtain the target feature of the first point. Based on the index of the first point, the target feature of the first point is added to the second feature matrix, and the dimension of the second feature matrix is the same as the number of the final valid points. When the index of the second point in the first feature matrix meets the target condition, the feature initial feature of the second point in the first feature matrix is determined as the target feature of the second point. Based on the index of the second point, the target feature of the second point is added to the second feature matrix. Based on the second feature matrix, it is determined whether the target object is included in the target point cloud data.
[0189] In a possible implementation, the determination module 705 is used to perform convolution, full connection and activation processing on the second feature matrix to obtain an eigenvalue corresponding to the second feature matrix, and the eigenvalue is used to indicate the probability that the target object is included in the target point cloud data. When the eigenvalue is greater than or equal to the eigenvalue threshold, it is determined that the target point cloud data contains the target object.
[0190] See also Figure 8 The embodiment of the present application further provides an electronic device 800, the electronic device comprising:
[0191] at least one processor. and,
[0192] A memory in communication with the at least one processor.
[0193] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the target detection method in the aforementioned method embodiment.
[0194] An embodiment of the present application also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the target detection method in the aforementioned method embodiment.
[0195] An embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, enable the computer to execute the target detection method in the aforementioned method embodiment.
[0196] Reference below Figure 8, which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present application. The electronic device 800 in the embodiment of the present application may include but is not limited to mobile electronic devices such as laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), etc., and fixed electronic devices such as digital TVs, desktop computers, etc. Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of application of the embodiments of the present application.
[0197] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0198] Typically, the following devices can be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc. Output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc. Storage devices 808 including, for example, a magnetic tape, a hard disk, etc. And communication devices 809. The communication device 809 can allow the electronic device 800 to communicate with other devices wirelessly or wired to exchange data. Although the electronic device 800 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or provided alternatively.
[0199] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0200] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0201] The computer readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0202] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains at least two Internet Protocol addresses. Sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it. Receives the Internet Protocol address returned by the node evaluation device. The obtained Internet Protocol address indicates an edge node in a content distribution network.
[0203] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: receives a node evaluation request including at least two Internet Protocol addresses. Selects an Internet Protocol address from the at least two Internet Protocol addresses. Returns the selected Internet Protocol address. The received Internet Protocol address indicates an edge node in a content distribution network.
[0204] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0205] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0206] The units involved in the embodiments described in the present application may be implemented by software or hardware. The name of the unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0207] It should be understood that various parts of the present disclosure may be implemented in hardware, software, firmware or a combination thereof.
[0208] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A target detection method, characterized in that: The method is applied in a scenario where a vehicle recognizes a target in front of it during driving. The vehicle acquires target point cloud data through a laser radar during driving. The target point cloud data is point cloud data corresponding to a target object in front of the vehicle. The method comprises: Acquire a first feature matrix, a first spatial matrix, and an initial number of valid points of the target point cloud data, wherein the first feature matrix is used to record the initial features corresponding to each point in the target point cloud data, and the first spatial matrix is used to record the spatial position of each point in the target point cloud data; Based on the first spatial matrix and the initial valid number of points, generating a point matrix corresponding to the target point cloud data, the point matrix being used to record coordinates of points that may be output in the target point cloud data; Based on the point matrix, a hash map corresponding to the target point cloud data is generated, wherein the hash map includes a plurality of non-empty local linked lists, and the number of the non-empty local linked lists is the same as the number of final valid points; Based on the hash map, generating a second spatial matrix corresponding to the target point cloud data, wherein the second spatial matrix is used to record the spatial position of each output point; Determining whether the target point cloud data includes a target object based on the first feature matrix, the number of the final valid points, and the second space matrix; Wherein, determining whether the target point cloud data includes a target object based on the first feature matrix, the number of the final valid points, and the second space matrix comprises: generating a mapping matrix based on the position of each point in the second spatial matrix in the second spatial matrix; Determining whether the target point cloud data includes the target object based on the mapping matrix, the first feature matrix, and the number of the final valid points; The determining, based on the mapping matrix, the first feature matrix, and the number of the final valid points, whether the target point cloud data includes the target object comprises: Based on the mapping matrix, determining the index corresponding to each point in the first feature matrix; When the index of the first point in the first feature matrix meets the target condition, convolution processing is performed on the initial features of the first point in the first feature matrix to obtain the target features of the first point; based on the index of the first point, the target features of the first point are added to the second feature matrix, and the dimension of the second feature matrix is the same as the number of the final valid points; When the index of the second point in the first feature matrix meets the target condition, determining the initial feature of the second point in the first feature matrix as the target feature of the second point; and adding the target feature of the second point to the second feature matrix based on the index of the second point; Based on the second feature matrix, determining whether the target point cloud data contains the target object; The determining, based on the second feature matrix, whether the target point cloud data includes the target object comprises: Performing convolution, full connection and activation processing on the second feature matrix to obtain eigenvalues corresponding to the second feature matrix, wherein the eigenvalues are used to indicate the probability that the target point cloud data contains the target object; When the eigenvalue is greater than or equal to the eigenvalue threshold, it is determined that the target point cloud data contains the target object.
2. The method according to claim 1, characterized in that The step of generating a point matrix corresponding to the target point cloud data based on the first spatial matrix and the initial valid point number includes: Based on the first spatial matrix and the initial number of valid points, determining the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data; Based on the center positions of the multiple groups of convolution kernels corresponding to each point in the target point cloud data, a point matrix corresponding to the target point cloud data is determined.
3. The method according to claim 2, characterized in that The step of determining the center position of multiple groups of convolution kernels corresponding to each point in the target point cloud data based on the first spatial matrix and the initial valid point number includes: When the number of processing points does not exceed the initial valid number of points, the center positions of multiple groups of convolution kernels corresponding to each point in the target point cloud data are determined based on the first spatial matrix, the size of the sparse convolution kernel, the sliding step of the sparse convolution kernel, and the internal offset of the sparse convolution kernel.
4. The method according to claim 1, characterized in that The step of generating a hash map corresponding to the target point cloud data based on the point matrix includes: Performing hash mapping on the coordinates of each point in the point matrix to obtain a hash value corresponding to each point in the point matrix, wherein the hash value is an index of the corresponding hash matrix, the length of the hash matrix is greater than the number of points in the point matrix, and the length of the hash matrix is positively correlated with the number of points in the point matrix; The hash values corresponding to the points in the point matrix are combined to obtain a hash map corresponding to the target point cloud data.
5. The method according to claim 4, characterized in that The step of combining the hash values corresponding to the points in the point matrix to obtain a hash map corresponding to the target point cloud data includes: For the hash value corresponding to the i-th point in the point matrix, if there is no local linked list at the hash value corresponding to the i-th point in the hash map, the i-th point is placed in the hash map according to the hash value as the starting point of the non-empty local linked list corresponding to the current hash value in the hash map, and i is a positive integer.
6. The method according to claim 5, characterized in that The method further comprises: In the case where there is a non-empty local linked list at the hash value corresponding to the i-th point in the hash map, determining whether the coordinates of the i-th point are the same as the coordinates of the point corresponding to the non-empty local linked list; When the coordinates of the i-th point are the same as the coordinates of the point corresponding to the non-empty local linked list, storing the coordinates of the i-th point at the end of the current non-empty local linked list; When the coordinates of the i-th point are different from the coordinates of the point corresponding to the non-empty local linked list, search backward sequentially until the first hash value that does not exist in the local linked list is found; put the i-th point into the hash map according to the hash value as the starting point of the non-empty local linked list corresponding to the current hash value in the hash map.
7. The method according to claim 1, characterized in that The step of generating a second spatial matrix corresponding to the target point cloud data based on the hash map includes: Each node of the plurality of non-empty local linked lists in the hash map is traversed, and points corresponding to different coordinates are sequentially filled into the initial space matrix to obtain the second space matrix, where the initial space matrix is a blank matrix.
8. A target detection device, using the method according to any one of claims 1 to 7, characterized in that: The device comprises: An acquisition module, used to acquire a first feature matrix, a first space matrix and an initial valid number of points of the target point cloud data, wherein the first feature matrix is used to record the initial features corresponding to each point in the target point cloud data, and the first space matrix is used to record the spatial position of each point in the target point cloud data; A point matrix generation module, used to generate a point matrix corresponding to the target point cloud data based on the first spatial matrix and the initial valid points, wherein the point matrix is used to record the coordinates of points that may be output in the target point cloud data; A hash map generation module, used to generate a hash map corresponding to the target point cloud data based on the point matrix, wherein the hash map includes a plurality of non-empty local linked lists, and the number of the non-empty local linked lists is the same as the number of final valid points; A second spatial matrix generating module, used to generate a second spatial matrix corresponding to the target point cloud data based on the hash map, wherein the second spatial matrix is used to record the spatial position of each output point; A determination module is used to determine whether the target point cloud data includes a target object based on the first feature matrix, the number of the final valid points and the second space matrix.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the target detection method according to any one of claims 1 to 7. 10 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the target detection method according to any one of claims 1 to 7.
