An intelligent detection and grading method for product packaging surface defects
By constructing a three-dimensional mesh model and calculating the curvature, combined with boundary curve features, the problem of automated detection and grading of surface defects in environmentally friendly pulp molded packaging was solved, achieving efficient defect identification and accurate quality grading.
Patent Information
- Application Number
- CN202510034889.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-01-09
AI Technical Summary
Traditional manual inspection of surface defects in environmentally friendly pulp molded packaging is inefficient, making it difficult to achieve automated and intelligent surface defect detection and grading, especially the identification and location of dents, protrusions, and burrs, and there is a lack of accurate quality grading methods.
By acquiring point cloud data of the surface of environmentally friendly pulp molded packaging, a three-dimensional mesh model is constructed, the Gaussian curvature and mean curvature of the mesh vertices are calculated, and the surface curvature distribution map is drawn. Defects are identified and quantified, and burr defects are detected by combining the local shape characteristics of the boundary curve. The defects are then compared with the preset quality standards for grading.
It achieves comprehensive detection and precise quantification of surface defects in environmentally friendly pulp molded packaging, provides effective technical support for product quality control, and improves detection efficiency and grading accuracy.
Smart Images

Figure CN119963505B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a method for intelligently detecting and grading surface defects of product packaging. Background Art
[0002] In the quality control process of environmentally friendly pulp molded packaging, traditional manual inspection methods are inefficient and highly subjective, so it is crucial to achieve automated and intelligent surface defect detection and grading. How to construct the point cloud data of the pulp molded packaging surface into a three-dimensional mesh model that can accurately characterize the geometric morphology of the pulp molded packaging surface is a difficult problem to be solved. Furthermore, how to use the constructed three-dimensional mesh model to accurately identify and locate common defects such as depressions and protrusions on the surface of pulp molded packaging is also a difficult problem that needs to be solved. In addition, considering the impact of burr defects on the edge of pulp molded packaging on product quality, a solution is also needed for the detection of burr defects. Finally, how to quantitatively analyze the various defects identified and automatically grade the quality of pulp molded packaging according to preset quality standards is the ultimate goal of this solution. Summary of the Invention
[0003] The present invention provides a method for intelligent detection and grading of product packaging surface defects, which mainly includes:
[0004] Obtaining discrete point cloud data of the surface of the environmentally friendly pulp molded packaging, removing outliers and noise points from the point cloud data to obtain preprocessed point cloud data, and connecting the discrete point clouds through triangular facets based on the preprocessed point cloud data to generate an initial mesh model to form a three-dimensional mesh model representing the geometric morphology of the surface of the environmentally friendly pulp molded packaging;
[0005] By calculating the Gaussian curvature and mean curvature of the mesh vertices, a surface curvature distribution map is drawn. The defect information at each mesh vertex is determined based on the surface curvature distribution map, and the surface defect distribution information of the environmentally friendly pulp molded packaging is obtained.
[0006] Extract the boundary curves of the 3D mesh model and analyze the local shape features of the boundary curves. If the local shape features of a boundary curve deviate from the typical shape of the preset normal boundary, it indicates that a burr defect exists at that location. The burr defect is added to the surface defect distribution information.
[0007] For the local defects such as depressions, protrusions and burrs in the surface defect distribution information, the defect area, defect depth and defect length of the local defect area are quantified respectively to obtain the key quantitative parameters of each type of defect. The quantitative parameters are compared with the preset threshold values of the environmentally friendly pulp molded packaging quality standards. Those exceeding the threshold range are judged as unqualified.
[0008] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:
[0009] The present invention discloses a method for detecting and grading the quality of environmentally friendly pulp molded packaging. The method first obtains point cloud data of the packaging surface through optical scanning, and constructs a three-dimensional model through filtering and gridding. Then, by calculating the curvature distribution of the grid vertices, surface defects such as protrusions and depressions are identified. At the same time, the local shape characteristics of the boundary curve are analyzed to detect burr defects. For each type of defect detected, its key parameters such as area, depth, and length are further quantified and compared with preset quality standards to achieve accurate quality grading of environmentally friendly pulp molded packaging. By integrating technologies such as three-dimensional reconstruction, curvature analysis, and boundary feature extraction, the present invention achieves comprehensive detection and precise quantification of surface defects of environmentally friendly pulp molded packaging, providing effective technical support for product quality control. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 The present invention is a flowchart of a method for intelligent detection and grading of product packaging surface defects. DETAILED DESCRIPTION
[0011] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments derived by those skilled in the art based on the embodiments in this specification without creative effort shall fall within the scope of protection of this specification.
[0012] like Figure 1 In this embodiment, a method for intelligently detecting and grading product packaging surface defects may specifically include:
[0013] S101. Obtain discrete point cloud data of the surface of the environmentally friendly pulp molded packaging, remove outliers and noise points in the point cloud data, and obtain preprocessed point cloud data. Based on the preprocessed point cloud data, connect the discrete point cloud through triangular facets to generate an initial mesh model to form a three-dimensional mesh model that represents the geometric morphology of the surface of the environmentally friendly pulp molded packaging.
[0014] The three-dimensional coordinates of reflective marking points on the surface of environmentally friendly pulp molded packaging are obtained, and the reflective marking points are evenly arranged along the packaging surface; according to the three-dimensional coordinates of the marking points, scanning data from different perspectives are aligned to obtain a first set of point cloud data, and the scanning data from different perspectives are aligned using a least squares registration algorithm; a spherical neighborhood search is performed on the first set of point cloud data to obtain a second set of point cloud data, and the spherical neighborhood search eliminates abnormal points through dual constraints of Euclidean distance threshold and local curvature variance threshold; local curvature values are calculated based on the second set of point cloud data to perform regional partitioning, and the regional partitioning uses the Poisson reconstruction method to generate a triangular patch model, and the normal vector of the triangular patch model is consistent with the local curvature direction.
[0015] Specifically, reflective markers were evenly arranged on the surface of the environmentally friendly pulp molded packaging, with the spacing between the markers set to one-tenth of the maximum dimension of the packaging surface. A visual positioning algorithm was used to record the three-dimensional coordinates of each marker. The optical scanner acquisition parameters were adjusted based on scanning accuracy and sampling spacing. The surface of the environmentally friendly pulp molded packaging was scanned three times at different viewing angles, with the overlapped field of view of each scan maintaining one-third of the total area. A least-squares registration algorithm was used to align the reflective marker coordinates to obtain the first set of point cloud data. For the first set of point cloud data, a search radius was set to three times the average point cloud spacing. A spherical neighborhood search was used to identify outliers with fewer than a threshold number of surrounding points. These outliers were then eliminated using the dual constraints of the Euclidean distance threshold and the local curvature variance threshold, resulting in the second set of point cloud data. The second set of point cloud data was smoothed using a Gaussian filter with a kernel size set to twice the average point cloud spacing and a weight factor that decayed exponentially with distance, resulting in the third set of point cloud data. Based on the third set of point cloud data, the local curvature of each point is calculated. The degree of curvature variation of the point cloud is determined by the ratio of the eigenvalues of the covariance matrix. A region growing algorithm is then used to cluster points with similar curvature into groups, forming curvature partitions. Meshing parameters are set based on the curvature partitions. If the average curvature of a region exceeds a preset threshold, the mesh edge length is set to twice the average point cloud spacing; otherwise, it is set to twice the average. Linear interpolation is used at the boundaries of adjacent partitions to ensure smooth transitions in mesh size. An oriented bounding box algorithm is used to determine the principal direction of the point cloud, along which a local coordinate system is established. Within each mesh, a Poisson reconstruction method is used to generate triangular facets, with the facet normals aligned with the local curvature direction. When placing reflective markers on the surface of environmentally friendly pulp molded packaging, circular markers with a diameter of 2 mm are made from a specialized reflective material and affixed to the packaging surface via a spray coating process. The marker spacing is dynamically adjusted based on the packaging size. For a 200 mm × 150 mm packaging surface, the marker spacing is set to 20 mm to ensure sufficient markers are captured from all viewing angles during subsequent scanning. When performing multi-view scanning, the optical scanner maintained a scanning accuracy of 0.05 mm, a sampling interval of 0.1 mm, and scanning angles of 0, 120, and 240 degrees, ensuring sufficient feature points in the overlapping regions of the scanned data for registration. A least-squares registration algorithm was used for coarse registration using reflective markers as a reference. The iterative optimization process was terminated when the registration error was less than 0.1 mm. During the point cloud outlier identification phase, the radius of the spherical neighborhood search was set to 0.3 mm. Points with fewer than 10 neighboring points were marked as potential outliers. These potential outliers were further screened by calculating their Euclidean distance to neighboring points. Points with a distance greater than 0.5 mm and a local curvature variance exceeding 0.8 were ultimately identified as outliers and removed. A Gaussian filter with a kernel size of 0.2 mm and a weight factor that decayed exponentially with distance, with a coefficient of 2, was used to smooth the retained point cloud data.By calculating the local curvature of each point, the covariance matrix is calculated for points within a spherical neighborhood with a radius of 0.4 mm. Regions with a matrix eigenvalue ratio greater than 4 are identified as areas of high curvature variation. During meshing, the mesh edge length is set to 0.1 mm for regions with an average curvature greater than 0.5, and 0.2 mm for regions with an average curvature less than 0.5. Linear interpolation is used to achieve a gradual transition in mesh size at the boundaries between adjacent partitions, with an interpolation region width of 0.5 mm. Finally, in the oriented bounding box algorithm, the principal directions are determined by calculating the eigenvectors of the point cloud covariance matrix. After establishing a local coordinate system, Poisson reconstruction is performed, with the angle between the normal vector of the triangle and the local curvature direction being controlled within 15 degrees. For packaging products with multiple concave and convex structures on the surface, such as the inner lining of electronic products, the local curvature can exceed 2 in the concave-convex transition area with drastic curvature changes. In this case, the mesh edge length is adaptively adjusted to 0.05 mm to ensure accurate reconstruction of detailed features. In the relatively flat bottom area, the curvature is close to 0 and the grid side length can be relaxed to 0.4 mm, which not only ensures the reconstruction accuracy but also improves the computational efficiency.
[0016] Obtain the initial grid model to be processed, determine the target encryption granularity and refinement level of the grid model according to preset business requirements, perform layered processing on the grid model, and encrypt and refine the initial grid model using encryption methods with preset corresponding strengths according to different levels.
[0017] The curvature value of the grid node is obtained by using the Gaussian curvature calculation formula according to the grid node coordinates, and the grid is divided into three levels of high curvature area, medium curvature area and low curvature area by the octree space division method to obtain the first grid unit; for the first grid unit, the ratio of the maximum side length to the minimum side length of adjacent units is calculated. If the side length ratio exceeds the preset threshold, a new node is inserted at the center of the unit with the larger side length to obtain the second grid unit; for the newly inserted node in the second grid unit, the local grid topological connection relationship is calculated, and the quadrilateral grid unit division method is used to establish the connection between the new node and the surrounding nodes to obtain the third grid unit; for the third grid unit, the grid is subdivided according to the encryption strength coefficient of the high curvature area, the encryption strength coefficient of the medium curvature area, and the encryption strength coefficient of the low curvature area, and gradient units are inserted between the different encryption strength areas to obtain refined grid units.
[0018] Specifically, the original mesh cell side lengths are calculated based on the target meshing accuracy. The Gaussian curvature calculation formula is used to obtain the mesh node curvature values. The mesh is then partitioned into three levels based on the curvature values: high, medium, and low curvature regions, using the octree spatial partitioning method. This results in the first-level mesh cells. For the first-level mesh cells, the side length uniformity metric is set as the ratio of the maximum to minimum side lengths of adjacent cells. If this ratio exceeds a preset threshold, a new node is inserted at the center of the cell with the larger side length. The coordinates of the new node are calculated using linear interpolation to obtain the second-level mesh cells. For each newly inserted node in the second-level mesh cells, its local mesh topological connectivity is calculated. A quadrilateral mesh cell partitioning method is used to establish connections between the new node and surrounding nodes, maintaining the integrity of the mesh topology. This results in the third-level mesh cells. Based on the node distribution of the third-level mesh cells, the angular deviation and area distortion within the cell are calculated. If the cell quality falls below the preset standard, the cell shape is adjusted using node coordinate optimization to obtain the fourth-level mesh cells. For the fourth-layer mesh cells, the mesh refinement coefficients were set to three for high-curvature areas, two for medium-curvature areas, and one for low-curvature areas. The mesh was then subdivided according to the different refinement intensities to create the fifth-layer mesh cells. Based on the boundary nodes of the fifth-layer mesh cells, a transitional region mesh generation algorithm was used to insert gradient cells between regions of varying refinement intensities. Gradual node density control was used to achieve a smooth transition and ultimately refine the mesh cells. In the meshing accuracy calculation, the average side length of the original mesh cells was 10 mm, which was then subdivided into finer meshes with 5 mm sides to meet the target accuracy requirements. When using Gaussian curvature calculations, a neighborhood with a radius of 15 mm around the node was selected. The principal curvature values were obtained by fitting a quadratic surface to the points within the neighborhood. Regions with curvature values greater than 0.5 were classified as high curvature regions, those between 0.2 and 0.5 as medium curvature regions, and those less than 0.2 as low curvature regions. To control edge length uniformity, a threshold of 1.5 is set for the ratio of the maximum to minimum edge lengths of adjacent cells. Mesh cells exceeding this threshold are locally encrypted. For example, a quadrilateral cell with four sides of 8 mm, 6 mm, 8 mm, and 6 mm, respectively, and a maximum-to-minimum edge length ratio of 1.33, does not require encryption if it falls below the threshold. However, a cell with sides of 9 mm, 5 mm, 9 mm, and 5 mm, with a maximum-to-minimum edge length ratio of 1.8, exceeds this threshold and requires the insertion of a new node at the cell center. During the grid topology connection process, a quadrilateral mesh connection is established for each newly inserted node by searching for existing nodes within a 20 mm radius. If a new node is surrounded by five existing nodes, four nodes are selected based on the minimum angle principle to connect to it, ensuring that the internal angles of the newly formed cell are all greater than 45 degrees. Mesh cell quality assessment uses a combination of angle and area weighting. Ideally, all four internal angles of a quadrilateral cell are 90 degrees. The greater the deviation of the actual cell's internal angles from 90 degrees, the lower the quality assessment score.At the same time, the ratio of the unit area to the ideal square unit area is calculated. A ratio that is too large or too small will reduce the quality assessment score. For example, the four internal angles of a unit are 75 degrees, 95 degrees, 85 degrees, and 105 degrees, and the area is 1.2 times that of the standard unit, and its quality assessment score is 0.85. In the encryption processing of different curvature areas, the encryption intensity coefficient of the high curvature area is 3, which divides the original unit into three equal parts; the encryption intensity coefficient of the medium curvature area is 2, which divides the original unit into two equal parts; the low curvature area maintains its original size. For example, at the rounded corner transition of a toy shell, the curvature value is 0.6, which belongs to the high curvature area. The original 10 mm side unit is subdivided into small units with a side length of 3.33 mm; while in the straight wall area, the curvature value is 0.1, and the original unit size of 10 mm is maintained. In the transition processing between different encryption intensity areas, gradient units are used to achieve a smooth transition of mesh size. For example, at the boundary between the high curvature area and the medium curvature area, the unit side length gradually transitions from 3.33 mm to 5 mm. The transition area spans 4 layers of units, and the ratio of adjacent unit side lengths is controlled within 1.2 to avoid sudden changes in grid size.
[0019] S102 , by calculating the Gaussian curvature and the mean curvature of the mesh vertices, drawing a surface curvature distribution map, judging the defect information at each mesh vertex according to the surface curvature distribution map, and obtaining surface defect distribution information of the environmentally friendly pulp molded packaging.
[0020] According to the grid vertex coordinates, a spherical neighborhood search is used to obtain the point set around the vertex, and the local surface function is obtained by cubic spline surface fitting. The maximum principal curvature value and the minimum principal curvature value at the vertex are solved from the local surface function; pseudo-color mapping processing is performed on the maximum principal curvature value and the minimum principal curvature value. If the maximum principal curvature value and the minimum principal curvature value at the vertex are both greater than the grid average curvature positive threshold, the vertex is marked as a convex defect point; the regional growing method of four-neighborhood diffusion is used to cluster vertices with the same marking value and adjacent positions, and the boundary curve length and regional area of the defect area are obtained from the clustering results; the average curvature value and Gaussian curvature value of the vertices in the defect area are calculated for the defect area, and the main direction of the area is obtained by the regional covariance matrix eigenvalue. If the absolute value of the average curvature is less than the grid average curvature, it is re-marked as a non-defective area.
[0021] Specifically, based on the vertex coordinates of the three-dimensional grid of environmentally friendly pulp molded packaging, a spherical neighborhood search is used to obtain the point set around each vertex. The search radius is set to three times the average side length of the grid. The local surface function is obtained by fitting the cubic spline surface. The maximum and minimum principal curvature values of the surface at the vertex are solved based on the surface function. The pseudo-color mapping method is used to draw the curvature distribution heat map, the maximum principal curvature value is mapped to the red channel, and the minimum principal curvature value is mapped to the blue channel. The curvature distribution characteristics are displayed by red and blue superposition. For each vertex position in the heat map, if the maximum and minimum principal curvature values are both greater than the positive three times the average curvature of the grid, the vertex is marked as a convex defect point and assigned a value of 1. If both are less than the negative three times the average curvature of the grid, the vertex is marked as a concave defect point and assigned a value of -1. The remaining vertices are marked as normal points and assigned a value of 0. Based on the vertex label values, the region growing method of four-neighborhood diffusion is used to cluster vertices with the same label value and adjacent positions. The diffusion radius is set to twice the average side length of the grid. Diffusion is stopped when the number of new vertices in the diffusion area is less than the threshold. Based on the clustering results, the geometric characteristics of each cluster area are calculated, including the number of vertices in the area, the length of the boundary curve of the area, and the area of the area. The boundary range of the area is determined by the minimum enclosing rectangle algorithm. For each cluster area, the average curvature value and Gaussian curvature value of the vertices in the area are calculated, and the main direction of the area is calculated based on the eigenvalue of the covariance matrix. If the absolute value of the average curvature is less than the average curvature of the grid or the Gaussian curvature is negative, the area is re-marked as a non-defective area. For the area marked as a defect, a defect feature vector is constructed, which includes the coordinates of the area center, the area, the length of the boundary curve, the average curvature value, and the main direction angle. The defect feature database is established using the defect number index. Curvature analysis is a key technical means in the detection of surface defects in environmentally friendly pulp molded packaging. Taking a typical express delivery box as an example, its mesh model has an average side length of 2 mm. When calculating vertex curvature, a 6 mm spherical neighborhood encompassing approximately 50 adjacent vertices is selected. These vertices are then fitted with a cubic spline surface to obtain local surface functions, which are then used to determine the principal curvature values. The curvature distribution heatmap uses a red and blue color channel mapping method, with the maximum principal curvature values between 0.5 and 1 mapped to red, and the minimum principal curvature values between -1 and -0.5 mapped to blue. For example, at the corners of the box, the two principal curvature values are 0.8 and 0.7, respectively, appearing bright red, indicating a distinct convex feature. Concave areas, on the other hand, have two principal curvature values of -0.9 and -0.8, respectively, appearing dark blue. For vertex defect marking, considering the average mesh curvature of 0.1, the threshold for determining convex defects is 0.3, and for determining concave defects, it is -0.3. For example, at the indentation of the packaging box, the maximum principal curvature was measured to be -0.35 and the minimum principal curvature was -0.4. Both were smaller than the negative threshold, and were determined to be a concave defect and marked as -1.In the process of regional growth clustering, the diffusion radius is set to 4 mm, and the diffusion is stopped when the number of new vertices in a round of diffusion is less than 3. Taking an indentation defect as an example, the diffusion starts from the center point. The first round contains 15 defect points, the second round adds 12, the third round adds 8, and the fourth round adds only 2 points, which meets the stopping condition. Finally, the defect area contains 37 vertices. The geometric feature analysis of the clustering area shows that the boundary curve length of the indentation defect area is 28 mm, the area is 48 square millimeters, the major axis of the minimum circumscribed rectangle is 8.5 mm, and the minor axis is 7.2 mm. The covariance matrix calculation shows that the angle between the main direction of the area and the edge of the packaging box is 75 degrees, indicating that this is an oblique indentation. In the defect feature database, a complete feature vector is recorded for each defect area. For example, the feature vector for the aforementioned indentation defect includes center coordinates (85.2, 64.3, 15.6), area 48, boundary length 28, average curvature -0.375, and a principal direction angle of 75 degrees. These characteristic data provide the basis for subsequent defect classification and statistical analysis. In the wrinkled area of the packaging box, although the measured average curvature absolute value reaches 0.4, the Gaussian curvature of -0.15 is less than zero, indicating that the surface is saddle-shaped and not a strict concave-convex defect. Therefore, it is marked as a non-defective area in the final defect database.
[0022] According to the constructed three-dimensional mesh model, the vertex coordinates and topological relationship information of the model are obtained, the first-order and second-order surface parameters of each vertex are calculated, and the average curvature of the vertex is obtained. The calculated vertex curvature value is normalized and mapped to a preset interval. According to the normalized curvature value, each vertex is assigned a corresponding color attribute to generate a surface curvature distribution map.
[0023] A spherical neighborhood search method is used to obtain a set of adjacent points based on the grid vertex coordinate information, and the least squares method is used to fit the set of adjacent points to obtain the parameter values of the quadratic surface equation; based on the parameter values of the quadratic surface equation, the principal curvature data of each vertex is solved, and the reference curvature data is obtained by eliminating the influence of rotation by establishing a local coordinate system based on the vertex normal vector; a vertex curvature histogram is constructed based on the reference curvature data, and a double threshold boundary is set using the percentile method to eliminate outliers, and normalized curvature data is obtained through cubic spline interpolation; a mapping relationship between the normalized curvature data and the red, green and blue color components is established, and the colors of adjacent vertices are weighted averaged using the inverse ratio of the distance between vertices as the weight coefficient to obtain a surface curvature distribution map.
[0024] Specifically, according to the coordinate information of the three-dimensional grid vertices, the search radius is set to three times the average side length of the grid, and a spherical neighborhood search is used to obtain the set of adjacent points around each vertex. The least squares method is used to fit z = ax 2A quadratic surface equation of the form +by²+cxy+dx+ey+f is used to calculate the first and second derivatives of the surface at that vertex to obtain initial curvature data. Based on this initial curvature data, the principal curvature value of each vertex is solved using the Gaussian curvature and mean curvature calculation formulas. A local coordinate system with the vertex normal as the z-axis is established to eliminate the effects of coordinate rotation. The six parameters of the surface equation are solved using Gaussian elimination to obtain baseline curvature data. A vertex curvature histogram is constructed based on this baseline curvature data, with the upper and lower quantiles set at the 95th and 5th percentiles as double threshold boundaries. Abnormal curvature values exceeding the threshold range are removed, and cubic spline interpolation is used to ensure continuity of the curvature data to obtain normalized curvature data. For this normalized curvature data, a linear mapping relationship between curvature values and red, green, and blue color components is established, with negative curvature intervals mapped to the blue component, zero curvature intervals to the green component, and positive curvature intervals to the red component. Based on the color component mapping results, a hue-angle mapping method is used to determine the base color of each vertex. The color saturation is controlled by the curvature value, and a curvature distribution heat map is plotted. The curvature distribution heat map is then color-smoothed, and the colors of adjacent vertices are blended using a vertex color weighted averaging method, with the weight coefficient inversely proportional to the distance between vertices. Based on the mesh connectivity between vertices, a triangle color interpolation method is used to color the mesh patches, achieving a continuous visualization of the curvature distribution of the mesh surface. In three-dimensional mesh curvature analysis, taking a typical mobile phone case model as an example, the average mesh edge length is 1 mm, and the spherical search radius is set to 3 mm. This means that each vertex typically contains 25 to 35 neighboring points, which is sufficient to ensure the accuracy of the surface fitting. When fitting a quadratic surface, the z-coordinates of the neighboring points of vertices at the corners of the case vary significantly, with the coefficients a and b typically ranging from 0.4 to 0.6, indicating a large curvature characteristic. During the principal curvature calculation stage, a local coordinate system is established using the vertex normal vectors to eliminate coordinate effects caused by the different orientations of the case surface. For the flat back panel area, the two main curvature values are close to 0, while in the side transition area, the absolute value of the main curvature value can reach 0.3 to 0.5, and can even reach 0.8 at the four corners. These values accurately reflect the geometric characteristics of the product surface. Curvature histogram analysis shows that 95% of the vertex curvature values are distributed in the range of -0.6 to 0.6. This is set as a double threshold boundary, and curvature values outside the range are regarded as outliers and are eliminated. Taking the vertex at a certain edge as an example, its initial curvature value is 1.2, which is obviously beyond the reasonable range. After cubic spline interpolation processing, the curvature value of the vertex is corrected to 0.58, which is more in line with the actual geometric shape. In the color mapping link, RGB color space is used for visualization.Negative curvature values are mapped to the blue channel, with a value range of -0.6 to 0 and a color range of 0 to 255; the zero curvature interval is mapped to green, with a value range of -0.1 to 0.1 and a color range of 0 to 255; the positive curvature interval is mapped to red, with a value range of 0 to 0.6 and a color range of 0 to 255. This mapping method makes the concave area appear blue, the flat area appears green, and the convex area appears red. In the color smoothing process, for vertex pairs within 2 mm apart, a weight coefficient is used for color blending. If the distance between the two vertices is d mm, the weight coefficient is set to (2-d) / 2, achieving a gradual transition of color. For the rounded transition area of the protective shell, this smoothing process makes the curvature change more natural, gradually transitioning from dark red to light green, intuitively showing the continuous change characteristics of the surface. Finally, in the coloring of the triangular mesh facets, the color inside each facet is obtained by vertex color interpolation. Taking a typical triangular patch as an example, the RGB values of its three vertices are (200, 50, 0), (180, 70, 0) and (160, 90, 0) respectively. The color of any point inside the patch is calculated by barycentric coordinate interpolation, so that the curvature distribution map shows good continuity visually.
[0025] S103. Extract the boundary curves of the three-dimensional mesh model and analyze the local shape features of the boundary curves. If the local shape features of a boundary curve deviate from the typical shape of a preset normal boundary, it indicates that a burr defect exists there. The burr defect is added to the surface defect distribution information.
[0026] According to the number of adjacent edges of the three-dimensional grid vertices, the vertices with two adjacent edges are marked as boundary points, and the initial boundary point sequence is obtained in a clockwise direction through the common edge relationship between the boundary points; for the initial boundary point sequence, a sliding window is used to calculate the angle between the center point and the two end points in the window, and the local morphological characteristics of the boundary curve are obtained through the difference sequence of the angles; for the local morphological characteristics of the boundary curve, a cubic spline curve is used for piecewise fitting, and the inflection point distribution of the boundary curve is obtained according to the continuity of the tangent direction of the curve at the endpoints; for the inflection point of the boundary curve, the difference between the curvature value at the inflection point and the curvature value of the previous and next sampling points is calculated. If the difference exceeds a preset multiple of the curvature standard deviation, it is determined that a burr defect exists at that location.
[0027] Specifically, based on the connectivity of 3D mesh vertices, vertices with two adjacent edges are marked as boundary points. Boundary points are then connected in a clockwise direction using co-edge relationships. An initial boundary point sequence is formed under the constraint that the distance between boundary points is less than the average mesh edge length. A sliding window of five points is set for this initial boundary point sequence. The angle between the center point and the two end points within the window is calculated. The angle difference sequence identifies the continuous variation characteristics of the curve and determines the local morphological features of the boundary curve. The local morphological features of the boundary curve are piecewise fitted, and each segment is smoothed using a cubic spline curve. The smoothness of the curve is determined based on the continuity of the tangent direction at the endpoints. Based on the smoothness of the boundary curve, a threshold for the rate of change of angle is set. When the angle between the tangents of two adjacent segments exceeds the threshold, the point is recorded as an inflection point of the boundary curve, and the distribution of inflection points of the boundary curve is obtained. For each inflection point of the boundary curve, the difference between the curvature value at the inflection point and the curvature values of the preceding and following sampling points is calculated. If the difference exceeds three times the curvature standard deviation, the point is marked as an outlier. A local boundary segment is extracted at the outlier point, and the ratio of the length of the boundary curve segment to the straight-line distance is calculated. If the ratio exceeds a preset threshold, a burr defect is identified at that location. For the identified burr defect area, a region growing method is used to obtain the burr boundary contour. The area, perimeter, and direction vector of the burr area are calculated, and a burr feature description vector is constructed. Based on the burr feature description vector and spatial location information, the surface defect distribution data is updated, and the burr defect type, location coordinates, and morphological characteristics are recorded. Boundary point extraction is a critical first step in boundary defect detection for environmentally friendly pulp molded packaging. For a standard express box, for example, the average grid edge length is 2 mm. Boundary point extraction is performed by examining the number of adjacent edges for each vertex, marking vertices with two adjacent edges as boundary points. For boxes with complete edges, these boundary points are connected clockwise to form a closed boundary curve. For local morphological analysis of the boundary curve, a five-point sliding window is used for feature extraction. The angle between the center point and the two end points of the window is typically between 175 and 180 degrees, demonstrating good continuity. At the burr defect, this angle will decrease sharply to 90 degrees or even less. Taking the burr on the edge of a certain packaging box as an example, the angle sequence of 5 consecutive sampling points is 178 degrees, 175 degrees, 92 degrees, 88 degrees, and 172 degrees. Among them, the sudden change from 92 degrees to 88 degrees clearly indicates the presence of a burr. In the curve fitting stage, the cubic spline curve of the normal boundary segment shows good smoothness, and the tangent direction at the endpoint changes smoothly. Taking a complete edge of the packaging box as an example, the boundary segment with a length of 100 mm is divided into 10 sub-segments for fitting, and the tangent angles between adjacent sub-segments are all less than 5 degrees. In the burr area, the 15 mm long boundary segment needs to be divided into 4 sub-segments, and the tangent angles between adjacent segments reach 25 degrees, reflecting the drastic change of the curve. For the detected inflection points, further verification is carried out by calculating the curvature difference.In the normal rounded corner transition area of the packaging box, the curvature value at the inflection point differs from the curvature of the previous and next sampling points within 0.2, while at the root of the burr, this difference often exceeds 0.6, which is more than 4 times the curvature standard deviation of 0.15. The morphological characteristic analysis of burr defects shows that typical burrs have a sharp protrusion shape. By calculating the ratio of the actual length of the local boundary segment to the straight-line distance between the endpoints, the ratio of the normal boundary segment is within 1.1, while the ratio at the burr can reach 1.8 or even higher. For a burr with a length of 8 mm, the perimeter of its boundary contour is 20 mm, the area is 12 square millimeters, and the angle between the direction vector and the normal vector of the packaging box surface is 75 degrees. Finally, in the defect feature database, a complete feature description is recorded for each burr defect; including the defect number, spatial coordinates such as x=85.2, y=64.3, z=15.6, morphological parameters, perimeter, area, orientation angle and other information. These data not only reflect the location distribution of the defect, but also describe the geometric characteristics of the defect, providing an important basis for subsequent defect classification and quality control.
[0028] Traverse along the edge of the 3D mesh model to obtain complete boundary curve data, resample the obtained complete boundary curve, calculate the local geometric features of each sampling point on the boundary curve, including curvature and torsion, and characterize the local shape features of the boundary curve.
[0029] Boundary points are determined based on the number of edges of the three-dimensional grid vertices, and a boundary point sequence is obtained by searching for shared edges of the boundary points; the sum of distances between adjacent points in the boundary point sequence is calculated, and the number of sampling points is determined by the sum of the distances, where the number of sampling points is determined by the average side length of the grid; cubic spline interpolation is performed on the boundary curve based on the number of sampling points, and the tangent direction of the boundary point sequence is used as an endpoint constraint to obtain a sampling point sequence; a Frey internal frame is constructed for the sampling point sequence, and curvature and torsion values are calculated using the Frey internal frame, where the curvature value is determined by local arc fitting, and the torsion value is determined by the rotation angle of the normal vector.
[0030] Specifically, based on the connectivity of 3D mesh vertices, vertices with two edges are marked as boundary points. An initial boundary point sequence is generated by searching for the next boundary point that shares an edge with the current boundary point. Connection constraints are set such that the inter-vertex distance is less than the average grid edge length and the included angle is less than 45 degrees. For this initial boundary point sequence, the total length of the boundary curve is calculated by summing the distances between adjacent points. The sampling interval is set to half the average grid edge length, and the number of sampling points is determined based on the arc length parameter. The boundary curve is resampled using cubic spline interpolation with boundary constraints. The interpolation interval is set between two adjacent original boundary points, and the tangent direction at the endpoints remains consistent with the original boundary, resulting in a dense and uniform sampling point sequence. For each point in the sampling point sequence, two points before and after are selected to form a five-point fitting interval. The least squares method is used to fit a local arc, and the curvature at that point is calculated using the inverse of the arc radius. Based on the position coordinates of the sampling point, the tangent vector and normal vector of the curve at that point are calculated using the finite difference method. The binormal vector is obtained through cross product operation, and the Frey internal frame of the spatial curve is constructed. Based on the Frey internal frame at adjacent sampling points, the rotation angle of the normal vector is calculated to obtain the curve torsion. The curvature value, torsion value, and Frey internal frame direction at that point are recorded as local shape features. The ratio of the distance between the first and last points of the boundary curve to the total length of the curve is calculated, and the integrity and closure of the boundary curve are confirmed by setting a closure threshold. In the boundary feature analysis of environmentally friendly pulp molded packaging, a typical express box with an average grid side length of 2 mm was used as an example. During the boundary point extraction process, a total of 2,400 boundary points were marked. These boundary points were screened using connection constraints. The distance between adjacent points must be less than 2 mm, and the direction angle must be less than 45 degrees, thus forming an ordered sequence of boundary points. In the parameterization of the boundary curve, the calculated total length of the curve is 1,200 mm. The sampling interval is set to 1 mm, thus determining the number of sampling points to be 1,200. The sampling process uses the cubic spline interpolation method to insert new sampling points between adjacent original boundary points to ensure the continuity of the curve. For the rounded corner transition area of the express box, the curve length is approximately 30 mm. Thirty new sampling points were inserted within this area to achieve a smoother curve transition. For a typical rounded corner, a five-point fitting interval was selected for local arc fitting. For a standard rounded corner with a radius of 20 mm, the resulting curvature value remained stable at around 0.05. However, at corners, the curvature value suddenly increased to 0.5, indicating a significant directional change. This method accurately captures the local geometric characteristics of the boundary curve. The Frey internal frame construction process for the spatial curve reveals the three-dimensional characteristics of the curve. At the vertical edge of the express box, the tangent vector is along the edge, the normal vector points inward, and the binormal vector is parallel to the box surface. These three orthogonal vectors change as the curve's position changes. When the curve rotates 90 degrees, the normal and binormal vectors also rotate 90 degrees. The torsion calculation reflects the degree of twisting in the spatial curve.In the boundary section within the plane, the torsion is close to 0, while in the transition area between the two surfaces, the torsion value increases significantly. For example, at the edge of the express box, the two adjacent surfaces are at a 90-degree angle, and the measured torsion peak reaches 0.4, which indicates that the curve has undergone a severe spatial twist at this location. For the judgment of closure, consider a complete express box top surface boundary with a total length of 800 mm and a distance between the first and last points of less than 4 mm. The ratio of the two is less than 0.005, which is much smaller than the set closure judgment threshold of 0.01. Therefore, the boundary curve is judged to be completely closed. On the contrary, if a break occurs during the boundary extraction process, this ratio will increase significantly, and it will be judged as a non-closed boundary. In the record of local shape features, each sampling point contains a complete feature vector. Taking a sampling point at the edge as an example, the recorded features include position coordinates (85.2, 64.3, 15.6), curvature value 0.5, torsion value 0.4, tangent vector (0.707, 0.707, 0), normal vector (0, 0, 1), and binormal vector (-0.707, 0.707, 0). These data completely describe the geometric characteristics of the boundary curve at this point.
[0031] S104. For local defects such as depressions, protrusions, and burrs in the surface defect distribution information, quantify the defect area, defect depth, and defect length of the local defect region to obtain key quantitative parameters for each type of defect. Compare the quantitative parameters with the preset threshold values of the environmentally friendly pulp molded packaging quality standards. If the parameters exceed the threshold range, they are judged as unqualified.
[0032] The defect area is segmented based on the surface mesh vertex data using the neighborhood similarity constrained region growing method, and the initial boundary point set of the defect area is obtained through the boundary tracking algorithm; the convex hull algorithm is used to construct the minimum circumscribed polygon for the initial boundary point set of the defect area, and the geometric quantization parameters of the defect area are obtained by calculating the area value of the minimum circumscribed polygon and the arc length of the boundary curve; the surface mesh vertices are extracted based on the geometric quantization parameters of the defect area, and the local reference surface equation of the defect area is obtained by quadratic surface fitting, and the distance value from the vertex in the defect area to the reference surface is calculated; a feature description vector containing the defect area, perimeter, maximum depth, average depth, and contour roundness is constructed based on the distance value, and the defect category probability value and confidence score of the feature description vector are determined by a support vector machine.
[0033] Specifically, based on the surface defect distribution information, a region growing method constrained by neighborhood similarity is used to segment the defect area. The growth threshold is set to three times the standard deviation of the local curvature. The defect contour is extracted using a boundary tracking algorithm to obtain the initial boundary point set of the defect area. For the boundary point set of the defect area, a convex hull algorithm is used to construct the minimum circumscribed polygon. The area value of the polygon is calculated as the defect area parameter. The perimeter parameter of the defect area is calculated by calculating the arc length of the boundary curve, and the geometric quantitative data of the defect area is recorded. For the defect area, the search radius is set to twice the longest axis of the defect area. The surface mesh vertices within this range are extracted, and the local reference surface equation is obtained by quadratic surface fitting. Based on the local reference surface, the distance from each vertex in the defect area to the reference surface is calculated. The protrusion height is determined by positive distance, the depression depth is determined by negative distance, and the burr length is determined by vertical distance. A defect feature description vector is constructed, containing five feature components: defect area, perimeter, maximum depth, average depth, and contour roundness. The feature values are mapped to the range of zero to one through normalization preprocessing. A support vector machine with a radial basis kernel function is used to classify defect feature vectors. The kernel function parameters are determined through cross-validation, and defect category probabilities and confidence scores are output. Defect parameters are scored based on preset quality standard thresholds, with the area parameter weighted at 0.3, the depth parameter weighted at 0.4, and the length parameter weighted at 0.3. A weighted quality score is calculated. The quality score is graded using four threshold intervals, and information such as the spatial location, geometric parameters, quality grade, and confidence probability of the defect area is recorded in a defect database. In defect detection for environmentally friendly pulp molded packaging, a typical express box is used as an example. Depressions, protrusions, and burrs on its surface exhibit distinct characteristics. For depressions, a region growing method with neighborhood similarity constraints is used to extract boundaries. The standard deviation of the local curvature is 0.15, and the growth threshold is set at 0.45. Growth is stopped when the curvature difference between adjacent points exceeds the threshold. During the geometric quantification of the defect area, for a typical depression, the minimum circumscribed polygon area of its boundary point set, obtained using the convex hull algorithm, is 200 square millimeters, and the actual arc length of the boundary curve is 52 millimeters. For a burr defect, the area of its circumscribed polygon is 15 square millimeters and the boundary arc length is 18 millimeters. This difference intuitively reflects the scale characteristics of different types of defects. In the construction of the local reference surface, taking the concave defect as an example, its longest axis is 16 millimeters, the search radius is set to 32 millimeters, and about 500 surface mesh vertices are extracted within this range. The reference surface equation obtained by quadratic surface fitting can accurately describe the normal surface morphology around the defect. For the concave area, the maximum negative distance measured is 2.8 millimeters and the average depth is 1.5 millimeters. In the construction of the defect feature vector, the feature quantification results of different types of defects show obvious differences. The outline of the concave defect is usually a relatively regular circle or ellipse, and the roundness value is between 0.8 and 0.95.Burr defects, on the other hand, have more irregular contours, typically with a roundness value below 0.6. After normalization, these feature values are mapped to the range of 0 to 1. In defect classification using a support vector machine, a radial basis kernel function is used, with its parameter set to 0.8 through cross-validation. For a batch of test samples, the recognition accuracy of concave defects reached 95%, with confidence levels consistently above 0.85. For burr defects, which have more complex morphologies, the recognition accuracy was 88%, with confidence levels ranging from 0.75 to 0.9. During the quality scoring process, the area parameter was weighted by 0.3, the depth parameter by 0.4, and the length parameter by 0.3. For a concave defect, for example, its normalized area score was 0.75, depth score by 0.85, and length score by 0.7, resulting in a calculated weighted quality score of 0.78. Based on the four-level threshold interval [0.9, 0.8, 0.6, 0.4], this defect was classified as a Class II defect. In the defect database, each defect record contains complete feature information. Typical data records include defect type (depression), center coordinates (85.2, 64.3, 15.6), area 200 square millimeters, maximum depth 2.8 millimeters, average depth 1.5 millimeters, boundary length 52 millimeters, quality level 2, and confidence level 0.92. These data provide important basis for subsequent quality control and process improvement.
[0034] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.
Claims
1. A method for intelligent detection and grading of product packaging surface defects, characterized in that: The method comprises: Obtaining discrete point cloud data of the surface of the environmentally friendly pulp molded packaging, removing outliers and noise points from the point cloud data to obtain preprocessed point cloud data, and connecting the discrete point clouds through triangular facets based on the preprocessed point cloud data to generate an initial mesh model to form a three-dimensional mesh model representing the geometric morphology of the surface of the environmentally friendly pulp molded packaging; By calculating the Gaussian curvature and mean curvature of the mesh vertices, a surface curvature distribution map is drawn. The defect information at each mesh vertex is determined based on the surface curvature distribution map, and the surface defect distribution information of the environmentally friendly pulp molded packaging is obtained. Extract the boundary curves of the 3D mesh model and analyze the local shape features of the boundary curves. If the local shape features of a boundary curve deviate from the typical shape of the preset normal boundary, it indicates that a burr defect exists at that location. The burr defect is added to the surface defect distribution information. For local defects such as depressions, protrusions, and burrs in the surface defect distribution information, the defect area, defect depth, and defect length of the local defect area are quantified respectively to obtain key quantitative parameters of various defects. The quantitative parameters are compared with the preset threshold values of the environmentally friendly pulp molded packaging quality standards. Those exceeding the threshold range are judged as unqualified, including: segmenting the defect area according to the surface mesh vertex data using the neighborhood similarity constrained region growing method, and obtaining the initial boundary point set of the defect area through the boundary tracking algorithm; constructing the minimum circumscribed polygon for the initial boundary point set of the defect area using the convex hull algorithm, and obtaining the geometric quantitative parameters of the defect area by calculating the area value of the minimum circumscribed polygon and the arc length of the boundary curve; extracting surface mesh vertices according to the geometric quantitative parameters of the defect area, obtaining the local reference surface equation of the defect area by quadratic surface fitting, and calculating the distance value from the vertex in the defect area to the reference surface; constructing a feature description vector containing the defect area, perimeter, maximum depth, average depth and contour roundness for the distance value, and judging the defect category probability value and confidence score of the feature description vector by the support vector machine.
2. The method according to claim 1, characterized in that The method comprises obtaining discrete point cloud data of the surface of the environmentally friendly paper pulp molded packaging, removing outliers and noise points in the point cloud data, obtaining preprocessed point cloud data, and connecting the discrete point cloud data through triangular facets to generate an initial mesh model based on the preprocessed point cloud data to form a three-dimensional mesh model representing the geometric morphology of the surface of the environmentally friendly paper pulp molded packaging. Obtain the three-dimensional coordinates of reflective marking points on the surface of environmentally friendly pulp molded packaging, and evenly arrange the reflective marking points along the packaging surface; Aligning scan data from different viewing angles according to the three-dimensional coordinates of the marker points to obtain a first set of point cloud data, wherein the scan data from different viewing angles are aligned using a least squares registration algorithm; Performing a spherical neighborhood search on the first set of point cloud data to obtain a second set of point cloud data, wherein the spherical neighborhood search eliminates abnormal points through dual constraints of a Euclidean distance threshold and a local curvature variance threshold; Calculating local curvature values based on the second set of point cloud data to perform regional partitioning, wherein the regional partitioning uses a Poisson reconstruction method to generate a triangular patch model, wherein the normal vector of the triangular patch model is consistent with the local curvature direction; It also includes: obtaining the initial grid model to be processed, determining the target encryption granularity and refinement level of the grid model according to preset business requirements, layering the grid model, and encrypting and refining the initial grid model using encryption methods with preset corresponding strengths according to different levels.
3. The method according to claim 2, characterized in that The method of obtaining an initial grid model to be processed, determining a target encryption granularity and refinement degree of the grid model according to preset business requirements, performing layered processing on the grid model, and encrypting and refining the initial grid model using encryption methods of preset corresponding strengths according to different layers, includes: The curvature value of the grid node is obtained by using the Gaussian curvature calculation formula according to the grid node coordinates. The grid is divided into three levels of high curvature area, medium curvature area and low curvature area by the octree space partitioning method to obtain the first grid unit; Calculating the ratio of the maximum side length to the minimum side length of adjacent cells of the first grid cell, and if the side length ratio exceeds a preset threshold, inserting a new node at the center of the cell with the longer side to obtain a second grid cell; Calculating a local grid topology connection relationship for the newly inserted node in the second grid unit, and using a quadrilateral grid unit division method to establish a connection between the new node and surrounding nodes to obtain a third grid unit; For the third grid unit, the grid is subdivided according to the high curvature area encryption strength coefficient, the medium curvature area encryption strength coefficient, and the low curvature area encryption strength coefficient, and gradient units are inserted between different encryption strength areas to obtain refined grid units.
4. The method according to claim 1, wherein The method calculates the Gaussian curvature and the mean curvature of the mesh vertices, draws a surface curvature distribution map, and determines the defect information at each mesh vertex according to the surface curvature distribution map to obtain the surface defect distribution information of the environmentally friendly pulp molded packaging, including: A spherical neighborhood search is used to obtain a set of points around the vertex according to the coordinates of the grid vertex, a local surface function is obtained by fitting a cubic spline surface, and the maximum and minimum principal curvature values at the vertex are obtained from the local surface function; Performing pseudo color mapping processing on the maximum principal curvature value and the minimum principal curvature value, and marking the vertex as a convex defect point if the maximum principal curvature value and the minimum principal curvature value at the vertex are both greater than the positive threshold of the grid average curvature; The region growing method of four-neighborhood diffusion is used to cluster vertices with the same label value and adjacent positions. The length of the defect region boundary curve and the region area are obtained from the clustering results. Calculate the average curvature value and Gaussian curvature value of the vertices in the defect area, and obtain the main direction of the area through the eigenvalue of the regional covariance matrix. If the absolute value of the average curvature is less than the average curvature of the grid, re-mark it as a non-defective area; It also includes: according to the constructed three-dimensional mesh model, obtaining the vertex coordinates and topological relationship information of the model, calculating the first-order and second-order surface parameters of each vertex, obtaining the average curvature of the vertex, normalizing the calculated vertex curvature value, mapping the curvature value to a preset interval, and assigning corresponding color attributes to each vertex according to the normalized curvature value to generate a surface curvature distribution map.
5. The method according to claim 4, characterized in that The method comprises: obtaining vertex coordinates and topological relationship information of the constructed three-dimensional mesh model, calculating the first-order and second-order surface parameters of each vertex, obtaining the average curvature of the vertex, normalizing the calculated vertex curvature values, mapping the curvature values to a preset range, assigning a corresponding color attribute to each vertex according to the normalized curvature values, and generating a surface curvature distribution map, including: A spherical neighborhood search method is used to obtain a set of adjacent points according to the coordinate information of the grid vertices, and a quadratic surface equation parameter value is obtained by fitting the set of adjacent points using a least squares method; Solve the principal curvature data of each vertex for the parameter value of the quadratic surface equation, and obtain the reference curvature data by establishing a local coordinate system based on the vertex normal vector to eliminate the rotation effect; Constructing a vertex curvature histogram based on the benchmark curvature data, using the percentile method to set a double threshold boundary to eliminate outliers, and obtaining normalized curvature data through cubic spline interpolation processing; A mapping relationship between the normalized curvature data and the red, green and blue color components is established, and the inverse ratio of the distance between vertices is used as a weight coefficient to perform weighted averaging processing on the colors of adjacent vertices to obtain a surface curvature distribution map.
6. The method according to claim 1, characterized in that The extraction of the boundary curve of the three-dimensional mesh model and the analysis of the local shape characteristics of the boundary curve are performed. If the local shape characteristics of a certain boundary curve deviate from the typical shape of a preset normal boundary, it indicates that a burr defect exists at that location, and the burr defect is added to the surface defect distribution information, including: According to the number of adjacent edges of the 3D mesh vertices, the vertices with two adjacent edges are marked as boundary points, and the initial boundary point sequence is obtained in a clockwise direction through the common edge relationship between the boundary points; For the initial boundary point sequence, a sliding window is used to calculate the angle between the center point and the two end points in the window, and the local morphological features of the boundary curve are obtained through the difference sequence of the angles; Based on the local morphological features of the boundary curve, a cubic spline curve is used for segmented fitting, and the inflection point distribution of the boundary curve is obtained according to the continuity of the tangent direction of the curve at the endpoints; For the inflection point of the boundary curve, calculate the difference between the curvature value at the inflection point and the curvature values of the previous and next sampling points. If the difference exceeds a preset multiple of the curvature standard deviation, it is determined that a burr defect exists at the location. It also includes: traversing along the edge of the three-dimensional grid model to obtain complete boundary curve data, resampling the obtained complete boundary curve, calculating the local geometric features of each sampling point on the boundary curve, including curvature and torsion, and characterizing the local shape features of the boundary curve.
7. The method according to claim 6, characterized in that The method of traversing the edge of the three-dimensional mesh model to obtain complete boundary curve data, resampling the obtained complete boundary curve, and calculating the local geometric features of each sampling point on the boundary curve, including curvature and torsion, to characterize the local shape features of the boundary curve, includes: Determine boundary points according to the number of edges of the three-dimensional mesh vertices, and obtain a boundary point sequence by searching for shared edges of the boundary points; Calculating the sum of distances between adjacent points in the boundary point sequence, and using the sum of the distances to determine the number of sampling points, where the number of sampling points is determined by the average side length of the grid; Performing cubic spline interpolation on the boundary curve according to the number of sampling points, and using the tangent direction of the boundary point sequence as an endpoint constraint to obtain a sampling point sequence; A Frey internal frame is constructed for the sampling point sequence, and a curvature value and a torsion value are calculated by the Frey internal frame. The curvature value is determined by local arc fitting, and the torsion value is determined by a normal vector rotation angle.
Citation Information
Patent Citations
Crimping pipe burr identification method
CN117911332A
Workpiece surface defect detection and early warning method based on 3D vision
CN118644456A