A high-precision detection method and system for container bulging based on laser point cloud
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SEA BUTTERFLY (TIANJIN) TECH CO LTD
- Filing Date
- 2026-06-03
- Publication Date
- 2026-08-07
AI Technical Summary
这种变形会削弱箱体强度,影响堆码稳定性,甚至导致货物损坏或运输安全事故
本发明提供的加权最小二乘平面拟合方法,通过权重函数自动抑制鼓胀点、离群点对基准面拟合的影响,避免基准面被拉偏;迭代优化过程不断修正权重分布,使最终平面模型更接近真实原始箱壁;不依赖特定形状或尺寸的集装箱,对不同规格箱体均具有良好的适应性;基于特征值分解的解析求解方法,数值稳定性好,适合工程化部署。
Smart Images

Figure CN122530176A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and intelligent inspection technology, and in particular to a high-precision detection method and system for container bulging based on laser point clouds. Background Technology
[0002] During transportation, container walls are prone to non-linear, localized bulging or denting deformations, or bulging phenomena, due to factors such as uneven cargo loading, external compression, or changes in internal pressure. This deformation weakens the container's strength, affects stacking stability, and can even lead to cargo damage or transportation safety accidents.
[0003] In traditional methods for detecting container bulges based on laser point clouds, a reference plane for the container wall is typically constructed using global plane fitting or fixed-window least squares plane fitting, for example, by solving a global plane equation using RANSAC or standard least squares. However, when there is significant bulging deformation on the container wall, the points in the bulging area are treated as ordinary sample points in the global fitting, which systematically pulls on the plane parameters, causing the fitted reference plane to deviate from the true original container wall surface. This results in an underestimation of the bulge amount or a positional shift. Furthermore, container walls are not absolutely flat; they exhibit slight, low-frequency curvature caused by stiffeners, sheet springback, and welding stress. Global plane models cannot represent these characteristics, easily confusing normal structural errors with pathological bulges. Simultaneously, at the edges of the container wall and near welds, laser point clouds often exhibit occlusion, sparseness, or abrupt changes. Traditional methods have poor fitting stability in these areas, easily resulting in large residuals, leading to missed detections or false alarms for edge bulges. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a high-precision detection method and system for container bulging based on laser point clouds, which solves the problems existing in the prior art.
[0005] This invention provides a high-precision detection method for container bulging based on laser point clouds, the method comprising the following steps: S1: Collect point cloud data of the container to be inspected; S2: Perform data preprocessing operations on the point cloud data; S3: Construct an adaptive local box wall reference surface based on the preprocessed point cloud data; Specifically, S3 is: S3.1: Define a sliding window and extract the set of points falling within the sliding window based on the preprocessed point cloud data; S3.2: Based on the point set within the sliding window, perform local normal estimation and consistency measurement to obtain the unit normal vector, the local average normal vector, and the normal deviation angle; S3.3: Within each of the aforementioned sliding windows, a local box wall reference surface is constructed using an iterative weighted least squares method; S4: Calculate the bulging field based on the adaptive local box wall reference surface; S5: Achieve high-precision detection of container bulging based on the bulging field.
[0006] Preferably, in step S3.1, the side length L of the sliding window is selected in the range of 200mm-400mm, and the sliding window slides along the main direction of the container wall with a step size s, where s is L / 2. At each window position, a set of points falling into the sliding window is extracted.
[0007] Preferably, in S3.2, for any point p i Construct a local neighborhood set of points around it. The k-nearest neighbor method is used to realize the local neighborhood point set. Specifically, using the point cloud as the query center, the k points within the sliding window that are closest to it in Euclidean distance are searched to form a local neighborhood point set. The expression for the local neighborhood point set is: In the formula, For point p i The k-th point closest to Euclidean distance.
[0008] Preferably, the value of k is related to the density of the scanned point cloud, and the range is 15≤k≤30.
[0009] Preferably, after obtaining the local neighborhood point set Then, point p is estimated through principal component analysis. i Unit normal vector at the location Specifically: Calculate the local neighborhood point set center of mass The expression is: .
[0010] Based on the local neighborhood point set center of mass Construct the local neighborhood point set covariance matrix The expression is: .
[0011] For the local neighborhood point set covariance matrix Perform eigenvalue decomposition; The eigenvalue decomposition expression is: In the formula, Let m be the m-th eigenvector. It is the corresponding m-th eigenvalue; where the eigenvalue satisfies: , , Corresponding to the local tangent plane direction, The degree of dispersion in the corresponding normal direction; Take the smallest eigenvalue corresponding unit eigenvector As point p i The initial normal vector is expressed as: ; Uniform orientation is performed at the window level, using the normal vector of the first point within the sliding window as a reference. If the dot product of the normal vector of a point and the reference vector is negative, then the dot is inverted. The expression is: ; Finally, we obtain point p. i unit normal vector ; Then, the local average normal vector of the sliding window is calculated as a representative of the geometric orientation of the local region; let the set of points within the current sliding window W be... If the number of points is M, then the local average normal vector is... Defined as: .
[0012] The result is then normalized, and the expression is: ; Point p i normal deviation angle θ i Defined as the unit normal vector at that point With local average normal vector The angle between them is expressed as: .
[0013] Preferably, in step S3.3, initial weights are set. and the maximum number of iterations ; Each iteration process is as follows: Let the local point set within the current sliding window be... for: , where M is the number of points within the current sliding window; Define a planar model Π in three-dimensional space, whose implicit equations are: And add a unit normal constraint: Where A, B, and C are the components of the plane normal vector; D is the distance parameter from the plane to the origin. Introducing weighting coefficients Construct the following weighted least squares objective function, with the expression: ; In the formula, The objective function is the weighted least squares function. Let be the weight of the i-th point, where is the weight. The calculation formula is: ; In the formula, d i For point p i The distance to the current planar model, θ i For point p i normal deviation angle θ i , σ d This is the distance weight decay coefficient; Given fixed weights, the weighted least squares objective function Minimization is achieved by constructing a weighted covariance matrix, i.e., the weighted least squares objective function. The analytical solution process is as follows: Calculate the local point set weighted center of mass ; Among them, the weighted centroid coordinates , , The expressions are as follows: ; ; ; In the formula, , , These are the coordinates of the centroid. Construct a weighted covariance matrix based on the weighted centroids; Specifically: Define decentralized coordinates; , , Then construct the weighted covariance matrix. The expression is: ; Solve for the plane normal vector of the weighted covariance matrix; Specifically, this involves: the weighted covariance matrix... Perform eigenvalue decomposition and take the unit eigenvector corresponding to the smallest eigenvalue as the plane normal vector (A, B, C). Let the eigenvector corresponding to the smallest eigenvalue be... ,but, ; Using the constraint that the plane passes through the weighted centroid, the distance parameter D from the plane to the coordinate origin is calculated using the following formula: Thus, the local planar model parameters for the current iteration are obtained. For the t-th iteration, based on the previous planar model Calculate the perpendicular distance from each point to the current iterative planar model. Calculate the new weights according to the weight calculation formula. The new plane parameters are solved using the weighted least squares method. ; Iteration stops when the angle between the plane normals in two consecutive iterations is less than a set threshold (e.g., 0.1°) or when the maximum number of iterations is reached. The final output plane model is shown. This is the adaptive local box wall reference plane corresponding to the sliding window.
[0014] Preferably, in step S5, a bulging field threshold is set. The bulging field The value is greater than the bulging field threshold. Points are marked as potential bulge points, a binary mask is generated, and morphological opening operations are used to remove isolated noise points from the potential bulge points to form bulge regions. Then, closing operations are used to fill the voids inside the bulge regions. Finally, connected components with an area greater than S are extracted. min The area is used as the final bulging area.
[0015] Preferably, in step S1, a three-dimensional laser scanner is used to collect point cloud data of the container to be inspected; the three-dimensional laser scanner should have the following performance indicators: single-point ranging accuracy not less than ±1.0mm; angular resolution not greater than 0.001°; scanning rate not less than 500,000 points / second.
[0016] Preferably, for standard 20ft or 40ft dry cargo containers, a symmetrical scanning method is adopted, with a total of 2–4 scanning stations; the scanning field of view of a single station is set as follows: 360° horizontally; vertically… 30° to +60°; horizontal angular resolution set to ≤0.05°; vertical angular resolution set to ≤0.05°.
[0017] According to another aspect of the present invention, a high-precision detection system for container bulging based on laser point clouds is provided. The system employs the aforementioned high-precision detection method for container bulging based on laser point clouds, and the system includes: The point cloud acquisition module is used to acquire point cloud data from the containers to be inspected. The point cloud preprocessing module is used to perform data preprocessing operations on the point cloud data; The reference surface construction module is used to construct an adaptive local box wall reference surface based on the preprocessed point cloud data. The bulging field calculation module is used to calculate the bulging field based on the adaptive local box wall reference surface; The detection module is used to achieve high-precision detection of container bulging based on the bulging field.
[0018] The embodiments of the present invention have the following technical effects: The weighted least squares plane fitting method provided by this invention automatically suppresses the influence of bulge points and outliers on the fitting of the reference plane through a weight function, avoiding the reference plane from being skewed; the iterative optimization process continuously corrects the weight distribution, making the final plane model closer to the real original container wall; it does not depend on containers of specific shapes or sizes, and has good adaptability to containers of different specifications; the analytical solution method based on eigenvalue decomposition has good numerical stability and is suitable for engineering deployment.
[0019] The local normal estimation and consistency measurement method provided by this invention can accurately characterize the microscopic geometric orientation of container walls at the point cloud level; it provides reliable normal consistency weights for weighted least squares plane fitting, effectively suppressing the interference of bulge points, outliers, and noise points on the construction of the reference surface; it has good robustness to normal structures such as surface textures and reinforcing ribs of the container wall, avoiding misjudging them as bulge anomalies; the calculation process is entirely based on local geometric relationships, requiring no manual intervention or prior models, and is suitable for automated processing of large-scale point cloud data. Attached Figure Description
[0020] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 This is a flowchart of a high-precision detection method for container bulging based on laser point clouds provided in an embodiment of the present invention; Figure 2 This is a flowchart of constructing an adaptive local box wall reference surface based on preprocessed point cloud data, provided by an embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0023] Example 1, Figure 1 A flowchart of a high-precision detection method for container bulging based on laser point clouds is shown, as follows: Figure 1 As shown, a high-precision detection method for container bulging based on laser point clouds includes the following steps: S1: Collect point cloud data of the container to be inspected; In this step, a 3D laser scanner is used to collect point cloud data of the container to be inspected. The 3D laser scanner should have the following performance indicators: single-point ranging accuracy not less than ±1.0mm; angular resolution not greater than 0.001°; scanning rate not less than 500,000 points / second.
[0024] For standard 20ft or 40ft dry cargo containers, a double-sided symmetrical scanning method is preferred, with a total of 2–4 scanning stations; the scanning field of view of a single station is set to 360° in the horizontal direction. vertical direction The angle should be between +30° and +60° to ensure complete coverage of the container's sidewalls, top, and bottom edges; the horizontal angular resolution should be set to ≤0.05°; the vertical angular resolution should be set to ≤0.05°.
[0025] Furthermore, for 20ft containers, one station is set on each side of the central axis along the length of the container; for 40ft containers, two to three stations are set at the front, middle and rear sections of the container to ensure uniform point cloud density on the long-distance container surface.
[0026] The horizontal distance between the optical center of the 3D laser scanner and the wall of the test chamber is controlled within the range of 3.0m–5.0m; the optical axis of the 3D laser scanner is basically perpendicular to the outer surface of the chamber wall, with a deviation angle not exceeding ±5°; on the surface of the chamber at a distance of 4m from the 3D laser scanner, the point cloud projection density is not less than 10 points / cm², so as to ensure the reliability of subsequent local surface fitting.
[0027] S2: Perform data preprocessing operations on the point cloud data; The data preprocessing includes multi-site point cloud registration and fusion, statistical filtering for noise reduction, and voxel grid downsampling.
[0028] Because a multi-site scanning method is used, it is necessary to spatially unify the point cloud data acquired from different sites to form a complete container point cloud model. The multi-site point cloud registration and fusion specifically involves: arranging at least three high-reflectivity target spheres of known radius at the scanning site; identifying the center coordinates of the target spheres in the scanning data from each site; solving for the rigid body transformation matrix between sites using the least squares method; and based on the rigid body transformation matrix, transforming all site point clouds to the same reference coordinate system to finally obtain globally unified preliminary point cloud data.
[0029] The statistical filtering denoising specifically involves: for each point in the initial point cloud data, counting the number of neighboring points k in a spherical shape with radius r. i Calculate the mean number of neighborhood points of all points. k With standard deviation σ k ;like If m is the weighting coefficient, then the point is determined to be an outlier noise point and is removed. This step can effectively remove random noise points caused by laser scattering and dust reflection.
[0030] The voxel mesh downsampling specifically involves: constructing a side length L... v A three-dimensional voxel mesh is constructed; within each non-empty voxel, the average value of all point coordinates is calculated as the representative point of that voxel, thereby achieving voxel mesh downsampling. Through the above downsampling, the data size is significantly reduced while maintaining the macroscopic geometric features of the container, which is conducive to the efficient operation of subsequent algorithms.
[0031] S3: Construct an adaptive local box wall reference surface based on the preprocessed point cloud data; In traditional methods for detecting container bulges based on laser point clouds, a reference plane for the container wall is typically constructed using global plane fitting or fixed-window least squares plane fitting, for example, by solving a global plane equation using RANSAC or standard least squares. However, when there is significant bulging deformation on the container wall, the points in the bulging area are treated as ordinary sample points in the global fitting, which systematically pulls on the plane parameters, causing the fitted reference plane to deviate from the true original container wall surface. This results in an underestimation of the bulge amount or a positional shift. Furthermore, container walls are not absolutely flat; they exhibit slight, low-frequency curvature caused by stiffeners, sheet springback, and welding stress. Global plane models cannot represent these characteristics, easily confusing normal structural errors with pathological bulges. Simultaneously, at the edges of the container wall and near welds, laser point clouds often exhibit occlusion, sparseness, or abrupt changes. Traditional methods have poor fitting stability in these areas, easily resulting in large residuals, leading to missed detections or false alarms for edge bulges.
[0032] Based on this, this embodiment provides an adaptive local box wall reference surface construction method based on sliding window and weighted least squares to eliminate the interference of bulging points on reference surface modeling and improve the accuracy and robustness of bulging detection. Specifically, as Figure 2 As shown, S3 specifically includes: S3.1: Define a sliding window and extract the set of points falling within the sliding window based on the preprocessed point cloud data; The side length L of the sliding window is selected in the range of 200mm-400mm, preferably 300mm. The sliding window slides along the main direction of the container wall with a step size s. In this embodiment, s is taken as L / 2 to achieve overlap and smooth transition between adjacent windows. At each window position, the set of points falling into the sliding window is extracted.
[0033] S3.2: Based on the point set within the sliding window, perform local normal estimation and consistency measurement to obtain the unit normal vector, the local average normal vector, and the normal deviation angle; In the process of constructing the adaptive local box wall reference plane, accurately estimating the local point cloud normal vector and quantifying its consistency with the local geometry is a prerequisite for achieving weighted least squares plane fitting.
[0034] For any point p i Construct a local neighborhood set of points around it. To characterize the geometric properties of the small planes near the point, this step preferably uses the k-nearest neighbor method to select the neighborhood. Specifically, using the point cloud as the query center, the k points with the closest Euclidean distance to the point in the sliding window are searched to form a local neighborhood point set. The expression for the local neighborhood point set is: In the formula, For point p i The k-th point closest to Euclidean distance.
[0035] Furthermore, the value of k is related to the density of the scanned point cloud, and the recommended range is 15≤k≤30; In this embodiment, with a scanning density of 10 points / cm², k=20 is preferred.
[0036] In obtaining the local neighborhood point set Then, point p is estimated using principal component analysis (PCA). i Unit normal vector at the location Specifically: Calculate the local neighborhood point set center of mass The expression is: .
[0037] Based on the local neighborhood point set center of mass Construct the local neighborhood point set covariance matrix The expression is: .
[0038] For the local neighborhood point set covariance matrix Perform eigenvalue decomposition; The eigenvalue decomposition expression is: In the formula, Let m be the m-th eigenvector. It is the corresponding m-th eigenvalue; where the eigenvalue satisfies: , , Corresponding to the local tangent plane direction, The degree of dispersion in the corresponding normal direction.
[0039] Take the smallest eigenvalue corresponding unit eigenvector As point p i The initial normal vector is expressed as: .
[0040] To avoid the problem of opposite directions of normal vectors in different local regions, a unified orientation is performed at the window level. The normal vector of the first point within the sliding window is used as a reference. If the dot product of the normal vector of a point and the reference vector is negative, then the orientation is inverted. The expression is as follows: ; Finally, we obtain point p. i unit normal vector .
[0041] Based on the above steps, the normal vectors of all points within the sliding window are estimated, and then the local average normal vector of the sliding window is calculated as a representative of the geometric orientation of the local region.
[0042] Let the set of points within the current sliding window W be... If the number of points is M, then the local average normal vector is... Defined as: .
[0043] The result is then normalized, and the expression is: .
[0044] The average normal vector reflects the orientation of the mainstream or undisturbed box wall within the current sliding window, and is an important reference benchmark for judging whether there are anomalies at individual points.
[0045] To quantify the consistency between the normal vector of a single point and the local-to-global geometry, this embodiment introduces the normal deviation angle as a metric. The normal deviation angle is defined as: point p i normal deviation angle θ i Defined as the unit normal vector at that point With local average normal vector The angle between them is expressed as: .
[0046] In the flat or slightly curved areas of the container wall, the unit normal vector changes gradually at each point, θ i Generally small; in areas of container bulge, dent, crease, or localized damage, the unit normal vector will deflect significantly, θ i Significantly increased; at noisy or outlier points, the unit normal vector estimate is unstable, θ i It also tends to a larger value; therefore, θ i It can be used as the core input parameter for the normal consistency weight in subsequent weighted least squares plane fitting.
[0047] Through the aforementioned local normal estimation and consistency measurement, this embodiment can accurately characterize the microscopic geometric orientation of the container wall at the point cloud level; it provides reliable normal consistency weights for weighted least squares plane fitting, effectively suppressing the interference of bulge points, outliers, and noise points on the construction of the reference surface; it has good robustness to normal structures such as surface textures and reinforcing ribs of the container wall, avoiding misjudging them as bulge anomalies; the calculation process is entirely based on local geometric relationships, requiring no manual intervention or prior models, and is suitable for automated processing of large-scale point cloud data.
[0048] S3.3: Within each of the aforementioned sliding windows, a local box wall reference surface is constructed using an iterative weighted least squares method; Set initial weights and the maximum number of iterations ; Each iteration process is as follows: Let the local point set within the current sliding window be... for: , where M is the number of points within the current sliding window.
[0049] Define a planar model Π in three-dimensional space, whose implicit equations are: And add a unit normal constraint: , where A, B, and C are the components of the plane normal vector; D is the distance parameter from the plane to the origin.
[0050] To suppress the interference of bulging points, outliers, and noise points on plane fitting, this invention introduces weighting coefficients. Construct the following weighted least squares objective function, with the expression: ; In the formula, The objective function is the weighted least squares function. The weight of the i-th point is denoted by the distance d from that point to the current planar model. i and its normal deviation angle θ i A joint decision.
[0051] Among them, weight The calculation formula is: ; In the formula, d i For point p i The distance to the current planar model, θ i For point p i normal deviation angle θ i , σ d σθ is the distance weight attenuation coefficient, and in this embodiment, a value of 8mm–15mm is recommended; σθ is the normal weight attenuation coefficient, and in this embodiment, a value of 10°–20° is recommended.
[0052] Given fixed weights, the weighted least squares objective function Minimization is achieved by constructing a weighted covariance matrix, i.e., the weighted least squares objective function. The analytical solution process is as follows: Calculate the local point set weighted center of mass ; Among them, the weighted centroid coordinates , , The expressions are as follows: ; ; ; In the formula, , , These are the coordinates of the centroid.
[0053] Construct a weighted covariance matrix based on the weighted centroids; Specifically: Define decentralized coordinates; , , Then construct the weighted covariance matrix. The expression is: ; Solve for the plane normal vector of the weighted covariance matrix; Specifically, this involves: the weighted covariance matrix... Perform eigenvalue decomposition and take the unit eigenvector corresponding to the smallest eigenvalue as the plane normal vector (A, B, C). Let the eigenvector corresponding to the smallest eigenvalue be... ,but, .
[0054] Using the constraint that the plane passes through the weighted centroid, the distance parameter D from the plane to the coordinate origin is calculated using the following formula: Thus, the local planar model parameters for the current iteration are obtained.
[0055] For the t-th iteration, based on the previous planar model Calculate the perpendicular distance from each point to the current iterative planar model. Calculate the new weights according to the weight calculation formula. The new plane parameters are solved using the weighted least squares method. .
[0056] Iteration stops when the angle between the plane normals in two consecutive iterations is less than a set threshold (e.g., 0.1°) or when the maximum number of iterations is reached. The final output plane model is shown. This is the adaptive local box wall reference plane corresponding to the sliding window.
[0057] The weighted least squares plane fitting method disclosed in this embodiment has the following technical advantages: it automatically suppresses the influence of bulge points and outliers on the fitting of the reference plane by using a weight function, thus avoiding the reference plane being skewed; the iterative optimization process continuously corrects the weight distribution, making the final plane model closer to the real original container wall; it is not dependent on containers of specific shapes or sizes, and has good adaptability to containers of different specifications; the analytical solution method based on eigenvalue decomposition has good numerical stability and is suitable for engineering deployment.
[0058] S4: Calculate the bulging field based on the adaptive local box wall reference surface; For each point p in the preprocessed box wall point cloud data, calculate its signed distance relative to the adaptive local box wall reference plane to form the bulging field. ; The calculation formula is: ; In the formula, x, y, and z are the coordinates of point p. , and These are the normal vector components of the local plane, which determine the orientation of the plane. This is a constant term in the plane equation, controlling the plane's position in space. Together with the normal vector, it determines the distance and direction of the plane from the origin.
[0059] S5: Achieve high-precision detection of container bulging based on the bulging field; Set the bulging field threshold The bulging field The value is greater than the bulging field threshold. Points are marked as potential bulge points, a binary mask is generated, and morphological opening operations are used to remove isolated noise points from the potential bulge points to form bulge regions. Then, closing operations are used to fill the voids inside the bulge regions. Finally, connected components with an area greater than S are extracted. min The area is used as the final bulging area.
[0060] Furthermore, the bulging field threshold The value is 3mm, and the S min 100cm 2 .
[0061] Example 2: This invention also provides a high-precision container bulge detection system based on laser point clouds. The system employs a high-precision container bulge detection method based on laser point clouds from Example 1. The system includes: The point cloud acquisition module is used to acquire point cloud data from the containers to be inspected. The point cloud preprocessing module is used to perform data preprocessing operations on the point cloud data; The reference surface construction module is used to construct an adaptive local box wall reference surface based on the preprocessed point cloud data. The bulging field calculation module is used to calculate the bulging field based on the adaptive local box wall reference surface; The detection module is used to achieve high-precision detection of container bulging based on the bulging field.
[0062] Example 3: The present invention also provides an electronic device, including one or more processors and a memory.
[0063] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.
[0064] The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and a processor may execute the program instructions to implement the high-precision detection method for container bulging based on laser point clouds described in any embodiment of this application above, and / or other desired functions. Various contents such as initial extrinsic parameters and thresholds may also be stored in the computer-readable storage medium.
[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention 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 or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.
Claims
1. A high-precision detection method for container bulging based on laser point clouds, characterized in that, The method includes the following steps: S1: Collect point cloud data of the container to be inspected; S2: Perform data preprocessing operations on the point cloud data; S3: Construct an adaptive local box wall reference surface based on the preprocessed point cloud data; Specifically, S3 is: S3.1: Define a sliding window and extract the set of points falling within the sliding window based on the preprocessed point cloud data; S3.2: Based on the point set within the sliding window, perform local normal estimation and consistency measurement to obtain the unit normal vector, the local average normal vector, and the normal deviation angle; S3.3: Within each of the aforementioned sliding windows, a local box wall reference surface is constructed using an iterative weighted least squares method; S4: Calculate the bulging field based on the adaptive local box wall reference surface; S5: Achieve high-precision detection of container bulging based on the bulging field.
2. The high-precision detection method for container bulging based on laser point clouds according to claim 1, characterized in that, In step S3.1, the side length L of the sliding window is selected in the range of 200mm-400mm. The sliding window slides along the main direction of the container wall with a step size s, where s is L / 2. At each window position, the set of points falling into the sliding window is extracted.
3. The high-precision detection method for container bulging based on laser point clouds according to claim 2, characterized in that, In S3.2, for any point p i Construct a local neighborhood set of points around it. The k-nearest neighbor method is used to realize the local neighborhood point set. Specifically, using the point cloud as the query center, the k points within the sliding window that are closest to it in Euclidean distance are searched to form a local neighborhood point set. The expression for the local neighborhood point set is: In the formula, For point p i The k-th point closest to Euclidean distance.
4. The high-precision detection method for container bulging based on laser point clouds according to claim 3, characterized in that, The value of k is related to the density of the scanned point cloud, and its range is 15≤k≤30.
5. The high-precision detection method for container bulging based on laser point clouds according to claim 3, characterized in that, In obtaining the local neighborhood point set Then, point p is estimated through principal component analysis. i Unit normal vector at the location Specifically: Calculate the local neighborhood point set center of mass The expression is: ; Based on the local neighborhood point set center of mass Construct the local neighborhood point set covariance matrix The expression is: ; For the local neighborhood point set covariance matrix Perform eigenvalue decomposition; The eigenvalue decomposition expression is: In the formula, Let m be the m-th eigenvector. It is the corresponding m-th eigenvalue; where the eigenvalue satisfies: , , Corresponding to the local tangent plane direction, The degree of dispersion in the corresponding normal direction; Take the smallest eigenvalue corresponding unit eigenvector As point p i The initial normal vector is expressed as: ; Uniform orientation is performed at the window level, using the normal vector of the first point within the sliding window as a reference. If the dot product of the normal vector of a point and the reference vector is negative, then the dot is inverted. The expression is: ; Finally, we obtain point p. i unit normal vector ; Then, the local average normal vector of the sliding window is calculated as a representative of the geometric orientation of the local region; let the set of points within the current sliding window W be... If the number of points is M, then the local average normal vector is... Defined as: ; The result is then normalized, and the expression is: ; Point p i normal deviation angle θ i Defined as the unit normal vector at that point With local average normal vector The angle between them is expressed as: 。 6. The high-precision detection method for container bulging based on laser point clouds according to claim 1, characterized in that, In step S3.3, initial weights are set. and the maximum number of iterations ; Each iteration process is as follows: Let the local point set within the current sliding window be... for: , where M is the number of points within the current sliding window; Define a planar model Π in three-dimensional space, whose implicit equations are: And add a unit normal constraint: Where A, B, and C are the components of the plane normal vector; D is the distance parameter from the plane to the origin. Introducing weighting coefficients Construct the following weighted least squares objective function, with the expression: ; In the formula, The objective function is the weighted least squares function. Let be the weight of the i-th point, where is the weight. The calculation formula is: ; In the formula, d i For point p i The distance to the current planar model, θ i For point p i normal deviation angle θ i , σ d This is the distance weight decay coefficient; Given fixed weights, the weighted least squares objective function Minimization is achieved by constructing a weighted covariance matrix, i.e., the weighted least squares objective function. The analytical solution process is as follows: Calculate the local point set weighted center of mass ; Among them, the weighted centroid coordinates , , The expressions are as follows: ; ; ; In the formula, , , These are the coordinates of the centroid. Construct a weighted covariance matrix based on the weighted centroids; Specifically: Define decentralized coordinates; , , Then construct the weighted covariance matrix. The expression is: ; Solve for the plane normal vector of the weighted covariance matrix; Specifically, this involves: the weighted covariance matrix... Perform eigenvalue decomposition and take the unit eigenvector corresponding to the smallest eigenvalue as the plane normal vector (A, B, C). Let the eigenvector corresponding to the smallest eigenvalue be... ,but, ; Using the constraint that the plane passes through the weighted centroid, the distance parameter D from the plane to the coordinate origin is calculated using the following formula: Thus, the local planar model parameters for the current iteration are obtained. For the t-th iteration, based on the previous planar model Calculate the perpendicular distance from each point to the current iterative planar model. Calculate the new weights according to the weight calculation formula. The new plane parameters are solved using the weighted least squares method. ; Iteration stops when the angle between the plane normals in two consecutive iterations is less than a set threshold (e.g., 0.1°) or when the maximum number of iterations is reached. The final output plane model is shown. This is the adaptive local box wall reference plane corresponding to the sliding window.
7. The high-precision detection method for container bulging based on laser point clouds according to claim 1, characterized in that, In step S5, a bulging field threshold is set. The bulging field The value is greater than the bulging field threshold. Points are marked as potential bulge points, a binary mask is generated, and morphological opening operations are used to remove isolated noise points from the potential bulge points to form bulge regions. Then, closing operations are used to fill the voids inside the bulge regions. Finally, connected components with an area greater than S are extracted. min The area is used as the final bulging area.
8. The high-precision detection method for container bulging based on laser point clouds according to claim 1, characterized in that, In step S1, a three-dimensional laser scanner is used to collect point cloud data of the container to be inspected. The three-dimensional laser scanner should have the following performance indicators: single-point ranging accuracy not less than ±1.0mm; angular resolution not greater than 0.001°; scanning rate not less than 500,000 points / second.
9. A high-precision detection method for container bulging based on laser point clouds according to claim 8, characterized in that, For standard 20ft or 40ft dry cargo containers, a symmetrical scanning method is used, with a total of 2–4 scanning stations. The scanning field of view of a single station is set as follows: 360° horizontally and 360° vertically. 30° to +60°; horizontal angular resolution set to ≤0.05°; vertical angular resolution set to ≤0.05°.
10. A high-precision detection system for container bulging based on laser point clouds, characterized in that, The system employs a high-precision container bulging detection method based on laser point clouds as described in any one of claims 1-9, and the system comprises: The point cloud acquisition module is used to acquire point cloud data from the containers to be inspected. The point cloud preprocessing module is used to perform data preprocessing operations on the point cloud data; The reference surface construction module is used to construct an adaptive local box wall reference surface based on the preprocessed point cloud data. The bulging field calculation module is used to calculate the bulging field based on the adaptive local box wall reference surface; The detection module is used to achieve high-precision detection of container bulging based on the bulging field.