Workpiece surface shape difference detection method and system
By performing 2D depth map processing and super-resolution technology on low-resolution scanned point clouds, combined with 3D registration and 2D shape comparison, the problem of low resolution of 3D point cloud data is solved, enabling high-precision detection of surface shape differences in workpieces and precise adjustment of processing paths.
Patent Information
- Application Number
- CN202411029826.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-22
AI Technical Summary
Existing technologies based on 3D point cloud data have low resolution for detecting differences in workpiece surface shape, which makes it easy for deviations to occur during processing and makes it difficult to achieve precise control of workpiece surface shape.
By acquiring low-resolution scan point clouds and converting them into two-dimensional depth maps, processing area detection and super-resolution processing are performed. Combining SAC-IA coarse registration, ICP fine registration and SIFT algorithms, an octree is constructed to detect difference points. Finally, difference point clouds are generated to determine the surface shape differences of the workpiece.
It improves the accuracy of workpiece surface shape difference detection, reduces the amount of calculation, avoids deviations in the processing, and achieves higher precision workpiece surface shape control.
Smart Images

Figure CN119006384A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of workpiece surface shape measurement, and in particular relates to a method and system for detecting workpiece surface shape differences. Background Art
[0002] In the digital manufacturing process, monitoring the surface shape of the workpiece is a key step to ensure product quality. By obtaining the geometric parameters and surface features of the workpiece in real time and comparing them with the design requirements, potential problems can be discovered and solved in a timely manner to ensure that the geometric accuracy and surface quality of the product meet the requirements.
[0003] Non-contact workpiece surface measurement methods are widely used due to their non-contact and non-destructive characteristics. At present, there are two popular non-contact workpiece surface shape measurement methods. One is a two-dimensional image-based method that uses a color camera to obtain a two-dimensional image of the workpiece surface without depth information. The other is a three-dimensional point cloud-based method that uses an active optical camera to collect three-dimensional point cloud data on the workpiece surface to provide rich spatial information. However, the current three-dimensional point cloud data based on DOE structured light sensors has a low resolution. During the machining process of the workpiece, it is necessary to control the accuracy of the workpiece, especially to track the surface shape of the workpiece in the machining area in time during the machining process, so as to adjust the machining path parameters and avoid machining deviations. Therefore, it is very important to study the optimization of the workpiece surface shape measurement method for low-resolution point clouds in order to improve the accuracy and efficiency of workpiece surface shape measurement in the digital manufacturing process.
[0004] A method and device for detecting surface shape differences of a workpiece based on point cloud analysis is disclosed (patent application number: CN201810098174.4), which includes: obtaining a scan point cloud and a preset model point cloud, extracting key points from the model point cloud and the scan point cloud respectively, and obtaining a first key point and a second key point; calculating FPFH features of the first key point and the second key point, performing FPFH feature matching on the first key point and the second key point through a SAC-IA algorithm, and obtaining a model point cloud after coarse registration; performing ICP iteration on the scan point cloud and the model point cloud after coarse registration, and obtaining a model point cloud after fine registration; constructing a first octree according to the model point cloud after fine registration, constructing a second octree according to the scan point cloud, and determining that the difference nodes between the first octree and the second octree are the difference points between the scan point cloud and the model point cloud.
[0005] This public solution only detects the surface shape difference of the workpiece from the perspective of three-dimensional shape, but the resolution of the three-dimensional point cloud data is low. During the processing of the workpiece, it is necessary to control the accuracy of the processed part. In particular, it is necessary to track the surface shape of the workpiece in the processing area in time during the processing so as to adjust the processing path parameters and avoid processing deviations. This public solution has defects. Summary of the invention
[0006] The present application provides a method and system for detecting workpiece surface shape differences, aiming to solve the problem that the above-mentioned public solution only detects workpiece surface shape differences from the perspective of three-dimensional shape, the resolution of three-dimensional point cloud data is low, and deviations are prone to occur during the processing process.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] A method for detecting a difference in workpiece surface shape, comprising:
[0009] Obtain a low-resolution scanning point cloud of the workpiece and convert it into a two-dimensional depth map, perform processing area detection on the two-dimensional depth map through a preset processing area detection module, and obtain a processing area depth map;
[0010] Obtain the model point cloud of the workpiece to be compared, and align the low-resolution scanning point cloud and the model point cloud to be compared, including SAC-IA coarse registration and ICP fine registration;
[0011] The low-resolution scanning point cloud and the registered model point cloud to be compared are respectively cropped according to the processing area to construct the octrees of the low-resolution scanning point cloud and the model point cloud to be compared, and the difference points are obtained by comparing the difference nodes of the octrees;
[0012] Performing super-resolution processing on the depth map of the processing area through a preset super-resolution module to obtain a super-resolution depth map;
[0013] The super-resolution depth map and the depth map to be compared are registered using the SIFT algorithm, and the overlapping parts of the registered depth maps are cropped, wherein the depth map to be compared is obtained by performing a two-dimensional plane projection on the registered point cloud of the model to be compared;
[0014] The difference between the cropped super-resolution depth map and the cropped depth map to be compared is calculated, and the portion exceeding the threshold is extracted to obtain a difference result depth map;
[0015] The difference result depth map is converted into a point cloud and superimposed with the difference points to obtain a difference point cloud, and the workpiece surface shape difference detection result is obtained based on the difference point cloud.
[0016] Preferably, a low-resolution scanning point cloud of the workpiece is obtained and converted into a two-dimensional depth map, and a processing area detection module is used to perform processing area detection on the two-dimensional depth map to obtain a processing area depth map, specifically:
[0017] Obtaining a low-resolution scanning point cloud of the workpiece at the current detection stage, and projecting the low-resolution scanning point cloud onto a projection plane to obtain a first two-dimensional depth map;
[0018] Obtaining a second two-dimensional depth map of the workpiece in the previous detection stage, calculating a difference value of each pixel between the first two-dimensional depth map and the second two-dimensional depth map, and obtaining a difference map;
[0019] Binarize the difference map and perform a closing operation to obtain a difference enhancement map;
[0020] Find the maximum contour of the difference enhancement image, obtain the circumscribed rectangle of the maximum contour, and enlarge the rectangle according to a preset ratio as the processing area;
[0021] The pixel area of the processing area is cut out from the first two-dimensional depth map and placed in an empty background image of a fixed size to obtain a depth map of the processing area.
[0022] Preferably, the low-resolution scan point cloud and the model point cloud to be compared are registered, and the registration includes SAC-IA coarse registration and ICP fine registration, specifically:
[0023] The normal information of low-resolution scanned point clouds is estimated using principal component analysis algorithm;
[0024] Calculate the FPFH descriptor and use the SAC-IA algorithm to iteratively obtain the preliminary transformation matrix to obtain the first transformed point cloud;
[0025] Find the corresponding point pairs, calculate the rotation matrix and translation vector, and perform ICP precise registration by minimizing the root mean square error between the corresponding point pairs;
[0026] Set the threshold and maximum number of iterations to output the fully aligned point cloud data.
[0027] Preferably, the low-resolution scanned point cloud and the registered model point cloud to be compared are respectively cropped according to the processing area to respectively construct octrees of the low-resolution scanned point cloud and the model point cloud to be compared, and the difference points are obtained by comparing the difference nodes of the octree, specifically:
[0028] Crop the low-resolution scanned point cloud according to the processing area, and crop the aligned model point cloud to be compared according to the processing area;
[0029] A first octree is constructed according to the cropped low-resolution scanned point cloud, and a second octree is constructed according to the cropped registered model point cloud to be compared;
[0030] The difference nodes between the first octree and the second octree are calculated to obtain the difference points between the low-resolution scanned point cloud and the aligned model point cloud to be compared.
[0031] Preferably, the depth map of the processing area is subjected to super-resolution processing by a preset super-resolution module to obtain a super-resolution depth map, specifically:
[0032] An adversarial neural network is constructed to obtain a super-resolution network, the super-resolution network is trained to obtain a pre-trained super-resolution network, and the depth map of the processing area is input into the pre-trained super-resolution network to obtain a super-resolution depth map.
[0033] Preferably, the super-resolution depth map and the depth map to be compared are registered using the SIFT algorithm, and the overlapping part of the depth map after registration is cropped, specifically:
[0034] Use SIFT algorithm to extract key points and feature descriptors of super-resolution depth map and depth map to be compared;
[0035] Match the key points of the super-resolution depth map and the depth map to be compared, and filter and remove incorrect matching points;
[0036] According to the screened matching points, the homography matrix between the super-resolution depth map and the depth map to be compared is calculated, and the super-resolution depth map is perspective-transformed into the coordinate system of the depth map to be compared using the homography matrix;
[0037] Create two blank backgrounds of the same size and save the overlapping parts as the super-resolution depth map and the overlapping part of the depth map to be compared.
[0038] Preferably, the difference between the cropped super-resolution depth map and the cropped depth map to be compared is calculated, and the portion exceeding the threshold is extracted to obtain a difference result depth map, which is specifically:
[0039] Calculate the difference between the cropped super-resolution depth map and the cropped depth map to be compared;
[0040] Set the threshold and create a binary image mask, mark the part exceeding the pixel threshold, create an all-zero array of the same shape as the comparison result array, then extract the part exceeding the pixel threshold from the cropped super-resolution depth map and assign it to the all-zero array, and use the super-resolution depth map marked with the binary image mask as the difference result depth map.
[0041] A system for detecting surface shape differences of a workpiece, comprising:
[0042] Area detection unit: used to obtain the low-resolution scanning point cloud of the workpiece and convert it into a two-dimensional depth map. The two-dimensional depth map is used to detect the processing area through a preset processing area detection module to obtain a processing area depth map;
[0043] 3D registration unit: used to obtain the model point cloud to be compared of the workpiece, and to register the low-resolution scanning point cloud with the model point cloud to be compared. The registration includes SAC-IA coarse registration and ICP fine registration.
[0044] The first determination unit is used to respectively crop the low-resolution scanning point cloud and the registered model point cloud to be compared according to the processing area, so as to respectively construct an octree of the low-resolution scanning point cloud and the model point cloud to be compared, and obtain the difference point by comparing the difference nodes of the octree;
[0045] Super-resolution unit: used to perform super-resolution processing on the depth map of the processing area through a preset super-resolution module to obtain a super-resolution depth map;
[0046] Two-dimensional registration unit: used to register the super-resolution depth map and the depth map to be compared using the SIFT algorithm, and to crop the overlapping part of the depth map after registration, wherein the depth map to be compared is obtained by performing two-dimensional plane projection on the point cloud of the model to be compared after registration;
[0047] The second determining unit is used to perform difference calculation on the cropped super-resolution depth map and the cropped depth map to be compared, extract the part exceeding the threshold, and obtain a difference result depth map;
[0048] Difference detection result generation unit: used to convert the difference result depth map into a point cloud, and superimpose it with the difference point to obtain a difference point cloud, and obtain the workpiece surface shape difference detection result based on the difference point cloud.
[0049] An electronic device comprises a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement a method for detecting a difference in the surface shape of a workpiece as described in any one of the above.
[0050] A computer-readable storage medium, wherein a computer program stored in the storage medium, when executed by a computer, implements a method for detecting a difference in the surface shape of a workpiece as described above.
[0051] The present invention has the following beneficial effects:
[0052] This solution first extracts the processing area of the workpiece through processing area detection technology, and uses this area to align and crop the scanned point cloud to determine the three-dimensional shape difference points of the workpiece. Then, this solution introduces super-resolution technology to process the depth map of the processing area, and uses the SIFT algorithm to align and crop to determine the two-dimensional shape difference points of the workpiece. This solution uses a combination of three-dimensional shape and two-dimensional shape comparison technology to detect the surface shape difference of the workpiece, while reducing the amount of calculation and improving the accuracy of the workpiece surface shape difference detection, avoiding the problem of processing deviation during the processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 A flow chart of a method for detecting a difference in workpiece surface shape in the present invention;
[0054] Figure 2 A flowchart of a three-dimensional registration unit provided in Embodiment 1 of the present invention;
[0055] Figure 3 A framework diagram of a super-resolution model provided in Example 1 of the present invention;
[0056] Figure 4 A flowchart of a two-dimensional registration unit provided in Embodiment 1 of the present invention;
[0057] Figure 5 It is a schematic diagram of the structure of the system for detecting the difference in surface shape of workpieces in the present invention. DETAILED DESCRIPTION
[0058] Example 1
[0059] like Figure 1 As shown, a method for detecting a difference in the surface shape of a workpiece comprises:
[0060] S1. Obtain a low-resolution scanning point cloud of a workpiece and convert it into a two-dimensional depth map. Perform processing area detection on the two-dimensional depth map through a preset processing area detection module to obtain a processing area depth map.
[0061] S2, obtaining the model point cloud to be compared of the workpiece, and registering the low-resolution scanning point cloud with the model point cloud to be compared, wherein the registration includes SAC-IA coarse registration and ICP fine registration;
[0062] S3, respectively cropping the low-resolution scanning point cloud and the registered model point cloud to be compared according to the processing area, so as to respectively construct octrees of the low-resolution scanning point cloud and the model point cloud to be compared, and obtaining the difference points by comparing the difference nodes of the octrees;
[0063] S4, performing super-resolution processing on the depth map of the processing area through a preset super-resolution module to obtain a super-resolution depth map;
[0064] S5, registering the super-resolution depth map and the depth map to be compared using the SIFT algorithm, and cropping the overlapping parts of the depth maps after the registration, wherein the depth map to be compared is obtained by performing a two-dimensional plane projection on the registered point cloud of the model to be compared;
[0065] S6, performing difference calculation on the cropped super-resolution depth map and the cropped depth map to be compared, extracting a portion exceeding a threshold, and obtaining a difference result depth map;
[0066] S7. Convert the difference result depth map into a point cloud, and superimpose it with the difference points to obtain a difference point cloud, and obtain the workpiece surface shape difference detection result based on the difference point cloud.
[0067] In this embodiment, the step S1 is specifically as follows:
[0068] S1-1: During the processing, obtain the low-resolution point cloud of the workpiece at this detection stage, and then project it on the projection plane to obtain a fixed-size two-dimensional depth map X a , i.e., the first two-dimensional depth map;
[0069] S1-2: During the processing, obtain the workpiece projection two-dimensional depth map X obtained in the previous detection stage b That is, the second two-dimensional depth map, and calculate X a and X b The difference value of each pixel is obtained as the difference map X c ;
[0070] S1-3: Difference map X c Binarization is performed and a closed operation is performed to obtain the difference enhancement map X d , to enhance the differences;
[0071] S1-4: Find the difference enhancement graph X d The maximum contour is obtained, and the circumscribed rectangle of the maximum contour is obtained, and the rectangle is enlarged according to a preset ratio as a processing area;
[0072] S1-5: In the depth image X a The pixel area is cut out and placed in an empty background image of a fixed size to obtain a depth map of the processed area.
[0073] In this embodiment, the low-resolution point cloud of the workpiece obtained at each detection stage in the processing is obtained through the same shooting process and has the same posture; the projection plane is specified by the user; the size of the two-dimensional depth map is a fixed value of 2048x2048; if there is no projection two-dimensional depth map X of the previous detection stage b , an empty background image of the same size is used instead; the length and width of the maximum outline circumscribed rectangle are enlarged by 1.2 times. If the rectangular processing area exceeds the background, only the part that does not exceed the background area is retained; the size of the processing area depth map is a fixed value of 512x512. If the processing area size is larger than the fixed value, the exceeding part is divided into blocks.
[0074] In this embodiment, the step S2 can refer to the process Figure 2 , specifically:
[0075] S2-1: Acquire the model point cloud to be compared and the low-resolution scanning point cloud of the workpiece, and crop the low-resolution scanning point cloud according to the processing area;
[0076] S2-2: Estimate the normal information of the point cloud using the principal component analysis (PCA) algorithm;
[0077] S2-3: Calculate the FPFH descriptor and use the SAC-IA algorithm to iteratively obtain the preliminary transformation matrix to obtain the first transformed point cloud;
[0078] S2-4: Find corresponding point pairs, calculate the rotation matrix and translation vector, and achieve precise registration by minimizing the root mean square error between corresponding point pairs;
[0079] S2-5: Set the threshold and maximum number of iterations to control the registration accuracy and time consumption, and output the fully registered point cloud data.
[0080] In this embodiment, the point cloud of the model to be compared is obtained through the high-precision point cloud of the CAD model in the detection stage during processing; the clipping process is specifically, for each point cloud data point, if its position does not fall within the processing area, the point is removed from the point cloud data.
[0081] In this embodiment, step S3 is specifically as follows:
[0082] S3-1: Clip the registered model point cloud according to the processing area;
[0083] Specifically, for each point cloud data point, if its location falls outside the rectangular processing area, the point is removed from the point cloud data.
[0084] S3-2: constructing a first octree according to the cropped scan point cloud, and constructing a second octree according to the cropped and registered model point cloud;
[0085] S3-3: Determine the difference node between the first octree and the second octree as the difference point between the scan point cloud and the model point cloud.
[0086] In this embodiment, the difference nodes of the octree refer to nodes that exist in the first octree constructed by scanning point cloud and do not exist in the second octree constructed by model point cloud after precise registration.
[0087] In this embodiment, step S4 is specifically as follows:
[0088] The preset super-resolution module is built and trained through a super-resolution network based on deep learning to obtain a pre-trained super-resolution network, and the depth map of the processing area is input to obtain a super-resolution depth map.
[0089] The super-resolution network is built by generating adversarial neural networks, which are set to include a generator G that receives raw data input and generates data close to the target, and a discriminator D that determines whether the input data comes from the data set or is synthesized by the generator. The training process of the generative adversarial network is a maximum-minimum game process:
[0090]
[0091] Where x is the real sample from the training dataset and z is the original image input.
[0092] The generator of the generative adversarial network includes two parts: the main module and the upsampling module. Figure 3 . In the main module, the image first passes through an input block, which consists of a convolutional layer of a 7x7 filter, a batch normalization operation, and a linear rectification unit (ReLU), and then passes through multiple consecutive residual blocks. The reference unit of each residual block consists of two convolutional layers of 3x3 filters, two batch normalization operations, and a ReLU. In the upsampling module, it includes two consecutive upsampling blocks and an output block. The output block uses a convolutional layer of a 7x7 filter, performs batch normalization and ReLU operations, and outputs a single-channel image of four times the original input size; the discriminator of the generative adversarial network is built using the PatchGAN architecture, which classifies the predicted output of size 70x70.
[0093] The generative adversarial network is trained by corresponding depth map training samples. The network objective loss function is combined with the content loss L c and adversarial loss L a , to capture overall structural details and high-level semantic features:
[0094] L total =λ c L c +λ a L a
[0095]
[0096] L a (G,D)=E x [log(D(x))]+E z [log(1-D(G(z)))]
[0097] In this embodiment, the number of residual blocks in the generator network is 9; the weight λ c and λ a The values of are 1 and 100; for content loss L c , L1 norm loss is used in this embodiment; x i,j and G(z) i,jRepresents the pixel values of the sample image and the generated image, W and H represent the image width and height; Adam optimizer is used for weight update, β1 = 0.5, β2 = 0.999, batch size is 8, and learning rate is set to 0.0002. If multiple processing area depth maps are included, they are spliced in the original order after all the super-resolution network outputs.
[0098] In this embodiment, the step S5 can refer to the flow chart. Figure 4 , specifically:
[0099] S5-1: Obtain a super-resolution depth map of the workpiece processing area and a depth map to be compared;
[0100] S5-2: Use SIFT algorithm to extract key points and feature descriptors of super-resolution depth map and depth map to be compared;
[0101] S5-3: Match the key points of the two depth maps, and filter and remove the wrong matching points;
[0102] S5-4: Calculate the homography matrix between the super-resolution depth map and the depth map to be compared according to the screened matching points, and use the homography matrix to perspective transform the super-resolution depth map into the coordinate system of the depth map to be compared;
[0103] S5-5: Create two blank backgrounds of the same size, and save the overlapping parts as the overlapping parts in the super-resolution depth map and the depth map to be compared.
[0104] In this embodiment, the depth map to be compared is obtained by two-dimensional plane projection of a high-precision point cloud of a CAD model registered at the detection stage during processing.
[0105] In this embodiment, step S6 is specifically as follows:
[0106] S6-1: Read the cropped super-resolution depth map and the cropped depth map to be compared and perform difference calculation.
[0107] S6-2: Set the threshold and create a binary image mask to mark the part exceeding the pixel threshold. Create an all-zero array of the same shape as the comparison result array, then extract the part exceeding the pixel threshold from the cropped super-resolution depth map and assign it to the all-zero array as the result of difference detection.
[0108] In this embodiment, the pixel threshold is set to 30.
[0109] In this embodiment, step S7 is specifically as follows:
[0110] S7-1: Read the difference result depth map generated in step S6, and convert the depth map into a difference point cloud. The specific process is:
[0111] The depth value of each pixel in the depth map is projected into three-dimensional space to generate the corresponding three-dimensional coordinates and mark the difference coordinates.
[0112] Create a point cloud object containing all generated 3D coordinate points and marked difference points.
[0113] S7-2: Superimpose the difference point cloud determined in step S3 with the difference point cloud generated in step S7-1. The specific process is:
[0114] The difference points determined in step S3 are read, and a point cloud object is created, including the difference points.
[0115] The point cloud object generated in step S7-1 is merged with the point cloud object generated in step S3 to form a new point cloud object including all the difference points.
[0116] S7-3: Output the final difference point cloud, obtain the final workpiece surface shape difference detection result based on the difference point cloud, and complete the shape difference detection.
[0117] Example 2
[0118] like Figure 5 As shown, a system for detecting surface shape differences of a workpiece comprises:
[0119] The area detection unit 10 is used to obtain a low-resolution scanning point cloud of the workpiece and convert it into a two-dimensional depth map, and perform processing area detection on the two-dimensional depth map through a preset processing area detection module to obtain a processing area depth map;
[0120] The three-dimensional registration unit 20 is used to obtain the model point cloud to be compared of the workpiece, and to register the low-resolution scanning point cloud with the model point cloud to be compared, wherein the registration includes SAC-IA coarse registration and ICP fine registration;
[0121] The first determining unit 30 is used to respectively crop the low-resolution scanning point cloud and the registered model point cloud to be compared according to the processing area, so as to respectively construct an octree of the low-resolution scanning point cloud and the model point cloud to be compared, and obtain a difference point by comparing the difference nodes of the octree;
[0122] Super-resolution unit 40: used to perform super-resolution processing on the depth map of the processing area through a preset super-resolution module to obtain a super-resolution depth map;
[0123] A two-dimensional registration unit 50 is used to register the super-resolution depth map and the depth map to be compared using the SIFT algorithm, and to crop the overlapping part of the depth map after the registration, wherein the depth map to be compared is obtained by performing a two-dimensional plane projection on the registered point cloud of the model to be compared;
[0124] The second determining unit 60 is used to perform difference calculation on the cropped super-resolution depth map and the cropped depth map to be compared, extract the part exceeding the threshold, and obtain a difference result depth map;
[0125] The difference detection result generating unit 70 is used to convert the difference result depth map into a point cloud, and superimpose it with the difference points to obtain a difference point cloud, and obtain the workpiece surface shape difference detection result based on the difference point cloud.
[0126] One implementation of the above system is that, in the area detection unit 10, a low-resolution scanning point cloud of the workpiece is obtained and converted into a two-dimensional depth map, and a processing area detection is performed on the two-dimensional depth map through a preset processing area detection module to obtain a processing area depth map, and in the three-dimensional registration unit 20, a model point cloud to be compared of the workpiece is obtained, and the low-resolution scanning point cloud and the model point cloud to be compared are registered, and the registration includes SAC-IA coarse registration and ICP fine registration, and in the first determination unit 30, the low-resolution scanning point cloud and the registered model point cloud to be compared are respectively cropped according to the processing area to construct octrees of the low-resolution scanning point cloud and the model point cloud to be compared respectively, and the difference points are obtained by comparing the difference nodes of the octree, and in the super-resolution unit 40, The depth map of the processing area is super-resolution processed by a preset super-resolution module to obtain a super-resolution depth map. In the two-dimensional registration unit 50, the super-resolution depth map and the depth map to be compared are registered using the SIFT algorithm, and the overlapping part of the depth map after registration is cropped, wherein the depth map to be compared is obtained by performing a two-dimensional plane projection on the registered model point cloud to be compared. In the second determination unit 60, the difference between the cropped super-resolution depth map and the cropped depth map to be compared is calculated, and the part exceeding the threshold is extracted to obtain a difference result depth map. In the difference detection result generation unit 70, the difference result depth map is converted into a point cloud and superimposed with the difference point to obtain a difference point cloud, and the workpiece surface shape difference detection result is obtained based on the difference point cloud.
[0127] Example 3
[0128] Based on the above embodiments, this embodiment provides an electronic device.
[0129] Example 4
[0130] Based on the above embodiments, this embodiment provides a storage medium.
[0131] The above description is only a specific embodiment of the present invention, but the technical features of the present invention are not limited thereto. Any changes or modifications made by any technician in the field of the present invention are included in the patent scope of the present invention.
Claims
1. A method for detecting a difference in workpiece surface shape, characterized in that: include: Obtain a low-resolution scanning point cloud of the workpiece and convert it into a two-dimensional depth map, perform processing area detection on the two-dimensional depth map through a preset processing area detection module, and obtain a processing area depth map; Obtain the model point cloud of the workpiece to be compared, and align the low-resolution scanning point cloud and the model point cloud to be compared, including SAC-IA coarse registration and ICP fine registration; The low-resolution scanning point cloud and the registered model point cloud to be compared are respectively cropped according to the processing area to construct the octrees of the low-resolution scanning point cloud and the model point cloud to be compared, and the difference points are obtained by comparing the difference nodes of the octrees; Performing super-resolution processing on the depth map of the processing area through a preset super-resolution module to obtain a super-resolution depth map; The super-resolution depth map and the depth map to be compared are registered using the SIFT algorithm, and the overlapping parts of the registered depth maps are cropped, wherein the depth map to be compared is obtained by performing a two-dimensional plane projection on the registered point cloud of the model to be compared; The difference between the cropped super-resolution depth map and the cropped depth map to be compared is calculated, and the portion exceeding the threshold is extracted to obtain a difference result depth map; The difference result depth map is converted into a point cloud and superimposed with the difference points to obtain a difference point cloud, and the workpiece surface shape difference detection result is obtained based on the difference point cloud.
2. A method for detecting surface shape differences of a workpiece according to claim 1, characterized in that: The low-resolution scanning point cloud of the workpiece is obtained and converted into a two-dimensional depth map. The processing area detection module is used to perform processing area detection on the two-dimensional depth map to obtain the processing area depth map, which is specifically: Obtaining a low-resolution scanning point cloud of the workpiece at the current detection stage, and projecting the low-resolution scanning point cloud onto a projection plane to obtain a first two-dimensional depth map; Obtaining a second two-dimensional depth map of the workpiece in the previous detection stage, calculating a difference value of each pixel between the first two-dimensional depth map and the second two-dimensional depth map, and obtaining a difference map; Binarize the difference map and perform a closing operation to obtain a difference enhancement map; Find the maximum contour of the difference enhancement image, obtain the circumscribed rectangle of the maximum contour, and enlarge the rectangle according to a preset ratio as the processing area; The pixel area of the processing area is cut out from the first two-dimensional depth map and placed in an empty background image of a fixed size to obtain a depth map of the processing area.
3. The method for detecting the difference in workpiece surface shape according to claim 1, characterized in that: The low-resolution scan point cloud and the model point cloud to be compared are registered. The registration includes SAC-IA coarse registration and ICP fine registration, specifically: The normal information of low-resolution scanned point clouds is estimated using principal component analysis algorithm; Calculate the FPFH descriptor and use the SAC-IA algorithm to iteratively obtain the preliminary transformation matrix to obtain the first transformed point cloud; Find the corresponding point pairs, calculate the rotation matrix and translation vector, and perform ICP precise registration by minimizing the root mean square error between the corresponding point pairs; Set the threshold and maximum number of iterations to output the fully aligned point cloud data.
4. The method for detecting the difference in workpiece surface shape according to claim 1, characterized in that: The low-resolution scanned point cloud and the registered model point cloud to be compared are cropped according to the processing area to construct the octrees of the low-resolution scanned point cloud and the model point cloud to be compared. The difference points are obtained by comparing the difference nodes of the octrees, specifically: Crop the low-resolution scanned point cloud according to the processing area, and crop the aligned model point cloud to be compared according to the processing area; A first octree is constructed according to the cropped low-resolution scanned point cloud, and a second octree is constructed according to the cropped registered model point cloud to be compared; The difference nodes between the first octree and the second octree are calculated to obtain the difference points between the low-resolution scanned point cloud and the aligned model point cloud to be compared.
5. The method for detecting the difference in workpiece surface shape according to claim 1, characterized in that: The depth map of the processing area is processed by super-resolution through the preset super-resolution module to obtain a super-resolution depth map, which is specifically: An adversarial neural network is constructed to obtain a super-resolution network, the super-resolution network is trained to obtain a pre-trained super-resolution network, and the depth map of the processing area is input into the pre-trained super-resolution network to obtain a super-resolution depth map.
6. The method for detecting the difference in workpiece surface shape according to claim 1, characterized in that: The super-resolution depth map and the depth map to be compared are registered using the SIFT algorithm, and the overlapping parts of the depth maps after registration are cropped, specifically: Use SIFT algorithm to extract key points and feature descriptors of super-resolution depth map and depth map to be compared; Match the key points of the super-resolution depth map and the depth map to be compared, and filter and remove incorrect matching points; According to the screened matching points, the homography matrix between the super-resolution depth map and the depth map to be compared is calculated, and the super-resolution depth map is perspective-transformed into the coordinate system of the depth map to be compared using the homography matrix; Create two blank backgrounds of the same size and save the overlapping parts as the super-resolution depth map and the overlapping part of the depth map to be compared.
7. The method for detecting the difference in workpiece surface shape according to claim 1, characterized in that: The difference between the cropped super-resolution depth map and the cropped depth map to be compared is calculated, and the part exceeding the threshold is extracted to obtain the difference result depth map, which is specifically: Calculate the difference between the cropped super-resolution depth map and the cropped depth map to be compared; Set the threshold and create a binary image mask, mark the part exceeding the pixel threshold, create an all-zero array of the same shape as the comparison result array, then extract the part exceeding the pixel threshold from the cropped super-resolution depth map and assign it to the all-zero array, and use the super-resolution depth map marked with the binary image mask as the difference result depth map.
8. A system for detecting differences in workpiece surface shape, characterized in that: include: Area detection unit: used to obtain the low-resolution scanning point cloud of the workpiece and convert it into a two-dimensional depth map. The two-dimensional depth map is used to detect the processing area through a preset processing area detection module to obtain a processing area depth map; 3D registration unit: used to obtain the model point cloud to be compared of the workpiece, and to register the low-resolution scanning point cloud with the model point cloud to be compared. The registration includes SAC-IA coarse registration and ICP fine registration. The first determination unit is used to respectively crop the low-resolution scanning point cloud and the registered model point cloud to be compared according to the processing area, so as to respectively construct an octree of the low-resolution scanning point cloud and the model point cloud to be compared, and obtain the difference point by comparing the difference nodes of the octree; Super-resolution unit: used to perform super-resolution processing on the depth map of the processing area through a preset super-resolution module to obtain a super-resolution depth map; Two-dimensional registration unit: used to register the super-resolution depth map and the depth map to be compared using the SIFT algorithm, and to crop the overlapping part of the depth map after registration, wherein the depth map to be compared is obtained by performing two-dimensional plane projection on the point cloud of the model to be compared after registration; The second determining unit is used to perform difference calculation on the cropped super-resolution depth map and the cropped depth map to be compared, extract the part exceeding the threshold, and obtain a difference result depth map; Difference detection result generation unit: used to convert the difference result depth map into a point cloud, and superimpose it with the difference point to obtain a difference point cloud, and obtain the workpiece surface shape difference detection result based on the difference point cloud.
9. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement a method for detecting a difference in the surface shape of a workpiece as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: When the computer program stored in the storage medium is executed by a computer, a method for detecting a difference in the surface shape of a workpiece as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Auxiliary machining quality evaluation method based on three-dimensional point cloud data, medium and equipment
CN119444736A
