Detection method and device for deformation of steel part, storage medium and computer program
By performing contour point cloud data processing, bounding box transformation and rotation adjustment on the steel parts, combined with ICP precision registration, the problems of slow detection speed and low accuracy in the prior art are solved, and efficient and accurate steel parts deformation detection is achieved.
Patent Information
- Application Number
- CN202411994709.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-23
AI Technical Summary
In the prior art, the detection speed and the detection accuracy of steel parts are slow and the detection accuracy is not high, resulting in unqualified workpieces being easily flowed into the next process, increasing production costs.
By determining the outline point cloud data of the steel parts to be tested and the model steel parts, building a bounding box and performing point cloud transformation, performing rotation adjustment and multiple coarse registrations, and finally obtaining the deformation value through ICP precision registration.
The speed and accuracy of steel parts deformation detection are improved, the unqualified rate is reduced, and the production cost is reduced.
Smart Images

Figure CN120027754A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial manufacturing technology, and in particular to a method, device, storage medium and computer program for detecting deformation of steel parts. Background Art
[0002] The existing method of deformation detection in factory workshops is to manually use a plumb bob and a feeler gauge to compare and determine whether the workpiece is qualified. For extra-long steel plates, manual inspection has the problems of long time, large error and low precision. Unqualified workpieces are easy to flow into the next process, resulting in an increase in product failure rate and increased production costs. In addition, the manual inspection method is not suitable for special-shaped steel plates.
[0003] Deformation detection based on point cloud registration uses rigid body transformation to align two given point clouds with unknown point correspondences, and then calculates the distance between the contour corresponding closest points of the aligned actual workpiece point cloud and the workpiece point cloud of the drawing model to obtain the deformation value. This method can detect steel plates of different shapes. Point cloud registration is divided into coarse registration and fine registration. Common coarse registration methods are roughly divided into two methods: feature matching-based and exhaustive search-based. When these two methods perform coarse registration on the plane point cloud of the steel plate, it is difficult to find the correct corresponding matching points because the plane point cloud of the steel plate contains few feature points. The exhaustive search method consumes a long time in the process of searching for corresponding points.
[0004] The widely used ICP precision registration method is prone to fall into local optimum when performing precision registration on the plane point cloud of steel plates because the plane point cloud has many similar points, resulting in large registration errors. The extracted steel plate contour point cloud has outliers, resulting in large errors in the deformation value calculated after registration. The plane point cloud of a large steel plate contains a huge number of point clouds. Using the entire point cloud for ICP precision registration not only takes a long time, but also easily falls into local optimum, resulting in large registration errors. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method, device, storage medium and computer program for detecting deformation of steel parts, so as to solve the technical defects of slow detection speed and low detection accuracy when performing point cloud precision alignment on steel parts in the prior art.
[0006] In order to achieve the above-mentioned purpose, the first aspect of the present application provides a method for detecting deformation of a steel part, the detection method comprising:
[0007] Determine first contour point cloud data of the steel part to be tested and second contour point cloud data of the model steel part corresponding to the steel part to be tested;
[0008] Constructing a first bounding box for the first contour point cloud data and a second bounding box for the second contour point cloud data respectively;
[0009] Performing point cloud transformation on the first bounding box and the second bounding box respectively to obtain third contour point cloud data of the steel part to be tested and fourth contour point cloud data of the model steel part;
[0010] Performing a first rotation adjustment on the transformed first bounding box and the transformed second bounding box to obtain a first minimum bounding box for the steel part to be tested and a second minimum bounding box for the model steel part;
[0011] Performing point cloud transformation on the first minimum bounding box and the second minimum bounding box respectively to obtain fifth contour point cloud data of the steel part to be tested and sixth contour point cloud data of the model steel part;
[0012] Performing a second rotation adjustment on the transformed first minimum bounding box to obtain at least one third minimum bounding box;
[0013] Performing point cloud transformation on each third bounding box to obtain at least one seventh contour point cloud data for the steel part to be tested;
[0014] Performing point cloud precise registration on each seventh contour point cloud data with the sixth contour point cloud data respectively, so as to obtain an average value of the distance between the nearest neighbor point of each seventh contour point cloud data and the sixth contour point cloud data;
[0015] The deformation amount of the steel part to be tested is determined according to the minimum distance average value among the distance average values.
[0016] In an embodiment of the present application, determining the first contour point cloud data of the steel part to be tested includes: acquiring the point cloud data of the steel part to be tested; respectively acquiring the first maximum and the first minimum of the point cloud data in the x-axis direction and the y-axis direction of the preset spatial coordinate system; dividing the point cloud data into multiple rows and columns based on the first maximum and the first minimum to obtain the row and column where each point cloud data is located; determining the second maximum and the second minimum of each row and each column to obtain the first contour point cloud data of the steel part to be tested.
[0017] In an embodiment of the present application, performing point cloud transformation on the first bounding box and the second bounding box respectively to obtain the third contour point cloud data of the steel part to be measured and the fourth contour point cloud data of the model steel part includes: determining the first centroid of the first bounding box and the second centroid of the second bounding box respectively; determining the first difference and the second difference between the first centroid and the second centroid and the origin of the preset coordinate system respectively; determining the first covariance matrix of the first bounding box according to the first centroid, and determining the second covariance matrix of the second bounding box according to the second centroid; solving the first covariance matrix and the second covariance matrix respectively to obtain the first eigenvector and the second eigenvector; determining the first transformation matrix of the steel part to be measured based on the first eigenvector and the first difference, and determining the second transformation matrix of the model steel part based on the second eigenvector and the second difference; moving the first bounding box and the second bounding box respectively according to the first transformation matrix and the second transformation matrix to obtain the third contour point cloud data of the steel part to be measured and the fourth contour point cloud data of the model steel part.
[0018] In an embodiment of the present application, performing a first rotation adjustment on the transformed first bounding box and the transformed second bounding box to obtain a first minimum bounding box for the steel part to be tested and a second minimum bounding box for the model steel part includes: determining a first area and a second area of the transformed first bounding box and the transformed second bounding box, respectively; rotating the transformed first bounding box and the transformed second bounding box clockwise around the z-axis of the preset coordinate system based on a preset angle, and recording the first extreme value and the second extreme value of the first bounding box in the x-axis direction and the y-axis direction of the preset spatial coordinate system after each rotation, and recording the second extreme value of the second bounding box in the preset spatial coordinate system after each rotation. The third extreme value and the fourth extreme value in the x-axis direction and the y-axis direction of the spatial coordinate system, wherein each extreme value includes a maximum value and a minimum value; determining the third area of the first bounding box and the fourth area of the second bounding box after each rotation according to the product of the difference between the extreme value in the x-axis direction after each rotation and the difference between the extreme value in the y-axis direction; respectively determining the first area difference between each third area and the first area, and the second area difference between each fourth area and the second area; when the first area difference and the second area difference are less than the preset difference, determining to obtain the first minimum bounding box for the steel part to be tested and the second minimum bounding box for the model steel part.
[0019] In an embodiment of the present application, performing point cloud transformation on the first minimum bounding box and the second minimum bounding box respectively to obtain the fifth contour point cloud data of the steel part to be measured and the sixth contour point cloud data of the model steel part includes: determining the third centroid of the first minimum bounding box and the fourth centroid of the second minimum bounding box respectively; determining the third difference and the fourth difference between the third centroid and the fourth centroid and the origin of the preset coordinate system respectively; determining the third covariance matrix of the first minimum bounding box according to the third centroid, and determining the fourth covariance matrix of the second minimum bounding box according to the fourth centroid; solving the third covariance matrix and the fourth covariance matrix respectively to obtain the third eigenvector and the fourth eigenvector; determining the third transformation matrix of the steel part to be measured based on the third eigenvector and the third difference, and determining the fourth transformation matrix of the model steel part based on the fourth eigenvector and the fourth difference; moving the first minimum bounding box and the second minimum bounding box respectively according to the third transformation matrix and the fourth transformation matrix to obtain the fifth contour point cloud data of the steel part to be measured and the sixth contour point cloud data of the model steel part.
[0020] In an embodiment of the present application, a second rotation adjustment is performed on the transformed first minimum bounding box, including at least one of the following: a first rotation counterclockwise around the z-axis of a preset spatial coordinate system; a first rotation counterclockwise around the z-axis of the preset spatial coordinate system and then a second rotation counterclockwise around the y-axis of the preset spatial coordinate system; a second rotation counterclockwise around the z-axis of the preset spatial coordinate system; a second rotation counterclockwise around the z-axis of the preset spatial coordinate system and then a second rotation counterclockwise around the x-axis of the preset spatial coordinate system; a first rotation clockwise around the z-axis of the preset spatial coordinate system; a first rotation clockwise around the z-axis of the preset spatial coordinate system and then a second rotation counterclockwise around the y-axis of the preset spatial coordinate system; a second rotation counterclockwise around the x-axis of the preset spatial coordinate system.
[0021] In an embodiment of the present application, the detection method also includes: after obtaining the seventh contour point cloud data corresponding to the minimum distance average, determining the distance mean and distance standard deviation of the nearest neighbor points between the seventh contour point cloud data corresponding to the minimum distance average and the sixth contour point cloud data; determining the distance value interval of the nearest neighbor points based on the distance mean and distance standard deviation; traversing the nearest neighbor points to eliminate the nearest neighbor points whose distance values are outside the distance value interval.
[0022] A second aspect of the present application provides a device for detecting deformation of a steel part, comprising:
[0023] a memory configured to store instructions;
[0024] The processor is configured to call the instructions from the memory and implement the above-mentioned method for detecting deformation of steel parts when executing the instructions.
[0025] A third aspect of the present application provides a machine-readable storage medium having instructions stored thereon, which, when executed by a processor, configure the processor to execute the above-mentioned method for detecting deformation of steel parts.
[0026] A fourth aspect of the present application provides a computer program product, including a computer program, which implements the above-mentioned method for detecting deformation of steel parts when executed by a processor.
[0027] The above technical scheme determines the first and second contour point clouds of the steel part to be tested and the model respectively; constructs the first and second bounding boxes for the first and second contour point clouds respectively; performs point cloud transformation on the bounding boxes to obtain the third and fourth point clouds of the steel part to be tested and the model respectively; performs a first rotation adjustment on the transformed first and second bounding boxes to obtain the first and second minimum bounding boxes for the steel part to be tested and the model respectively; performs point cloud transformation to obtain the fifth and sixth point clouds of the steel part to be tested and the model respectively; performs a second rotation adjustment on the transformed first minimum bounding box to obtain at least one third minimum bounding box; performs point cloud transformation on the third minimum bounding box to obtain at least one seventh point cloud for the steel part to be tested; performs point cloud precise registration on each seventh point cloud with the sixth point cloud to obtain the average distance of multiple nearest neighbor points; determines the deformation amount of the steel part to be tested according to the minimum distance average, thereby realizing the detection speed and detection accuracy of the steel part during point cloud precise registration, thereby effectively improving the speed and detection accuracy of steel part deformation detection.
[0028] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0030] Figure 1 A schematic diagram of a process flow of a method for detecting deformation of a steel part according to an embodiment of the present application is schematically shown;
[0031] FIG2 schematically shows a schematic diagram of a contour point cloud after point cloud transformation according to an embodiment of the present application;
[0032] FIG3 schematically shows a schematic diagram of a contour point cloud after another point cloud transformation according to an embodiment of the present application;
[0033] Figure 4 A schematic diagram of a contour point cloud after ICP precise registration according to an embodiment of the present application is schematically shown;
[0034] Figure 5The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0036] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0037] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0038] Figure 1 The following schematically shows a flow chart of a method for detecting deformation of a steel part according to an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides a method for detecting deformation of a steel part, and the detection method may include the following steps.
[0039] Step 101 : determining first contour point cloud data of a steel part to be tested and second contour point cloud data of a model steel part corresponding to the steel part to be tested.
[0040] In the embodiment of the present application, it should be noted that the steel part to be tested may refer to an extra-long steel plate with a length of more than 12m, and the contour may refer to the outer contour of the steel part. The outer contour usually refers to the outer edge line or contour line of an object, which is used to describe the external shape and boundary of the object. In the present technical solution, the point cloud data of the entire steel part to be tested can be obtained first, and then the contour can be extracted to obtain the first contour point cloud data of the steel part to be tested. For each type of steel part, there is a corresponding standard CAD drawing, and the spatial model in the CAD drawing is the model of the corresponding type of steel part. Therefore, each type of steel part corresponds to a model steel part. For model steel parts, the point cloud data of the model steel part and the second contour point cloud data can be quickly extracted by software.
[0041] In an embodiment of the present application, determining the first contour point cloud data of the steel part to be tested includes: acquiring the point cloud data of the steel part to be tested; respectively acquiring the first maximum and the first minimum of the point cloud data in the x-axis direction and the y-axis direction of a preset spatial coordinate system; dividing the point cloud data into multiple rows and columns based on the first maximum and the first minimum to obtain the row and column where each point cloud data is located; determining the second maximum and the second minimum of each row and each column to obtain the first contour point cloud data of the steel part to be tested.
[0042] In this embodiment, it should be noted that due to the large size and high precision requirements of large-sized steel plates, the number of steel plate point clouds obtained by scanning is large, which can reach tens of millions, and the number of points after sampling is also millions. The common algorithms for obtaining edge points based on neighborhood point processing, such as extracting edge points based on normal vectors, extracting edge points based on density, and extracting edge points based on alphashapes, are characterized by high time complexity, and the computing time for a large number of point clouds is too long. Therefore, in order to quickly extract the outer contour data of the steel part to be tested, the technical solution can use the longitude and latitude method for contour extraction, where the longitude and latitude method can refer to a method of using longitude and latitude to determine the position of an object. Specifically, in the technical solution, the point cloud data of the steel part to be tested can be acquired by an image acquisition device such as a camera, and then the first maximum and the first minimum of the point cloud data in the x-axis direction and the y-axis direction of the preset spatial coordinate system can be respectively acquired, for example, they can be recorded as Xmax, Ymax, Xmin and Ymin, and then a suitable step size step is set according to the sampling resolution of the point cloud to divide the point cloud data into (Ymax-Ymin) / step rows and (Xmax-Xmin) / step columns. Among them, the preset spatial coordinate system can be set according to actual needs, for example, it can be constructed with the screen center of the image acquisition device as the origin. After the point cloud data is divided, the point cloud data is traversed to calculate the rows and columns where each point cloud data is located. At this time, the second maximum and the second minimum of each row and each column are calculated, that is, the extreme values of all rows and columns are calculated, and the outer contour point cloud of the steel part to be tested can be quickly extracted to obtain the first contour point cloud data of the steel part to be tested.
[0043] Step 102 : construct a first bounding box for the first contour point cloud data and a second bounding box for the second contour point cloud data respectively.
[0044] In the embodiments of the present application, it should be noted that the bounding box may refer to an algorithm for solving the optimal bounding space of a discrete point set. The basic idea is to use a geometric body with a slightly larger volume and simpler characteristics to approximately replace complex geometric objects. Common bounding box algorithms include AABB bounding boxes, bounding spheres, directional bounding boxes OBB, and fixed-direction convex hulls FDH. In the present technical solution, since the shapes of the two contour point clouds of the steel part to be tested and the model steel part are basically the same, the corresponding bounding boxes are slightly different. In order to facilitate the subsequent point cloud transformation processing, a first bounding box for the first contour point cloud data and a second bounding box for the second contour point cloud data can be constructed respectively to improve processing efficiency.
[0045] Step 103 , performing point cloud transformation on the first bounding box and the second bounding box respectively, so as to obtain third contour point cloud data of the steel part to be measured and fourth contour point cloud data of the model steel part.
[0046] In the embodiment of the present application, it should be noted that the distance between the two contour point clouds to be registered is relatively far, and directly performing ICP fine registration will lead to registration errors. However, the point cloud feature points of large-sized steel parts are relatively few, and the common feature-based point cloud registration is not applicable. Therefore, in the present technical solution, before performing ICP fine registration, a rough registration of the steel part to be tested and the model steel part can be achieved through point cloud transformation. Among them, the point cloud transformation may refer to PCA point cloud transformation, which converts the original point cloud data into a new coordinate system through linear transformation. In the present technical solution, the center points of the contour point clouds of the steel part to be tested and the model steel part can be transformed to the origin of the preset coordinate system respectively through PCA point cloud transformation, so as to achieve preliminary alignment of the contour point clouds of the steel part to be tested and the model steel part. Specifically, in order to facilitate point cloud transformation processing, the present technical solution respectively constructs a first bounding box for the first contour point cloud data and a second bounding box for the second contour point cloud data. By performing point cloud transformation on the first bounding box and the second bounding box, point cloud transformation of the first contour point cloud data and the second contour point cloud data can be achieved to obtain the third contour point cloud data of the steel part to be tested and the fourth contour point cloud data of the model steel part after point cloud transformation.
[0047] In an embodiment of the present application, performing point cloud transformation on the first bounding box and the second bounding box respectively to obtain the third contour point cloud data of the steel part to be measured and the fourth contour point cloud data of the model steel part includes: determining the first centroid of the first bounding box and the second centroid of the second bounding box respectively; determining the first difference and the second difference between the first centroid and the second centroid and the origin of the preset coordinate system respectively; determining the first covariance matrix of the first bounding box according to the first centroid, and determining the second covariance matrix of the second bounding box according to the second centroid; solving the first covariance matrix and the second covariance matrix respectively to obtain the first eigenvector and the second eigenvector; determining the first transformation matrix of the steel part to be measured based on the first eigenvector and the first difference, and determining the second transformation matrix of the model steel part based on the second eigenvector and the second difference; moving the first bounding box and the second bounding box respectively according to the first transformation matrix and the second transformation matrix to obtain the third contour point cloud data of the steel part to be measured and the fourth contour point cloud data of the model steel part.
[0048] In the present embodiment, it should be noted that the point cloud transformation may refer to the PCA point cloud transformation. The PCA point cloud transformation process may first calculate the centroid of the point cloud, then calculate the covariance matrix of the point cloud, and then obtain the new coordinate axis direction by solving the eigenvector of the covariance matrix. Therefore, in the present technical solution, when the first bounding box and the second bounding box are respectively subjected to the PCA point cloud transformation, the first centroid of the first bounding box and the second centroid of the second bounding box may be respectively calculated first, and the first covariance matrix of the first bounding box and the second covariance matrix of the second bounding box may be respectively calculated based on the first centroid and the second centroid. Secondly, the first covariance matrix is solved to obtain the first eigenvector, and the first eigenvector is converted into the rotation matrix R1, the second covariance matrix is solved to obtain the second eigenvector, and the second eigenvector is converted into the rotation matrix R2. At the same time, the first difference t1 and the second difference t2 between the first centroid and the second centroid and the origin of the preset spatial coordinate system are calculated. Therefore, according to the rotation matrix R1 and the first difference t1, the first transformation matrix Tg1 from the center of the contour point cloud of the steel part to be tested to the origin can be obtained, and according to the rotation matrix R2 and the second difference t2, the second transformation matrix Tm1 from the center of the contour point cloud of the model steel part to the origin can be obtained.
[0049] It should be noted that after obtaining the first transformation matrix Tg1 and the second transformation matrix Tm1 respectively, the first bounding box and the second bounding box are moved respectively according to the first transformation matrix Tg1 and the second transformation matrix Tm1, so that the center of the contour point cloud of the steel part to be tested and the center of the contour point cloud of the model steel part are transformed to the origin, so as to obtain the third contour point cloud data of the steel part to be tested and the fourth contour point cloud data of the model steel part after the point cloud transformation. Specifically, after the first rough registration, the third contour point cloud data and the fourth contour point cloud data obtained after the transformation can be as follows: Figure 2A and 2B shown.
[0050] Step 104 : performing a first rotation adjustment on the transformed first bounding box and the transformed second bounding box to obtain a first minimum bounding box for the steel part to be tested and a second minimum bounding box for the model steel part.
[0051] In the embodiment of the present application, it should be noted that after the contour point cloud is transformed to the origin, the contour point cloud of the steel part to be measured may be missing or have many noise points due to a lot of processing during scanning. At this time, there is still a certain error between the bounding box of the contour point cloud of the model steel part and the contour point cloud. It will take a long time to use ICP for precise registration. Figure 2A and 2BAs shown, the center points of the transformed first bounding box and the second bounding box are not at the origin of the preset spatial coordinate system. Therefore, it is necessary to perform a second rough alignment on the transformed first bounding box and the transformed second bounding box. Specifically, the transformed first bounding box and the second bounding box can be rotated and fine-tuned to obtain the minimum bounding boxes of the steel part to be tested and the model steel part, respectively. The first rotation adjustment can refer to setting a rotation angle angle, rotating the transformed first bounding box and the second bounding box clockwise around the z-axis of the preset spatial coordinate system, and the rotation angle each time is angle.
[0052] In an embodiment of the present application, performing a first rotation adjustment on the transformed first bounding box and the transformed second bounding box to obtain a first minimum bounding box for the steel part to be tested and a second minimum bounding box for the model steel part includes: determining a first area and a second area of the transformed first bounding box and the transformed second bounding box, respectively; rotating the transformed first bounding box and the transformed second bounding box clockwise around the z-axis of the preset coordinate system based on a preset angle, and recording the first extreme value and the second extreme value of the first bounding box in the x-axis direction and the y-axis direction of the preset spatial coordinate system after each rotation, and recording the second extreme value of the second bounding box in the preset spatial coordinate system after each rotation. The third extreme value and the fourth extreme value in the x-axis direction and the y-axis direction of the spatial coordinate system, wherein each extreme value includes a maximum value and a minimum value; determining the third area of the first bounding box and the fourth area of the second bounding box after each rotation according to the product of the difference between the extreme value in the x-axis direction after each rotation and the difference between the extreme value in the y-axis direction; respectively determining the first area difference between each third area and the first area, and the second area difference between each fourth area and the second area; when the first area difference and the second area difference are less than the preset difference, determining to obtain the first minimum bounding box for the steel part to be tested and the second minimum bounding box for the model steel part.
[0053] In this embodiment, it should be noted that before performing the first rotation, the first area of the transformed first bounding box and the second area of the transformed second bounding box are calculated respectively, and then a preset rotation angle angle is set, and the transformed first bounding box and the second bounding box are respectively rotated clockwise around the z-axis of the preset spatial coordinate system, and the rotation angle each time is angle, and the first extreme value of the first bounding box in the x-axis direction and the second extreme value in the y-axis direction of the preset spatial coordinate system after each rotation are recorded, wherein each extreme value includes a maximum value and a minimum value. After each clockwise rotation around the z-axis by the preset rotation angle angle, the difference between the maximum value and the minimum value in the x-axis direction is calculated, and the difference between the maximum value and the minimum value in the y-axis direction is calculated, and the product between the two differences is used as the area of the bounding box after each rotation. In this way, the third area of the first bounding box and the fourth area of the second bounding box after each rotation can be calculated. At this time, the first area difference between each third area and the first area, and the second area difference between each fourth area and the second area are calculated respectively, that is, the area difference of the bounding box before and after the rotation is calculated after each rotation. When the area difference before and after the rotation is less than the preset difference, the bounding box after the rotation can be determined as the minimum bounding box, thereby obtaining the first minimum bounding box for the steel part to be tested and the second minimum bounding box for the model steel part. The preset difference can be set according to requirements.
[0054] It should be noted that when the bounding box rotates clockwise around the z-axis of the preset spatial coordinate system, if the area of the bounding box after rotation is larger than the area of the bounding box before rotation, the next rotation direction is modified to counterclockwise rotation around the z-axis of the preset spatial coordinate system, otherwise it continues to rotate clockwise.
[0055] Step 105 , performing point cloud transformation on the first minimum bounding box and the second minimum bounding box respectively, so as to obtain fifth contour point cloud data of the steel part to be tested and sixth contour point cloud data of the model steel part.
[0056] In the embodiment of the present application, it should be noted that after performing the first rotation to obtain the first minimum bounding box and the second minimum bounding box, at this time, the center of the bounding box will not be at the origin of the preset spatial coordinate system. Therefore, it is necessary to perform PCA point cloud transformation on the first minimum bounding box and the second minimum bounding box again so that the center of the first minimum bounding box and the second minimum bounding box are translated to the origin. Similarly, according to the PCA transformation principle, the transformation matrices from the center of the contour point cloud of the steel part to be tested and the model steel part to the origin can be calculated as Tg2 and Tm2. Move based on the transformation matrices Tg2 and Tm2 to complete the second coarse alignment to obtain the fifth contour point cloud data of the steel part to be tested and the sixth contour point cloud data of the model steel part after the transformation.
[0057] In an embodiment of the present application, performing point cloud transformation on the first minimum bounding box and the second minimum bounding box respectively to obtain the fifth contour point cloud data of the steel part to be measured and the sixth contour point cloud data of the model steel part includes: determining the third centroid of the first minimum bounding box and the fourth centroid of the second minimum bounding box respectively; determining the third difference and the fourth difference between the third centroid and the fourth centroid and the origin of the preset coordinate system respectively; determining the third covariance matrix of the first minimum bounding box according to the third centroid, and determining the fourth covariance matrix of the second minimum bounding box according to the fourth centroid; solving the third covariance matrix and the fourth covariance matrix respectively to obtain the third eigenvector and the fourth eigenvector; determining the third transformation matrix of the steel part to be measured based on the third eigenvector and the third difference, and determining the fourth transformation matrix of the model steel part based on the fourth eigenvector and the fourth difference; moving the first minimum bounding box and the second minimum bounding box respectively according to the third transformation matrix and the fourth transformation matrix to obtain the fifth contour point cloud data of the steel part to be measured and the sixth contour point cloud data of the model steel part.
[0058] In this embodiment, the third center of mass of the first minimum bounding box and the fourth center of mass of the second minimum bounding box are calculated respectively, and the third covariance matrix of the first minimum bounding box and the fourth covariance matrix of the second minimum bounding box are calculated respectively based on the third center of mass and the fourth center of mass. Secondly, the third covariance matrix is solved to obtain the third eigenvector, and the third eigenvector is converted into the rotation matrix R3, the fourth covariance matrix is solved to obtain the fourth eigenvector, and the fourth eigenvector is converted into the rotation matrix R4. At the same time, the third difference t3 and the fourth difference t4 between the third center of mass and the fourth center of mass and the origin of the preset spatial coordinate system are calculated respectively. Thus, according to the rotation matrix R3 and the third difference t3, the third transformation matrix Tg2 from the center of the contour point cloud of the steel part to be measured to the origin can be obtained, and according to the rotation matrix R4 and the fourth difference t4, the fourth transformation matrix Tm2 from the center of the contour point cloud of the model steel part to the origin can be obtained. Specifically, after the second rough alignment, the fifth contour point cloud data and the sixth contour point cloud data obtained after the transformation can be as follows Figure 3A and 3B shown.
[0059] Step 106: Perform a second rotation adjustment on the transformed first minimum bounding box to obtain at least one third minimum bounding box.
[0060] In the embodiment of the present application, it should be noted that, since the transformation principle of PCA will cause the directions of the two contour point clouds to be inconsistent, it is necessary to further rotate around several coordinate axes to make the directions of the contour point clouds of the steel part to be tested and the model steel part consistent. Specifically, a second rotation adjustment is performed on the transformed first minimum bounding box to obtain at least one third minimum bounding box.
[0061] In an embodiment of the present application, a second rotation adjustment is performed on the transformed first minimum bounding box, including at least one of the following: a first rotation around the z-axis of a preset spatial coordinate system counterclockwise; a first rotation around the z-axis of the preset spatial coordinate system and then a second rotation around the y-axis of the preset spatial coordinate system counterclockwise; a second rotation around the z-axis of the preset spatial coordinate system counterclockwise; a second rotation around the z-axis of the preset spatial coordinate system and then a second rotation around the x-axis of the preset spatial coordinate system counterclockwise; a first rotation around the z-axis of the preset spatial coordinate system; a first rotation around the z-axis of the preset spatial coordinate system and then a second rotation around the y-axis of the preset spatial coordinate system counterclockwise; a second rotation around the x-axis of the preset spatial coordinate system counterclockwise.
[0062] In this embodiment, it should be noted that the first angle may refer to 90 degrees, and the second angle may refer to 180 degrees. There are multiple rotation situations in this technical solution, which can make the directions of the two contour point clouds consistent after rotation, specifically, they can include:
[0063] (1) Rotate 90 degrees counterclockwise around the z-axis of the preset spatial coordinate system;
[0064] (2) rotate 90 degrees counterclockwise around the z-axis of the preset spatial coordinate system and then rotate 180 degrees counterclockwise around the y-axis of the preset spatial coordinate system;
[0065] (3) Rotate 180 degrees counterclockwise around the z-axis of the preset spatial coordinate system;
[0066] (4) rotate 180 degrees counterclockwise around the z-axis of the preset spatial coordinate system and then rotate 180 degrees counterclockwise around the x-axis of the preset spatial coordinate system;
[0067] (5) Rotate 90 degrees clockwise around the z-axis of the preset spatial coordinate system;
[0068] (6) Rotate 90 degrees clockwise around the z-axis of the preset spatial coordinate system and then rotate 180 degrees counterclockwise around the y-axis of the preset spatial coordinate system;
[0069] (7) Rotate 180 degrees counterclockwise around the x-axis of the preset spatial coordinate system.
[0070] Step 107: performing point cloud transformation on each third bounding box to obtain at least one seventh contour point cloud data for the steel part to be tested.
[0071] In the embodiment of the present application, it should be noted that, for the third bounding box obtained after each rotation, since the center after rotation does not coincide with the origin, each third bounding box needs to be transformed into a point cloud again so that the center of the third bounding box is at the origin. Specifically, the rotation matrix Tg3 of each third bounding box can be obtained according to the PCA point cloud change, so as to move based on the transformation matrix Tg3 and complete the third rough registration to obtain at least one seventh contour point cloud data of the steel part to be tested after the transformation.
[0072] Step 108 : performing point cloud precise registration on each seventh contour point cloud data with the sixth contour point cloud data to obtain an average distance between the nearest neighbor points of each seventh contour point cloud data and the sixth contour point cloud data.
[0073] In the embodiment of the present application, it should be noted that point cloud precision registration may refer to ICP precision registration. The main purpose of ICP precision registration is to find a set of transformations in an iterative manner so that the source point set can be aligned with the target point set as much as possible after the transformation. After ICP point cloud precision registration, an optimized transformation matrix is mainly obtained, including rotation and translation parameters, which are used to accurately align the two point clouds. The steps of ICP point cloud precision registration may include:
[0074] (1) Find corresponding points: Find the nearest point pairs in the contour point cloud of the steel part to be tested and the contour point cloud of the model steel part. These point pairs are the basis for the subsequent optimization of the rotation and translation matrices.
[0075] (2) Optimize the rotation and translation matrices: Use the corresponding point pairs found to estimate the optimal rotation and translation matrices, usually using the least squares method.
[0076] (3) Iterative optimization: Use the optimized rotation and translation matrices to transform the source point cloud, then find new corresponding points again, and repeat the above process until the iteration termination condition is met.
[0077] In this technical solution, each seventh contour point cloud data can be respectively subjected to ICP point cloud precise registration with the sixth contour point cloud data. Based on the ICP registration principle, the average distance between the nearest neighbor points of each seventh contour point cloud data and the sixth contour point cloud data can be obtained.
[0078] Step 109: determining the deformation amount of the steel part to be tested according to the minimum distance average value among the distance average values.
[0079] In the embodiment of the present application, it should be noted that after obtaining the average distance between the nearest neighbor points of each seventh contour point cloud data and the sixth contour point cloud data, the seventh contour point cloud corresponding to the minimum distance average among the distance averages can be determined as the contour point cloud with the best rough registration effect. Specifically, the ICP point cloud fine registration result can be as follows: Figure 4 shown.
[0080] In the present technical solution, at this time, the ICP result of the best contour point cloud is taken for calculation to obtain a high-precision steel part deformation amount. Therefore, the deformation amount of the steel part to be measured is further determined based on the minimum distance average value among the distance average values.
[0081] In an embodiment of the present application, the detection method also includes: after obtaining the optimal seventh contour point cloud data corresponding to the minimum distance average, determining the distance mean and distance standard deviation of the nearest neighbor points between the seventh contour point cloud data corresponding to the minimum distance average and the sixth contour point cloud data; determining the distance value interval of the nearest neighbor points based on the distance mean and the distance standard deviation; traversing the nearest neighbor points to eliminate the nearest neighbor points whose distance values are outside the distance value interval.
[0082] In this embodiment, it should be noted that there are some noise points that are difficult to remove in the actual steel part contour point cloud. The deformation obtained by calculating the neighboring points of the two contour point clouds that complete the point cloud precise registration according to the above steps is easily affected by the noise points, resulting in a large error in the steel part deformation detection result. In this technical solution, the influence of the noise value can be reduced by using the 3σ principle. The 3σ principle, also known as the Laida principle, is a statistical method for identifying and eliminating abnormal data. The method assumes that a set of detection data contains only random errors, obtains the standard deviation by calculating and processing the data, and determines an interval. Any error beyond this interval is considered to be a gross error, and the data containing the error should be eliminated. The 3σ principle is particularly suitable for sample data with normal distribution or approximate normal distribution, and is more reliable when the number of measurements is sufficient. Therefore, after obtaining the seventh contour point cloud data corresponding to the minimum distance average value, the distance mean u and the distance standard deviation σ of the nearest neighbor points between the seventh contour point cloud data corresponding to the minimum distance average value and the sixth contour point cloud data are further calculated to construct a distance value interval (μ-3σ, μ+3σ). Traverse all the nearest neighbor points to determine whether the distance value of the nearest neighbor point is within the distance value interval (μ-3σ,μ+3σ). If it is not within the distance value interval (μ-3σ,μ+3σ), it can be considered as a noise point and removed.
[0083] In this technical solution, k neighboring points of the screened point point in the steel plate contour point cloud are further selected, and the distance values of the neighboring points of each point corresponding to the k points in the model contour point cloud are calculated and then the average value is obtained. The average value is used to represent the final deformation value of the point point, thereby completing high-precision deformation detection of steel parts.
[0084] The above technical solution achieves the detection speed and detection accuracy when performing point cloud precision registration of steel parts, thereby effectively improving the detection speed and detection accuracy of steel part deformation.
[0085] This technical solution realizes the extraction of high-precision deformation results of steel parts based on the fast outer contour point cloud extraction based on the longitude and latitude method, the rigid body transformation of point cloud based on PCA, the coarse registration based on the rotation fine-tuning of the steel plate contour point cloud, the selection of ICP optimal transformation results based on multiple situations, and the 3σ criterion of normal distribution. This technical solution has fast measurement speed, high detection accuracy, high detection stability, effectively reduces false detection, replaces manual automatic intelligent detection, reduces the unqualified rate of steel parts, and improves product quality.
[0086] The present application provides a device for detecting deformation of a steel part, comprising:
[0087] a memory configured to store instructions;
[0088] The processor is configured to call the instructions from the memory and implement the above-mentioned method for detecting deformation of steel parts when executing the instructions.
[0089] An embodiment of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned method for detecting deformation of steel parts.
[0090] An embodiment of the present application provides a computer program product, including a computer program, which implements the above-mentioned method for detecting deformation of steel parts when executed by a processor.
[0091] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the computer device is used to store data on a detection method for steel deformation. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a detection method for steel deformation is implemented.
[0092] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0093] An embodiment of the present application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of a method for detecting deformation of a steel part are implemented.
[0094] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the steps of a method for detecting deformation of a steel part.
[0095] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0096] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0097] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0099] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0100] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0101] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0102] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0103] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for detecting deformation of steel parts, characterized in that: The detection method comprises: Determine first contour point cloud data of the steel part to be tested and second contour point cloud data of the model steel part corresponding to the steel part to be tested; Constructing a first bounding box for the first contour point cloud data and a second bounding box for the second contour point cloud data respectively; Performing point cloud transformation on the first bounding box and the second bounding box respectively to obtain third contour point cloud data of the steel part to be tested and fourth contour point cloud data of the model steel part; Performing a first rotation adjustment on the transformed first bounding box and the transformed second bounding box to obtain a first minimum bounding box for the steel part to be tested and a second minimum bounding box for the model steel part; Performing point cloud transformation on the first minimum bounding box and the second minimum bounding box respectively, so as to obtain fifth contour point cloud data of the steel part to be tested and sixth contour point cloud data of the model steel part; Performing a second rotation adjustment on the transformed first minimum bounding box to obtain at least one third minimum bounding box; Performing point cloud transformation on each third bounding box to obtain at least one seventh contour point cloud data for the steel part to be tested; Performing point cloud precise registration on each seventh contour point cloud data with the sixth contour point cloud data respectively, so as to obtain an average value of the distance between the nearest neighbor point of each seventh contour point cloud data and the sixth contour point cloud data; The deformation amount of the steel part to be measured is determined according to the minimum distance average value among the distance average values.
2. The detection method according to claim 1, characterized in that: Determining the first contour point cloud data of the steel part to be tested includes: Acquiring point cloud data of the steel part to be tested; Respectively obtaining a first maximum value and a first minimum value of the point cloud data in the x-axis direction and the y-axis direction of a preset spatial coordinate system; Dividing the point cloud data into a plurality of rows and columns based on the first maximum value and the first minimum value to obtain a row and a column where each point cloud data is located; The second maximum value and the second minimum value of each row and each column are determined to obtain the first contour point cloud data of the steel part to be measured.
3. The detection method according to claim 1, characterized in that: The performing point cloud transformation on the first bounding box and the second bounding box respectively to obtain the third contour point cloud data of the steel part to be tested and the fourth contour point cloud data of the model steel part comprises: Determine a first centroid of the first bounding box and a second centroid of the second bounding box respectively; Determining a first difference and a second difference between the first mass center and the second mass center and an origin of a preset coordinate system, respectively; Determine a first covariance matrix of the first bounding box according to the first centroid, and determine a second covariance matrix of the second bounding box according to the second centroid; Solving the first covariance matrix and the second covariance matrix respectively to obtain a first eigenvector and a second eigenvector; Determine a first transformation matrix of the steel part to be measured based on the first eigenvector and the first difference, and determine a second transformation matrix of the model steel part based on the second eigenvector and the second difference; The first bounding box and the second bounding box are moved according to the first transformation matrix and the second transformation matrix respectively to obtain third contour point cloud data of the steel part to be measured and fourth contour point cloud data of the model steel part.
4. The detection method according to claim 1, characterized in that: The first rotation adjustment is performed on the transformed first bounding box and the transformed second bounding box to obtain a first minimum bounding box for the steel part to be tested and a second minimum bounding box for the model steel part, including: Determine a first area and a second area of the transformed first bounding box and the transformed second bounding box respectively; Rotate the transformed first bounding box and the transformed second bounding box clockwise around the z-axis of the preset coordinate system based on the preset angle, and record the first extreme value and the second extreme value of the first bounding box in the x-axis direction and the y-axis direction of the preset spatial coordinate system after each rotation, and the third extreme value and the fourth extreme value of the second bounding box in the x-axis direction and the y-axis direction of the preset spatial coordinate system after each rotation, wherein each extreme value includes a maximum value and a minimum value; Determine the third area of the first bounding box and the fourth area of the second bounding box after each rotation according to the product of the difference between the extreme value in the x-axis direction and the extreme value in the y-axis direction after each rotation; respectively determining a first area difference between each third area and the first area, and a second area difference between each fourth area and the second area; When the first area difference and the second area difference are smaller than a preset difference, a first minimum bounding box for the steel part to be tested and a second minimum bounding box for the model steel part are determined.
5. The detection method according to claim 1, characterized in that: The performing point cloud transformation on the first minimum bounding box and the second minimum bounding box respectively to obtain the fifth contour point cloud data of the steel part to be tested and the sixth contour point cloud data of the model steel part comprises: respectively determining a third centroid of the first minimum bounding box and a fourth centroid of the second minimum bounding box; Determining a third difference and a fourth difference between the third mass center and the fourth mass center and an origin of a preset coordinate system respectively; Determine a third covariance matrix of the first minimum bounding box according to the third centroid, and determine a fourth covariance matrix of the second minimum bounding box according to the fourth centroid; Solving the third covariance matrix and the fourth covariance matrix respectively to obtain a third eigenvector and a fourth eigenvector; Determine a third transformation matrix of the steel part to be tested based on the third eigenvector and the third difference, and determine a fourth transformation matrix of the model steel part based on the fourth eigenvector and the fourth difference; The first minimum bounding box and the second minimum bounding box are moved according to the third transformation matrix and the fourth transformation matrix respectively to obtain fifth contour point cloud data of the steel part to be tested and sixth contour point cloud data of the model steel part.
6. The detection method according to claim 1, characterized in that: The second rotation adjustment of the transformed first minimum bounding box includes at least one of the following: Rotate counterclockwise around the z-axis of the preset spatial coordinate system by a first angle; Rotate the first angle counterclockwise around the z-axis of the preset spatial coordinate system and then rotate the second angle counterclockwise around the y-axis of the preset spatial coordinate system; Rotate the preset spatial coordinate system counterclockwise around the z-axis by the second angle; Rotate the preset spatial coordinate system counterclockwise around the z-axis by the second angle and then rotate the preset spatial coordinate system counterclockwise around the x-axis by the second angle; Rotate the preset spatial coordinate system clockwise around the z-axis by the first angle; Rotate the first angle clockwise around the z-axis of the preset spatial coordinate system and then rotate the second angle counterclockwise around the y-axis of the preset spatial coordinate system; The preset spatial coordinate system is rotated counterclockwise around the x-axis by the second angle.
7. The detection method according to claim 1, characterized in that: The detection method further comprises: After obtaining the seventh contour point cloud data corresponding to the minimum distance average, determining the distance mean and distance standard deviation of the nearest neighbor points between the seventh contour point cloud data corresponding to the minimum distance average and the sixth contour point cloud data; Determine the distance value interval of the nearest neighbor point based on the distance mean and the distance standard deviation; The nearest neighbor points are traversed to eliminate the nearest neighbor points whose distance values are outside the distance value interval.
8. A device for detecting deformation of steel parts, characterized in that: include: a memory configured to store instructions; A processor is configured to call the instruction from the memory and implement the method for detecting deformation of a steel part according to any one of claims 1 to 7 when executing the instruction.
9. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the method for detecting deformation of a steel part according to any one of claims 1 to 7.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method for detecting deformation of a steel part as claimed in any one of claims 1 to 7.