Target detection method and device in granary, readable medium and electronic equipment
Through the three-dimensional point cloud data and mean drift clustering algorithm, the target detection accuracy problem of traditional technology in low light and complex environments is solved, and the precise positioning and recognition of objects in the granary is achieved, and the stability and accuracy of detection are improved. .
Patent Information
- Application Number
- CN202411803697.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-01-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional video surveillance and infrared detection technologies have poor results in low-light environments in target detection in granaries, cannot penetrate smoke and dust interference, and are difficult to provide precise positioning and identification.
Three-dimensional point cloud data acquisition and mean drift clustering algorithm are used to obtain the three-dimensional point cloud data of the granary scene, filter out the foreground point clouds, perform mean drift clustering, extract target point clouds and identify them, and obtain target categories.
It improves the accuracy of object detection in granary scenarios, can identify objects stably and reliably in complex environments, provide accurate spatial and shape information, adapt to a variety of environmental factors, and support rapid response and automated operations.
Smart Images

Figure CN119296042A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of target detection, and in particular to a target detection method, device, readable medium and electronic device in a granary. Background Art
[0002] In the environment of grain storage warehouses, traditional target detection technologies mainly rely on video surveillance, infrared detection and other methods. Although video surveillance can visually monitor the environment inside the grain warehouse, its effect is greatly reduced in low-light or completely dark environments, and video data processing is complex and requires a lot of computing resources. In addition, video surveillance is difficult to penetrate interference factors such as smoke and dust, resulting in inaccurate target identification in the grain warehouse. Although infrared detection can also work in dark environments, it mainly relies on temperature differences to identify targets, and is prone to false alarms for targets with relatively close temperatures (such as certain equipment and environments in warehouses). In addition, infrared detection cannot provide specific three-dimensional morphological information of the target, which limits its application in precise positioning and identification. Summary of the invention
[0003] The present application provides a method, device, readable medium and electronic device for detecting a target in a granary, which can improve the accuracy of target detection in a granary scenario.
[0004] In a first aspect, the present application provides a method for detecting a target in a granary, comprising: Obtain the 3D point cloud data of the granary scene; Screening the three-dimensional point cloud data to obtain a foreground point cloud in the three-dimensional point cloud data; Performing mean shift clustering on the foreground point clouds to obtain a clustering result; A target point cloud is extracted from the clustering result, and the target point cloud is identified to obtain a target category corresponding to the target point cloud.
[0005] According to this embodiment, by acquiring the three-dimensional point cloud data in the granary, accurate spatial and shape information can be provided for the objects in the granary, which is more accurate than traditional two-dimensional image recognition. In addition, the three-dimensional point cloud technology has better adaptability to various environmental factors (such as light changes, smoke, dust, etc.), and can perform stable and reliable detection in complex environments. Screening the three-dimensional point cloud data can eliminate the interference of background and irrelevant objects, further improving the accuracy of target recognition. The mean shift clustering algorithm can automatically determine the cluster center according to the distribution characteristics of the point cloud data without pre-setting, and is more suitable for multi-target recognition in complex scenes such as granaries. By identifying the targets in the granary, a quick response can be achieved, which is conducive to automated operations in the granary scene.
[0006] In an exemplary embodiment, the screening of the three-dimensional point cloud data to obtain a foreground point cloud in the three-dimensional point cloud data includes: Transforming the three-dimensional point cloud data into a unified three-dimensional coordinate system to obtain preprocessed data; The data of the preset detection area is screened out from the pre-processed data to obtain the foreground point cloud.
[0007] In an exemplary embodiment, performing mean shift clustering on the foreground point clouds to obtain a clustering result includes: Calculating a mean shift vector between a seed point in the foreground point cloud and a point within a preset range of the seed point, wherein the seed point is determined by mean shift clustering; Updating the seed point based on the mean shift vector; The updated seed point is used to calculate the mean shift vector of each point within the preset range again until the length of the mean shift vector is less than the first preset value, thereby obtaining the target seed point; The foreground point cloud is classified according to the distance between the target seed point and each point to obtain a clustering result, which includes a plurality of clusters.
[0008] In an exemplary embodiment, it further includes: The distance between each target seed point is calculated, and the clusters whose distance between the target seed points is less than a second preset value are merged.
[0009] In an exemplary embodiment, the step of calculating the mean shift vector between the seed point and each point within a preset range of the seed point includes: Calculate an offset vector using the x-coordinate and y-coordinate of each point within a preset range of the seed point and the seed point; Calculate the height weight by using the z coordinates of the seed point and each point within a preset range of the seed point; The mean shift vector between the seed point and each point is calculated based on the offset vector and the height weight.
[0010] In an exemplary embodiment, identifying the target point cloud to obtain the target category corresponding to the target point cloud includes: Extracting characteristic values of each cluster in the clustering result, and filtering out a target point cloud from the clustering result based on the characteristic values.
[0011] In an exemplary implementation, the step of extracting the characteristic value of each cluster in the clustering result includes: Obtaining shape features of each cluster in the clustering results, wherein the shape features include standard deviation and variance in the x-direction, y-direction, and z-direction; Obtaining the size feature of each cluster in the clustering result, wherein the size feature includes a projection length and a projection width; Acquire motion features of each cluster in the clustering result, wherein the motion features include a velocity vector; The characteristic values of each type of cluster are obtained based on the shape feature, size feature and motion feature.
[0012] In an exemplary embodiment, extracting a target point cloud from the clustering result based on the feature value includes: Perform weighted processing on the characteristic values to obtain a comprehensive score; The clusters whose comprehensive score is lower than the set threshold are screened out to obtain the target point cloud.
[0013] In an exemplary implementation, before extracting the characteristic value of each cluster in the clustering result, the method further includes: The number of point clouds of each cluster in the clustering result is calculated, and clusters whose number of point clouds is less than a third preset value are screened out.
[0014] In a second aspect, the present application provides a target detection device in a granary, comprising: Point cloud acquisition module, used to obtain three-dimensional point cloud data of the granary scene; A foreground extraction module, used for screening the three-dimensional point cloud data to obtain a foreground point cloud in the three-dimensional point cloud data; A clustering module, used for performing mean shift clustering on the foreground point clouds to obtain a clustering result; The recognition module is used to extract the target point cloud from the clustering result, recognize the target point cloud, and obtain the target category corresponding to the target point cloud.
[0015] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and one or more processors. The memory stores one or more computer programs, the computer programs comprising instructions, and when the instructions are executed by the processor, the electronic device can execute the target detection method in the granary as in the first aspect.
[0016] In a fourth aspect, the present application provides a computer-readable medium having instructions stored therein, and when the instructions are executed on an electronic device, the electronic device executes the target detection method in a granary as in the first aspect.
[0017] In a fifth aspect, the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the target detection method in a granary as described in the first aspect.
[0018] It can be understood that the beneficial effects that can be achieved by the target detection device, electronic device, computer-readable medium, and computer program product in the granary provided above can be referred to the beneficial effects in the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A schematic diagram of a flow chart of a target detection method in a granary provided in an embodiment of the present application; Figure 2 A schematic diagram of coordinate transformation in a target detection method in a granary provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of a target detection device in a granary provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference. It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.
[0021] It should be noted that the “at…” in the embodiments of the present application may be the instant when a certain situation occurs, or may be a period of time after the occurrence of a certain situation, and the embodiments of the present application do not specifically limit this.
[0022] The implementation of this embodiment will be described in detail below with reference to the accompanying drawings.
[0023] The present embodiment provides a method for detecting a target in a granary. By way of example, the method for detecting a target in a granary can be applied to various electronic devices such as computers (PCs), tablet computers, virtual reality / augmented reality devices, wearable devices, industrial computers, and vehicle computers; it can also be applied to electronic devices such as servers, cloud computing, and server clusters; it can also be used for devices such as robots in granaries, and the present embodiment does not make any special limitations on this.
[0024] It should be noted that the target detection method in the granary of this embodiment can be applied to target detection in a granary scene. The categories of targets in the granary scene can include equipment, personnel, objects, robots, etc.
[0025] Figure 1 A schematic flow chart of a target detection method in a granary provided in an embodiment of the present application is shown.
[0026] like Figure 1 As shown, the target detection method in the granary may include the following steps: Step 101: Obtain three-dimensional point cloud data of the granary scene.
[0027] For example, the three-dimensional point cloud data can be real-time updated data, and the lidar can collect three-dimensional information inside the granary in real time. Combined with advanced target detection algorithms, it can quickly respond to and identify moving targets or stationary objects in the environment, thereby improving the degree of automation of operations.
[0028] When the radar illuminates the target, a depth image, i.e., 3D point cloud data, can be obtained. In the 3D point cloud data, each point contains the distance from the point to the radar, and grayscale values are assigned according to the distance value of each point. Further, through the conversion relationship, the 3D point cloud data of the target's outer contour can be obtained.
[0029] Step 102: Filter the three-dimensional point cloud data to obtain a foreground point cloud in the three-dimensional point cloud data.
[0030] Specifically, the three-dimensional point cloud data is first transformed into a unified three-dimensional coordinate system to obtain preprocessed data; and then data with a Z axis greater than a first preset value is filtered out from the preprocessed data to obtain a foreground point cloud.
[0031] Transforming the 3D point cloud data into a unified 3D coordinate system means uniformly transforming the data to the positive direction of the z-axis, and the obtained data is the preprocessed data. Figure 2 As shown, Figure 2 (a) in the figure is the 3D point cloud data obtained by the laser radar. Figure 2(b) in the figure is the three-dimensional coordinate system obtained after the transformation. By rotating and moving the three-dimensional point cloud data, the data can be located in the positive direction of the z-axis. The three-dimensional point cloud data obtained by the lidar is a coordinate system based on the sensor as the origin. It is not convenient to intuitively process the point cloud data in this coordinate system, and the point cloud data has rotation and translation invariance, so selection and translation will be performed.
[0032] After the preprocessed data is obtained, the data located in the preset detection area is screened out as the foreground point cloud. The preset detection area can be represented by a preset coordinate range, such as an x-coordinate range, a y-coordinate range, and a z-coordinate range.
[0033] Step 103: performing mean shift clustering on the foreground point clouds to obtain a clustering result.
[0034] The specific process of performing mean shift clustering is as follows: calculating the mean shift vector between the seed point in the foreground point cloud and the points within a preset range of the seed point, the seed point being determined by mean shift clustering; updating the seed point based on the mean shift vector; using the updated seed point to calculate the mean shift vector of each point within the preset range again until the length of the mean shift vector is less than a second preset value, thereby obtaining a target seed point; classifying the foreground point cloud according to the distance between the target seed point and each point, thereby obtaining a clustering result, wherein the clustering result includes multiple clusters.
[0035] A seed point is a coordinate point in the foreground point cloud. ,radius . Get the circle centered at the seed point. The data points within the radius , the number of data points is n, and the mean shift vector of the seed point for this iteration is calculated using the following formula , Indicates this iteration.
[0036] (1) Among them, the function Represents the radially symmetric kernel function Derivative, radially symmetric kernel function , where ck is the normalization constant.
[0037] After calculating the mean shift vector of the seed point for this iteration, add the seed point to the mean shift vector of this iteration. , generate the seed point for the next iteration . Repeat the above steps until the calculated length of the mean shift vector is less than the first preset value, which can be a number close to 0, such as 0.1, 0.2, 0.3, etc. When the length of the mean shift vector is 0 or close to 0, the iteration is completed, and the seed point at this time is the target seed point. Then, based on the distance between the target seed point and other points, the data within the radius range near the target seed point is classified into the cluster to which the target seed point belongs, and the data points within the radius range on the moving path of the target seed point are classified into the cluster. The radius range can be set in advance, and this embodiment does not make any special limitation on this.
[0038] In an exemplary embodiment, calculating the mean drift vector between the seed point and each point within a preset range of the seed point specifically includes the following: calculating the offset vector through the x-coordinate and y-coordinate of each point within the preset range between the seed point and the seed point; calculating the height weight through the z-coordinate of each point within the preset range between the seed point and the seed point; and calculating the mean drift vector between the seed point and each point based on the offset vector and the height weight.
[0039] Traditional mean shift clustering assumes that the probability density of the data is the largest when the seed point mean drifts to the target position, that is, in the three-dimensional point cloud data of the target, after the algorithm is iterated, the seed point position should fall in the middle of the target, and the significant feature of the middle of the target is that it is located in the center and the densest place. This application introduces height value weights, which assign specific weights to data points according to the height features (z-axis height) in the three-dimensional environment, thereby improving the accuracy of clustering, especially in complex environments, it can better identify and cluster densely distributed targets.
[0040] In the 3D data obtained after ground registration, each data point contains x, y, and z coordinates, where the z coordinate can be regarded as the height of the data point from the plane. Then the x and y coordinates of the data are used to calculate the offset vector, and the z coordinate value is used to calculate the height weight.
[0041] For a given seed point (x, y two-dimensional coordinates), radius . Get the circle centered at the seed point. The data points within the radius (x, y two-dimensional coordinates), the corresponding height value is (z-axis coordinate value), the number of data points is n, and the mean drift vector of the seed point in this iteration is calculated using the following formula , Indicates this iteration.
[0042] (2) (3) Where i is the serial number of the data point, i is less than or equal to n; in formula (3), a and b are power coefficients, is the highest height value. These three parameters can be adjusted according to the difference in processing data.
[0043] After calculating the mean shift vector based on the height weight, the seed point is updated to obtain the final target seed point.
[0044] After obtaining the clustering result according to the distance between the target seed point and other data points, the present embodiment further includes: calculating the distance between each target seed point, and merging the clusters whose distance between the target seed points is less than a second preset value. The second preset value can be set according to actual needs, and the present embodiment is not limited thereto. Merging clusters with similar target seed point positions can reduce interference and improve classification accuracy.
[0045] Step 104: extracting a target point cloud from the clustering result, identifying the target point cloud, and obtaining a target category corresponding to the target point cloud.
[0046] The target point cloud is the point cloud data of the target to be detected. The processed point cloud data is analyzed using target detection algorithms (such as deep learning, classification algorithms, etc.) to identify targets such as people, objects, and equipment in the granary. The detection algorithm will classify the objects according to parameters such as shape, size, and speed, and update the location and status information of the targets in real time. Different target point clouds can have different target categories. Target categories can include objects, people, equipment, robots, etc.
[0047] Before extracting the target point cloud, this embodiment further includes: calculating the number of point clouds of each cluster in the clustering result, and filtering out clusters whose number of point clouds is less than a third preset value.
[0048] The third preset value can be set according to actual needs. By removing smaller targets through the third preset value, interference can be avoided and the accuracy of target detection can be improved.
[0049] This embodiment can be applied to multi-target recognition, and the multi-targets may include various objects in a granary, such as storage equipment, transportation equipment, etc., and may also include personnel, mobile robot equipment, etc. Specifically, the feature values of each cluster in the clustering result are extracted, and the target point cloud is screened out from the clustering result based on the feature values.
[0050] In this embodiment, whether the point cloud data is the target to be detected is determined based on the feature value, and the feature value includes data of multiple dimensions, specifically shape features, size features, and motion features.
[0051] Shape features refer to the standard deviation and variance of the target's x, y, and z axes, reflecting the three-dimensional spatial distribution characteristics of the target. Size features: Calculate the projected length and width of the target in the x and y planes to determine the size of the target. Motion features: For moving targets, use their speed and motion trajectory information for further classification.
[0052] For example, the shape features of each cluster in the clustering results are obtained as follows: For each clustering result, calculate the standard deviation and variance in the x, y, and z directions. The specific formula is as follows: Standard deviation formula (taking the x-axis as an example):
[0053] Where N is the number of point clouds, For each point's x coordinate, is the average value of the x-coordinates.
[0054] Variance formula (taking the y-axis as an example):
[0055] in, is the average value of the y coordinates.
[0056] The size features include projection length and projection width. The size features of each cluster in the clustering results are as follows: Determine the size characteristics of a cluster by its projected length and width: Projection length (L): ; Projection width (W): W .
[0057] The motion features include the velocity vector. For a moving target, its motion features are calculated as follows:
[0058] in, , , For The displacement in the x, y, and z directions within a time interval.
[0059] After determining each characteristic value, the present embodiment may include: performing weighted processing on the characteristic values to obtain a comprehensive score value; filtering out clusters whose comprehensive score values are lower than a set threshold to obtain a target point cloud. Performing weighted calculation of the comprehensive score value, filtering out the target point cloud according to the comprehensive score value.
[0060] The standard deviation of the x value of the point cloud data, the standard deviation of the y value, the standard deviation of the z value, the variance of the x value, the variance of the y value, the variance of the z value, the covariance of the x and y values, the direction of the principal component, the length and width of the point cloud data are summed according to the weights to obtain the feature comprehensive score value, and the score value range is [0,1]. If it is lower than 0.5, the clustering result is considered not to be the target data; if it is higher, it is considered to be the target data.
[0061] Specifically, the comprehensive score can be expressed as: ,in, , , is the weight parameter of each feature, which is adjusted and optimized through experiments. are the standard deviations in the x, y, and z directions, respectively; , , are the variances in the x, y, and z directions respectively.
[0062] Classification is performed based on the comprehensive score S. If S is lower than the set threshold, it is considered non-target data. If S is higher than the threshold, the target is further classified into people, objects, robots, etc. based on the feature value.
[0063] After the target point cloud is selected, the category to which the target point cloud specifically belongs can be identified by a recognition algorithm. In this embodiment, different categories can be set with different set thresholds, so as to filter out target point clouds corresponding to different categories and realize multi-target detection. The recognition algorithm can adopt various deep learning models, and this embodiment is not limited thereto.
[0064] This embodiment, by applying three-dimensional point cloud data analysis technology, can, on the one hand, achieve real-time monitoring and target detection of the internal environment of the granary, which can effectively reduce the frequency of manual inspections, reduce labor costs, and improve management efficiency. Accurate detection of robots and manual operations in the granary can avoid collisions or misoperations, and ensure the safety of equipment and personnel. On the other hand, the granary environment is complex, and the safety of stored grain is of vital importance. Through lidar and three-dimensional point cloud data technology, it is possible to better detect potential dangerous targets in the warehouse, such as sliding objects, abnormal operation of equipment, etc., and timely warnings can be issued, thereby reducing accidents and protecting grain from damage.
[0065] In an exemplary embodiment, the acquired 3D point cloud data and the final detection result, i.e., the target category corresponding to the target point cloud, can be stored in real time for subsequent analysis and viewing. The stored data can not only be used for daily management, but also can be played back and investigated in the event of an accident to find out the cause.
[0066] Furthermore, this embodiment also provides a target detection device in a granary, which can be used to execute the above-mentioned target detection method in a granary. Figure 3FIG. 1 shows a schematic diagram of the structure of the target detection device in the granary. Figure 3 As shown, the target detection device 200 in the granary specifically includes: a point cloud acquisition module 201, used to acquire three-dimensional point cloud data of the granary scene; a foreground extraction module 202, used to screen the three-dimensional point cloud data to obtain the foreground point cloud in the three-dimensional point cloud data; a clustering module 203, used to perform mean shift clustering on the foreground point cloud to obtain a clustering result; and an identification module 204, used to extract a target point cloud from the clustering result, identify the target point cloud, and obtain a target category corresponding to the target point cloud.
[0067] In an exemplary embodiment, the foreground extraction module 202 is specifically used to: transform the three-dimensional point cloud data into a unified three-dimensional coordinate system to obtain pre-processed data; and filter out data of a preset detection area from the pre-processed data to obtain a foreground point cloud.
[0068] In an exemplary embodiment, the clustering module 203 specifically includes: a drift vector calculation module, which is used to calculate the mean drift vector of the seed point in the foreground point cloud and the points within a preset range of the seed point, and the seed point is determined by mean drift clustering; a seed point update module, which is used to update the seed point based on the mean drift vector; a final seed point determination module, which is used to use the updated seed point to recalculate the mean drift vector of each point within the preset range until the length of the mean drift vector is less than a first preset value, so as to obtain a target seed point; a classification module, which is used to classify the foreground point cloud according to the distance between the target seed point and each point, and obtain a clustering result, wherein the clustering result includes multiple clusters.
[0069] In an exemplary embodiment, the target detection device 200 in the granary may further include: a data merging module, configured to calculate the distance between each target seed point, and merge clusters whose distances between target seed points are less than a second preset value.
[0070] In an exemplary embodiment, the drift vector calculation module is specifically used to: calculate the offset vector through the x-coordinate and y-coordinate of the seed point and each point within a preset range of the seed point; calculate the height weight through the z-coordinate of the seed point and each point within the preset range of the seed point; and calculate the mean drift vector of the seed point and each point based on the offset vector and the height weight.
[0071] In an exemplary implementation, the identification module 204 is specifically configured to extract feature values of each cluster in the clustering result, and filter out the target point cloud from the clustering result based on the feature values.
[0072] In an exemplary embodiment, the identification module 204 also includes a feature extraction module, which is used to obtain shape features of each cluster in the clustering results, wherein the shape features include standard deviation and variance in the x-, y-, and z-directions; obtain size features of each cluster in the clustering results, wherein the size features include projection length and projection width; obtain motion features of each cluster in the clustering results, wherein the motion features include velocity vectors; and obtain feature values of each cluster based on the shape features, size features, and motion features.
[0073] In an exemplary embodiment, the recognition module 204 further includes a target detection module for performing weighted processing on the feature values to obtain a comprehensive score value; and filtering out clusters whose comprehensive score values are lower than a set threshold to obtain a target point cloud.
[0074] In an exemplary embodiment, the target detection device in the granary further includes a data screening module for calculating the number of point clouds of each cluster in the clustering result, and screening out clusters whose number of point clouds is less than a third preset value.
[0075] The specific details of each module or unit in the above-mentioned target detection device in the granary have been described in detail in the corresponding target detection method in the granary, so they will not be repeated here.
[0076] The embodiment of the present application also provides an electronic device, Figure 4 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. Figure 4 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0077] like Figure 4 As shown, the electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0078] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0079] 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 storage medium, and the computer program contains 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 the communication part 609, and / or installed from a removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the embodiments of the present application are executed.
[0080] It should be noted that the computer-readable medium shown 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. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, 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 appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0081] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing 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 or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0082] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0083] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and the one or more programs include instructions, and when the instructions are executed by the electronic device, the electronic device implements the method described in the above embodiment.
[0084] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0085] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for detecting a target in a granary, characterized in that: include: Obtain the 3D point cloud data of the granary scene; Screening the three-dimensional point cloud data to obtain a foreground point cloud in the three-dimensional point cloud data; Performing mean shift clustering on the foreground point clouds to obtain a clustering result; A target point cloud is extracted from the clustering result, and the target point cloud is identified to obtain a target category corresponding to the target point cloud.
2. The target detection method in a granary according to claim 1, characterized in that: The screening of the three-dimensional point cloud data to obtain a foreground point cloud in the three-dimensional point cloud data includes: Transforming the three-dimensional point cloud data into a unified three-dimensional coordinate system to obtain preprocessed data; The data of the preset detection area is screened out from the pre-processed data to obtain the foreground point cloud.
3. The target detection method in a granary according to claim 1, characterized in that: The performing mean shift clustering on the foreground point clouds to obtain a clustering result includes: Calculating a mean shift vector between a seed point in the foreground point cloud and a point within a preset range of the seed point, wherein the seed point is determined by mean shift clustering; Updating the seed point based on the mean shift vector; The updated seed point is used to calculate the mean shift vector of each point within the preset range again until the length of the mean shift vector is less than the first preset value, thereby obtaining the target seed point; The foreground point cloud is classified according to the distance between the target seed point and each point to obtain a clustering result, which includes a plurality of clusters.
4. The target detection method in a granary according to claim 3, characterized in that: Also includes: The distance between each target seed point is calculated, and the clusters whose distance between the target seed points is less than a second preset value are merged.
5. The target detection method in a granary according to claim 3, characterized in that: The calculating the mean shift vector between the seed point and each point within a preset range of the seed point includes: Calculate an offset vector using the x-coordinate and y-coordinate of each point within a preset range of the seed point and the seed point; Calculate the height weight by using the z coordinates of the seed point and each point within a preset range of the seed point; The mean shift vector between the seed point and each point is calculated based on the offset vector and the height weight.
6. The target detection method in a granary according to claim 1, characterized in that: The identifying the target point cloud to obtain the target category corresponding to the target point cloud includes: Extracting characteristic values of each cluster in the clustering result; Perform weighted processing on the characteristic values to obtain a comprehensive score; Screening out clusters whose comprehensive score is lower than a set threshold to obtain a target point cloud; Before extracting the characteristic value of each cluster in the clustering result, the method further includes: calculating the number of point clouds of each cluster in the clustering result, and filtering out clusters whose number of point clouds is less than a third preset value.
7. The target detection method in a granary according to claim 6, characterized in that: The extracting the characteristic value of each cluster in the clustering result includes: Obtaining shape features of each cluster in the clustering results, wherein the shape features include standard deviation and variance in the x-direction, y-direction, and z-direction; Obtaining the size feature of each cluster in the clustering result, wherein the size feature includes a projection length and a projection width; Acquire motion features of each cluster in the clustering result, wherein the motion features include a velocity vector; The characteristic values of each type of cluster are obtained based on the shape feature, size feature and motion feature.
8. A target detection device in a granary, characterized in that: include: Point cloud acquisition module, used to obtain three-dimensional point cloud data of the granary scene; A foreground extraction module, used for screening the three-dimensional point cloud data to obtain a foreground point cloud in the three-dimensional point cloud data; A clustering module, used for performing mean shift clustering on the foreground point clouds to obtain a clustering result; The recognition module is used to extract the target point cloud from the clustering result, recognize the target point cloud, and obtain the target category corresponding to the target point cloud.
9. A computer-readable medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the target detection method in a granary as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: It comprises a processor and a memory, wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the target detection method in the granary described in any one of claims 1 to 7.
Citation Information
Patent Citations
Pavement scene target identification method based on laser radar point cloud
CN114612795A
Pedestrian detection method, computer equipment and storage medium
CN115713787A
Cited By
3D target detection method, system, device and medium
CN120599598A