A method and apparatus for identifying a case
By acquiring point cloud data of containers, performing planar fitting and 3D image processing, and calculating the maximum protrusion distance, the problem of the inability to identify bulging containers in existing technologies is solved, and efficient container recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- RIZHAO PORT CONTAINER DEV CO LTD
- Filing Date
- 2022-11-29
- Publication Date
- 2026-05-19
AI Technical Summary
Existing container identification systems are unable to effectively identify bulging containers, especially when using image recognition technology, which has limitations.
By acquiring the original point cloud recognition data of the box, performing preprocessing, and then performing planar fitting, a three-dimensional image of the box is obtained. The maximum protrusion distance is calculated, and the box is identified by determining whether the maximum protrusion distance is greater than a preset threshold.
It enables accurate identification of container conditions, effectively identifying bulging containers and improving the accuracy and efficiency of identification.
Smart Images

Figure CN115731366B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent recognition technology, and in particular to a method and apparatus for recognizing boxes. Background Technology
[0002] Currently, containers are widely used in logistics and transportation. During transport, damage or bulging of the container can cause significant inconvenience. Therefore, it is necessary to monitor the condition of the container.
[0003] Current container identification systems use high-definition cameras to capture images and then identify the container based on those images. However, image recognition technology has significant limitations in identifying container damage; it cannot effectively identify containers with bulging bodies based on images. Summary of the Invention
[0004] In view of this, this application provides a method and apparatus for identifying container bodies, with the aim of solving the problem of being unable to effectively identify a container body as a bulging container.
[0005] To achieve the above objectives, this application provides the following technical solution:
[0006] A first aspect of this application provides a method for identifying a box, the method comprising:
[0007] Obtain the raw point cloud recognition data of the enclosure;
[0008] The original point cloud data is preprocessed to obtain point cloud recognition data, wherein the preprocessing includes at least one of the following: filtering and parsing;
[0009] The point cloud recognition data is fitted to a plane using a preset plane fitting algorithm to obtain a three-dimensional image of the box.
[0010] Based on the three-dimensional image, the maximum protrusion distance of the box is obtained;
[0011] Determine whether the maximum protrusion distance is greater than a preset first threshold;
[0012] If the maximum protrusion distance is greater than the preset first threshold, then the box is determined to be a bulging box.
[0013] Optionally, the step of performing planar fitting on the point cloud recognition data using a preset planar fitting algorithm to obtain a three-dimensional image of the box includes:
[0014] The number of points is obtained based on the point cloud recognition data;
[0015] Obtain the total number of interior points corresponding to multiple iterations. Each iteration includes: obtaining three point clouds from the point cloud recognition data and constructing a plane based on the three point clouds; calculating the distance from each point cloud in the point cloud recognition data to the plane; calculating the number of interior points to obtain the total number of point clouds, wherein the interior points are point clouds whose distance from the plane is less than a preset second threshold.
[0016] Determine whether the total number of interior points is greater than half of the number of point clouds;
[0017] If the total number of interior points is greater than or equal to half of the number of point clouds, then the three-dimensional image is obtained based on the plane and the point cloud recognition data.
[0018] Optionally, the maximum protrusion distance of the box is obtained based on the three-dimensional image, including:
[0019] A three-dimensional rectangular coordinate system is established using a point in the three-dimensional image as the zero point;
[0020] Based on the three-dimensional image and the solid rectangular coordinate system, the coordinate information of the box in the solid rectangular coordinate system is obtained;
[0021] Based on the coordinate information, the maximum protrusion distance of the box is obtained.
[0022] Optionally, the method further includes:
[0023] If the total number of interior points is less than or equal to half of the number of point clouds, then the preset maximum number of iterations is reduced and the current iteration number is incremented by one, wherein the initial value of the current iteration number is zero;
[0024] Determine whether the current iteration number is greater than the maximum number of iterations after reduction;
[0025] If the current iteration number is greater than the maximum iteration number, then the three-dimensional image is obtained based on the plane with the largest total number of interior points among the multiple interior points and the point cloud recognition data.
[0026] Optionally, the reduction in the number of iterations is achieved using the following formula:
[0027]
[0028] Wherein, P is the probability of obtaining the correct plane, t is the total number of interior points, and i′ max The maximum number of iterations after reduction is given, where N is the total number of point clouds on the plane.
[0029] Optionally, acquiring the raw point cloud recognition data of the enclosure includes:
[0030] When the container passes the lidar, the lidar collects the container data to obtain the original point cloud recognition data.
[0031] Optionally, the filtering of the original point cloud data includes:
[0032] Determine whether the point cloud in the original point cloud data is within the detection range of the enclosure;
[0033] If the point cloud in the original point cloud data is not within the detection range of the box, then the point cloud in the original point cloud data is removed to obtain the point cloud recognition data.
[0034] A second aspect of this application provides a box identification device, the device comprising: an acquisition module, a processing module, an image creation module, and a judgment module;
[0035] The acquisition module is used to acquire the original point cloud recognition data of the box;
[0036] The processing module is used to preprocess the raw point cloud data to obtain point cloud recognition data, wherein the preprocessing includes at least one of the following: filtering and parsing;
[0037] The image building module is used to perform plane fitting on the point cloud recognition data using a preset plane fitting algorithm to obtain a three-dimensional image of the box.
[0038] The processing module is also used to obtain the maximum protrusion distance of the box body based on the three-dimensional image;
[0039] The judgment module is used to determine whether the maximum protrusion distance is greater than a preset first threshold.
[0040] If the maximum protrusion distance is greater than the preset first threshold, then the box is determined to be a bulging box.
[0041] Optional,
[0042] The image building module is also used to obtain the number of point clouds based on the point cloud recognition data;
[0043] The image building module is also used to obtain the total number of interior points corresponding to multiple iterations. Each iteration includes: obtaining three point clouds from the point cloud recognition data and constructing a plane based on the three point clouds; calculating the distance from each point cloud in the point cloud recognition data to the plane; calculating the number of interior points to obtain the total number of point clouds, wherein the interior points are point clouds whose distance from the point cloud to the plane is less than a preset second threshold.
[0044] The image building module is also used to determine whether the total number of interior points is greater than half of the number of point clouds;
[0045] If the total number of interior points is greater than or equal to half of the number of point clouds, the image building module is further configured to obtain the three-dimensional image based on the plane and the point cloud recognition data.
[0046] Optionally, the processing module is further configured to establish a three-dimensional rectangular coordinate system using a point in the three-dimensional image as the zero point;
[0047] The processing module is further configured to obtain the coordinate information of the box in the solid rectangular coordinate system based on the three-dimensional image and the solid rectangular coordinate system;
[0048] The processing module is also used to obtain the maximum protrusion distance of the box based on the coordinate information.
[0049] Optionally, if the total number of interior points is less than or equal to half of the number of point clouds, the image building module is further configured to reduce the preset maximum number of iterations by incrementing the current iteration number by one.
[0050] The image creation module is also used to determine whether the current iteration number is greater than the maximum number of iterations after reduction;
[0051] If the current iteration number is greater than the maximum iteration number, the image building module is further configured to obtain the three-dimensional image based on the plane with the largest total number of interior points among the multiple interior points and the point cloud recognition data.
[0052] Optionally, the image building module is further configured to reduce the number of iterations, achieved through the following formula:
[0053]
[0054] Wherein, P is the probability of obtaining the correct plane, t is the total number of interior points, and i′ max N represents the maximum number of iterations after reduction, and is the total number of point clouds on the plane.
[0055] Optionally, the acquisition module is used to acquire the original point cloud recognition data of the box, including:
[0056] The acquisition module is also used to collect the box data of the box through the lidar when the box passes by the lidar, so as to obtain the original point cloud recognition data.
[0057] Optionally, the judgment module is further configured to determine whether the point cloud in the original point cloud data is within the detection range of the enclosure;
[0058] If the point cloud in the original point cloud data is not within the detection range of the box, the processing module is further used to remove the point cloud in the original point cloud data to obtain the point cloud recognition data.
[0059] This application discloses a method and apparatus for identifying container bodies. The method includes: acquiring raw point cloud identification data of the container body; preprocessing the raw point cloud data to obtain point cloud identification data, wherein the preprocessing includes at least one of the following: filtering and parsing; performing plane fitting on the point cloud identification data using a preset plane fitting algorithm to obtain a three-dimensional image of the container body; obtaining the maximum protrusion distance of the container body based on the three-dimensional image; determining whether the maximum protrusion distance is greater than a preset first threshold; if the maximum protrusion distance is greater than the preset first threshold, then determining that the container body is a bulging container. This application solves the problem of not being able to effectively identify bulging containers by obtaining three-dimensional data of the container body based on the point cloud identification data, calculating the maximum protrusion distance of the container body, and determining whether the container body is a bulging container based on the maximum distance. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 A flowchart illustrating a box identification method provided in an embodiment of this application;
[0062] Figure 2 A flowchart illustrating another method for identifying a box provided in this application embodiment;
[0063] Figure 3 This is a schematic diagram of the structure of a box identification device provided in an embodiment of this application;
[0064] Figure 4 A flowchart illustrating another method for identifying a box provided in this application embodiment;
[0065] Figure 5 A schematic diagram of a decision tree structure provided in an embodiment of this application;
[0066] Figure 6 This is a schematic diagram of the structure of raw point cloud data provided in an embodiment of this application;
[0067] Figure 7 This is a schematic diagram of the structure of point cloud recognition data provided in an embodiment of this application;
[0068] Figure 8 An example diagram of a three-dimensional image provided in an embodiment of this application;
[0069] Figure 9 An example planar diagram obtained from three point clouds is provided for an embodiment of this application;
[0070] Figure 10 An example diagram showing the angle between the normal vector of a plane and the Z-axis, provided for an embodiment of this application;
[0071] Figure 11 This is a schematic diagram illustrating the optimized time metrics of the planar recognition algorithm provided in the embodiments of this application;
[0072] Figure 12 This is a schematic diagram of the structure of another box identification device provided in an embodiment of this application. Detailed Implementation
[0073] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0074] The following is combined with Figure 1 This paper introduces a box identification method provided by an embodiment of the present application, which can be implemented through steps S101-S106.
[0075] S101: Obtain the original point cloud recognition data of the box.
[0076] Specifically, when the container passes by the lidar, the lidar collects the container data to obtain raw point cloud recognition data.
[0077] S102: Preprocess the raw point cloud data to obtain point cloud recognition data.
[0078] Specifically, the raw point cloud data is filtered by determining whether the points in the raw point cloud data are within the detection range of the detection box. If the points in the raw point cloud data are not within the detection range of the detection box, they are discarded, and the resulting point cloud recognition data is obtained. By filtering the raw point cloud data, it is possible to avoid collecting data outside the detection box and prevent useless data from affecting the judgment results.
[0079] Specifically, the raw point cloud data is parsed. The parsing process involves converting the data storage format of the acquired raw point cloud data packet from pcap to pcd or csv, and retaining only the coordinate and reflectivity information of the point cloud recognition data. This avoids data redundancy and improves the efficiency of box data recognition.
[0080] S103: The point cloud recognition data is fitted to a plane using a preset plane fitting algorithm to obtain a three-dimensional image of the box.
[0081] Specifically, the number of point clouds is obtained based on the point cloud recognition data. Three point clouds are acquired from the point cloud recognition data, and a plane is constructed based on these three point clouds. The distance from each point cloud in the point cloud recognition data to the plane is calculated. The total number of interior points is calculated, where interior points are those point clouds whose distance to the plane is less than a preset second threshold. It is then determined whether the total number of interior points is greater than half the number of point clouds. If the total number of interior points is greater than or equal to half the number of point clouds, a 3D image is obtained based on the plane and point cloud recognition data. Through this plane fitting algorithm, a 3D side image of the box can be obtained, and the box can be identified based on this 3D side image.
[0082] S104: Based on the 3D image, obtain the maximum protrusion distance of the box.
[0083] Specifically, a three-dimensional Cartesian coordinate system can be established using a point in the 3D image as the origin. Based on the 3D image and the Cartesian coordinate system, the coordinate information of the box within the Cartesian coordinate system is obtained. Based on this coordinate information, the maximum protrusion distance of the box is determined. By placing the 3D image within the Cartesian coordinate system, parameters such as the maximum protrusion distance, protrusion area, and protrusion volume of the box can be obtained based on the coordinate information of the 3D image within the Cartesian coordinate system. These parameters can then be used to analyze the box's condition.
[0084] S105: Determine whether the maximum protrusion distance is greater than the preset first threshold.
[0085] Specifically, based on the obtained maximum protrusion distance of the box, it is determined whether the maximum protrusion distance is greater than a preset first threshold.
[0086] It should be noted that the preset threshold size can be adjusted according to business needs.
[0087] S106: If the maximum protrusion distance is greater than the preset threshold, the box is determined to be a bulging box.
[0088] Specifically, when the maximum protrusion distance is greater than a preset threshold, the box is a bulging box.
[0089] The method provided in this application embodiment can obtain the three-dimensional data of the container based on the point cloud recognition data of the container, calculate the maximum protrusion distance of the container, and determine whether the container is a bulging container based on the maximum distance, thus solving the problem of not being able to effectively identify the container body as a bulging container.
[0090] The following is combined with Figure 2 This application introduces a box identification method, which can be implemented through the following steps S201-S205.
[0091] In the embodiments of this application, the following are adopted: Figure 3 The diagram illustrates a container identification device, comprising a sensing module 301, a detection module 302, and a data communication module 303. The detection module 302 consists of a preprocessing module 304, a container surface data extraction module 305, a feature extraction module 306, and an algorithm detection module 307. This device can access the local area network of the port via the Message Queuing Telemetry Transport (MQTT) protocol.
[0092] S201: Obtain raw point cloud data.
[0093] Specifically, the sensing module 301 is used to collect and save raw point cloud data. The sensing module 301 collects the raw point cloud data of the container through lidar and trigger mechanism, and transmits the raw point cloud data to the local area network of the port for storage, which can ensure the security of the raw point cloud data.
[0094] Specifically, the perception module 301 uses a trigger mechanism to collect data. The lidar will only start collecting data when a vehicle passes by, thus avoiding the occupation of storage space and transmission channels due to the collection of a large amount of invalid data.
[0095] Specifically, the detection range of the sensing module 301 includes the side, front, and rear surfaces of the enclosure. The data acquisition frequency of the lidar is greater than 5Hz, and the actual acquisition efficiency can be adjusted according to actual needs.
[0096] S202: Preprocess the raw point cloud data.
[0097] Specifically, the preprocessing module 304 parses and filters the raw point cloud data to obtain point cloud recognition data.
[0098] Specifically, the preprocessing module 304 can identify the vehicle's parking position and determine whether the point cloud in the original point cloud data is within the detection range of the enclosure. If the point cloud in the original point cloud data is not within the detection range of the enclosure, the point cloud in the original point cloud data is removed to obtain point cloud recognition data. The detection range of the enclosure includes the side surface, front surface, and rear surface of the enclosure.
[0099] Specifically, the preprocessing module 304 parses the data storage format of the acquired raw point cloud data packet from pcap to pcd or csv, and retains only the coordinate information and reflectivity information of the point cloud recognition data.
[0100] Specifically, the raw point cloud data, such as Figure 6 As shown, the processed point cloud recognition data is as follows: Figure 7 As shown.
[0101] S203: Perform plane fitting.
[0102] Specifically, the box surface data extraction module 305 uses the point cloud recognition data output by the preprocessing module as input data, performs plane fitting based on the point cloud recognition data, and obtains a three-dimensional image of the side of the box.
[0103] Specifically, the box surface data extraction module 305 obtains the number of point clouds based on the point cloud recognition data. It acquires three point clouds from the point cloud recognition data and constructs a plane based on these three point clouds. It calculates the distance from each point cloud in the point cloud recognition data to the plane. It calculates the total number of interior points, where interior points are those whose distance to the plane is less than a preset second threshold. It then determines whether the total number of interior points is greater than half the number of point clouds. If the total number of interior points is greater than or equal to half the number of point clouds, a three-dimensional image is obtained based on the plane and the point cloud recognition data. This three-dimensional image is as follows: Figure 8 .
[0104] Specifically, the process ends when the point cloud recognition data indicates that the transport vehicle is empty. When the point cloud recognition data includes data from two containers (i.e., a dual-container scenario), the system can obtain container data for both containers based on the point cloud recognition data, and then generate 3D images from each container's data.
[0105] S204: Perform box identification and obtain the identification result.
[0106] Specifically, the feature extraction module 306 can establish a three-dimensional rectangular coordinate system using a point in the 3D image as the origin. Based on the 3D image and the three-dimensional rectangular coordinate system, the coordinate information of the box in the three-dimensional rectangular coordinate system is obtained. Based on the coordinate information, the maximum protrusion distance of the box is obtained. By placing the 3D image in the three-dimensional coordinate system, parameters such as the maximum protrusion distance, protrusion area, and protrusion volume of the box can be obtained based on the coordinate information of the 3D image in the three-dimensional coordinate system, and these parameters are input into the algorithm detection module 307.
[0107] Specifically, in the case of two boxes, the feature extraction module 306 extracts features from the two three-dimensional images respectively.
[0108] Specifically, the algorithm detection module 307 inputs the received box parameters into, for example, Figure 5 In the decision tree shown, the decision tree provides the recognition result and sends the decision result to the data communication module 303. In this decision tree, std refers to the index used for classification, gini refers to the Gini coefficient which reflects the purity of the classification of each node in the decision tree, samples is the number of samples in the node, and value is the number of samples in each category, which in this case is the number of no bulge, micro bulge, and bulge.
[0109] Specifically, the algorithm detection module 307 can provide detection results based on the number of containers and their load conditions. The load conditions are divided into single container, front container, and rear container, and the detection results are divided into normal, minor, and severe.
[0110] S205: Feedback on recognition results.
[0111] Specifically, the data communication module 303 receives the identification result from the algorithm detection module 307 and uploads the identification result to the local area network of the port for storage. The data transmission latency is maintained at the millisecond level, and the data is encrypted and a user encryption mechanism is executed to ensure data security.
[0112] Through the embodiments of this application, three-dimensional data of container body data can be acquired by LiDAR, and recognition results can be obtained accurately and efficiently based on the acquired recognition data.
[0113] The following is combined with Figure 4 This application introduces a box identification method, which can be implemented by steps S401-S409.
[0114] S401: Obtain the number of points based on the point cloud recognition data.
[0115] Specifically, it can obtain the number of point clouds and the coordinates and reflectivity information of each point cloud from the point cloud recognition data.
[0116] Specifically, steps S402-S404 described below constitute one iteration process.
[0117] S402: Obtain three point clouds from the point cloud recognition data, and construct a plane based on the three point clouds.
[0118] Specifically, a plane is constructed based on the coordinate information of the three point clouds, which is achieved by solving the plane equation as follows:
[0119]
[0120] Ax + By + Cz - D = 0. Where a, b, and c are three point clouds, vector n is the normal vector of the plane, D is a constant, A, B, and C are constant coefficients of the plane equation, and (x, y, z) is the coordinates of a point on the plane.
[0121] Specifically, the plane obtained from the three point clouds is as follows: Figure 9 As shown.
[0122] S403: Calculate the distance from each point cloud in the point cloud recognition data to the plane.
[0123] Specifically, the point cloud to plane data is calculated using the following formula to solve the point-plane distance:
[0124] Where d is the distance from the point cloud to the plane.
[0125] S404: Calculate the total number of interior points.
[0126] Specifically, the interior points are point clouds whose distance from the plane is less than a preset second threshold.
[0127] Specifically, the preset second threshold can be adjusted according to actual needs.
[0128] S405: Determine if the total number of interior points is greater than half the number of points in the point cloud.
[0129] S406: If the total number of interior points is greater than or equal to half the number of points in the point cloud, then a three-dimensional image is obtained based on the plane and point cloud recognition data.
[0130] S407: Reduce the preset maximum number of iterations and increment the current iteration number by one.
[0131] Specifically, reducing the maximum number of iterations is achieved using the following formula:
[0132]
[0133] Where i is the maximum number of iterations, P is the probability of obtaining the correct plane, t is the total number of interior points, and i′ max The maximum number of iterations after reduction is given, where N is the total number of point clouds on the plane, and the initial value of the current iteration number is zero.
[0134] S408: Determine if the current iteration number is greater than the maximum number of iterations.
[0135] Specifically, if the current iteration number is greater than the maximum number of iterations, proceed to step S409; if the current iteration number is less than or equal to the maximum number of iterations, proceed to step S403.
[0136] Understandably, after re-entering step S403, the three point clouds obtained cannot be exactly the same as the three point clouds selected previously.
[0137] S409: If the current iteration number is greater than the maximum iteration number, then a 3D image is obtained based on the plane with the largest total number of interior points and the point cloud recognition data.
[0138] Specifically, when the current iteration number is greater than the maximum iteration number, the plane with the largest total number of interior points and the point cloud recognition data are selected, and the plane is considered to be the optimal solution. A three-dimensional image is then obtained based on the plane.
[0139] Specifically, based on this 3D image, we can obtain the point-to-surface distance feature value, peak-to-peak value (ptp), variance (var), standard deviation (std), mean (avg), fitted plane feature value, and the angle between the normal vector and the Z-axis. The angle between the normal vector and the Z-axis is as follows: Figure 10 As shown, this angle is a feature value of the fitted plane. The greater the change in angle at different points, the greater the undulation of the plane.
[0140] It should be noted that plane fitting methods include, but are not limited to, the original Random Sample Consensus (RanSac) algorithm, optimized RanSac algorithms, and principal components analysis (PCA) techniques. The optimization time metrics for various plane recognition algorithms are as follows: Figure 11 As shown.
[0141] Through the embodiments of this application, a three-dimensional graphic can be constructed based on point cloud recognition data, and then various parameters for box detection can be obtained based on the three-dimensional image.
[0142] The following is combined with Figure 12 This application introduces a box identification device, which includes: an acquisition module 121, a processing module 122, an image building module 123, and a judgment module 124.
[0143] The acquisition module 121 is used to acquire the original point cloud recognition data of the box.
[0144] The processing module 122 is used to preprocess the raw point cloud data to obtain point cloud recognition data. The preprocessing includes at least one of the following: filtering and parsing.
[0145] The image creation module 123 is used to perform plane fitting on the point cloud recognition data using a preset plane fitting algorithm to obtain a three-dimensional image of the box.
[0146] The processing module 122 is also used to obtain the maximum protrusion distance of the box based on the three-dimensional image.
[0147] The judgment module 124 is used to determine whether the maximum protrusion distance is greater than a preset first threshold.
[0148] If the maximum protrusion distance is greater than the preset first threshold, the box is determined to be a bulging box.
[0149] Specifically, the image building module 123 is also used to obtain the number of point clouds based on the point cloud recognition data.
[0150] The image building module 123 is also used to obtain three point clouds from the point cloud recognition data and construct a plane based on the three point clouds.
[0151] The image building module 123 is also used to calculate the distance from each point cloud in the point cloud recognition data to the plane.
[0152] The image building module 123 is also used to calculate the total number of interior points, wherein the interior points are point clouds whose distance from the plane is less than a preset second threshold.
[0153] The image building module 123 is also used to determine whether the total number of interior points is greater than half of the number of point clouds.
[0154] If the total number of interior points is greater than or equal to half the number of point clouds, the image building module 123 is also used to obtain a three-dimensional image based on the plane and point cloud recognition data.
[0155] Specifically, the processing module 122 is also used to establish a three-dimensional rectangular coordinate system with a point in the three-dimensional image as the zero point.
[0156] The processing module 122 is also used to obtain the coordinate information of the box in the solid rectangular coordinate system based on the three-dimensional image and the solid rectangular coordinate system.
[0157] The processing module 122 is also used to obtain the maximum protrusion distance of the box based on the coordinate information.
[0158] Specifically, if the total number of interior points is less than or equal to half the number of point clouds, the image building module 123 is also used to reduce the maximum number of iterations and increment the current iteration number by one, where the initial value of the current iteration number is zero.
[0159] The image creation module 123 is also used to determine whether the current iteration number is greater than the maximum iteration number.
[0160] If the current iteration number is greater than the maximum iteration number, the image building module 123 is also used to obtain a three-dimensional image based on the plane and point cloud recognition data with the largest total number of interior points among multiple interior points.
[0161] Specifically, the image creation module 123 is also used to reduce the number of iterations, achieved through the following formula:
[0162]
[0163] Where P is the probability of obtaining the correct plane, t is the total number of interior points, and i′ max The maximum number of iterations after reduction is given, and N is the total number of point clouds on the plane.
[0164] Specifically, module 121 is used to acquire the raw point cloud recognition data of the box, including:
[0165] The acquisition module 121 is also used to collect box data of the box through the lidar when the box passes by the lidar, and obtain raw point cloud recognition data.
[0166] Specifically, the judgment module 124 is also used to determine whether the point cloud in the original point cloud data is within the detection range of the box.
[0167] If the point cloud in the original point cloud data is not within the detection range of the box, the processing module 122 is also used to remove the point cloud in the original point cloud data to obtain point cloud recognition data.
[0168] The device provided in this application embodiment can obtain the three-dimensional data of the container based on the point cloud recognition data of the container, calculate the maximum protrusion distance of the container, and determine whether the container is a bulging container based on the maximum distance, thus solving the problem of not being able to effectively identify the container body as a bulging container.
[0169] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0170] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0171] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical business division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0172] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0173] Furthermore, the various business units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software business unit.
[0174] If the integrated unit is implemented as a software business unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0175] Those skilled in the art will recognize that, in one or more of the examples above, the services described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these services can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0176] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention.
[0177] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for identifying a box, characterized in that, Applied to port containers, the method includes: The raw point cloud data of the side, front, and rear surfaces of the container are acquired using lidar and a trigger mechanism, and the raw point cloud data is transmitted to the local area network of the port for storage. The original point cloud data is preprocessed to obtain point cloud recognition data, wherein the preprocessing includes at least one of the following: filtering and parsing; The point cloud recognition data is fitted to a plane using a preset plane fitting algorithm to obtain a three-dimensional image of the box. This process includes: obtaining the number of point clouds from the point cloud recognition data; acquiring the total number of interior points corresponding to multiple iterations, wherein each iteration includes: acquiring three point clouds from the point cloud recognition data and constructing a plane based on the three point clouds; calculating the distance from each point cloud in the point cloud recognition data to the plane; calculating the number of interior points to obtain the total number of interior points, where the interior points are those whose distance from the point cloud to the plane is less than a preset second threshold; determining whether the total number of interior points is greater than half the number of point clouds; if the total number of interior points is greater than or equal to half the number of point clouds, then the three-dimensional image is obtained based on the plane and the point cloud recognition data. Based on the three-dimensional image, the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box are obtained; wherein, obtaining the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box based on the three-dimensional image includes: establishing a three-dimensional rectangular coordinate system with a point in the three-dimensional image as the zero point; obtaining the coordinate information of the box in the three-dimensional rectangular coordinate system based on the three-dimensional image and the three-dimensional rectangular coordinate system; and obtaining the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box based on the coordinate information. Based on the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box body, the bulging condition of the box body is determined; the determination of the bulging condition of the box body based on the maximum protrusion distance, protrusion area, and protrusion volume parameters includes: The maximum protrusion distance, protrusion area, and protrusion volume parameters of the box are input into the decision tree, and the decision tree provides the recognition result. The decision tree includes std, gini, samples, and value. std refers to the index used for classification, gini refers to the Gini coefficient, which reflects the purity of classification at each node of the decision tree, samples refers to the number of samples in the node, and value refers to the number of non-bulging, slightly bulging, and bulging. Based on the identification results, the detection results are given according to the number of boxes and the load conditions; the load conditions include single box, front box and rear box; the detection results include normal, minor and severe. or, Determine whether the maximum protrusion distance is greater than a preset first threshold; If the maximum protrusion distance is greater than the preset first threshold, then the box is determined to be a bulging box.
2. The method according to claim 1, characterized in that, The method further includes: If the total number of interior points is less than half of the number of point clouds, then reduce the preset maximum number of iterations and increment the current iteration number by one; Determine whether the current iteration number is greater than the maximum number of iterations after reduction; If the current iteration number is greater than the maximum iteration number, then the three-dimensional image is obtained based on the plane with the largest total number of interior points among the multiple interior points and the point cloud recognition data.
3. The method according to claim 2, characterized in that, The reduction in the number of iterations is achieved through the following formula: ; Where P is the probability of obtaining the correct plane, t is the total number of interior points, and... The maximum number of iterations after reduction is given, where N is the total number of point clouds on the plane.
4. The method according to claim 1, characterized in that, The filtering of the original point cloud data includes: Determine whether the point cloud in the original point cloud data is within the detection range of the box; If the point cloud in the original point cloud data is not within the detection range of the box, then the point cloud in the original point cloud data is removed to obtain the point cloud recognition data.
5. A box identification device, characterized in that, Applied to port containers, the device includes: an acquisition module, a processing module, an image creation module, and a judgment module; The acquisition module is used to acquire the original point cloud data of the side, front, and rear surfaces of the container through lidar and triggering mechanism, and transmit the original point cloud data to the local area network of the port for storage. The processing module is used to preprocess the raw point cloud data to obtain point cloud recognition data, wherein the preprocessing includes at least one of the following: filtering and parsing; The image building module is used to perform plane fitting on the point cloud recognition data using a preset plane fitting algorithm to obtain a three-dimensional image of the box. The image building module is also used to obtain the number of point clouds based on the point cloud recognition data; The image building module is also used to obtain the total number of interior points corresponding to multiple iterations. Each iteration includes: obtaining three point clouds from the point cloud recognition data and constructing a plane based on the three point clouds; calculating the distance from each point cloud in the point cloud recognition data to the plane; and calculating the number of interior points to obtain the total number of interior points. The interior points are point clouds whose distance from the point cloud to the plane is less than a preset second threshold. The image building module is also used to determine whether the total number of interior points is greater than half of the number of point clouds; If the total number of interior points is greater than or equal to half of the number of point clouds, the image building module is further configured to obtain the three-dimensional image based on the plane and the point cloud recognition data; The processing module is further configured to obtain the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box body based on the three-dimensional image; the step of obtaining the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box body based on the three-dimensional image includes: establishing a three-dimensional rectangular coordinate system with a point in the three-dimensional image as the zero point; obtaining the coordinate information of the box body in the three-dimensional rectangular coordinate system based on the three-dimensional image and the three-dimensional rectangular coordinate system; and obtaining the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box body based on the coordinate information. The judgment module is used to determine the bulging condition of the box body based on the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box body; The judgment module is specifically used to input the maximum protrusion distance, protrusion area, and protrusion volume parameters of the box into the decision tree, and the decision tree gives the recognition result; wherein, the decision tree includes std, gini, samples, and value, std refers to the index used for classification, gini refers to the Gini coefficient which reflects the purity of classification of each node in the decision tree, samples refers to the number of samples in the node, and value refers to the number of non-bulging, slightly bulging, and bulging. Based on the identification results, the detection results are given according to the number of boxes and the load conditions; the load conditions include single box, front box and rear box; the detection results include normal, minor and severe. Alternatively, the judgment module is specifically used to determine whether the maximum protrusion distance is greater than a preset first threshold. If the maximum protrusion distance is greater than the preset first threshold, then the box is determined to be a bulging box.