Workpiece parallelism detection method and device, medium and equipment

Through collaborative analysis of multimodal data and complex detection models, the problems of low efficiency and insufficient accuracy of workpiece parallelism measurement in the prior art are solved, high-precision parallelism detection and visual positioning of deformation areas are realized, and detection efficiency and accuracy are improved.

CN120388017AActive Publication Date: 2025-07-29NINGJIANG MASCH TOOL GRP CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510875373.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-07-29
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

The prior art is inefficient in the parallelism measurement of workpieces, is susceptible to human operation errors and environmental interference, and is difficult to fully capture the subtle deformation of complex three-dimensional structures, and lacks the ability to collaborate multimodal data analysis, resulting in fuzzy positioning of parallelism error distribution and insufficient correction basis, which cannot meet the needs of high-precision, automation and visualization of defective hot zones.

Method used

The multimodal data collaborative analysis of three-dimensional point clouds and two-dimensional images is adopted, and combined with dynamic graph construction, deformable graph convolution, multi-scale attention mechanism and cross-modal cross-attention technology, a parallelism detection model is built. By fusing the three-channel input layer, feature extraction layer, geometric analysis layer and output layer, high-precision and automated parallelism detection are achieved.

Benefits of technology

It realizes high-precision workpiece parallelism detection, outputs global error values and precise positioning of local deformation areas, provides visual basis, and significantly improves detection efficiency, accuracy and industrial scenario adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120388017A_ABST
    Figure CN120388017A_ABST
Patent Text Reader

Abstract

The invention discloses a workpiece parallelism detection method and device, a medium and equipment, and the method comprises the steps: obtaining parallelism reference data of the surfaces of two sides of a standard workpiece, and obtaining a three-dimensional point cloud image and a two-dimensional image of the surfaces of two sides of a to-be-detected workpiece; constructing a parallelism detection model and training the parallelism detection model; and inputting the parallelism reference data of the two side surfaces of the standard workpiece and the three-dimensional point cloud image and the two-dimensional image of the two side surfaces of the to-be-detected workpiece into a trained parallelism detection model, and outputting a parallelism error value and a thermodynamic diagram of the to-be-detected workpiece. According to the invention, the parallelism error of the workpiece can be accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of industrial automation and intelligent manufacturing, and specifically relates to a method, device, medium and equipment for detecting the parallelism of workpieces. Background Art

[0002] The existing technology for measuring the parallelism of workpieces mainly relies on manual use of contact tools such as dial indicators and coordinate measuring machines (CMMs) for single-point or local sampling, or is based on single-modal data (such as two-dimensional images or simple three-dimensional point clouds). The above methods have problems such as low efficiency, being easily affected by human operation errors and environmental interference (such as image distortion caused by uneven illumination), and being difficult to comprehensively capture the subtle deformations of the complex three-dimensional structure of workpieces. Moreover, they lack the ability to synergistically analyze multi-modal data (three-dimensional geometry and two-dimensional texture), resulting in fuzzy positioning of parallelism error distribution and insufficient basis for correction, and cannot meet the requirements for high-precision, automation and visualization of defect hotspots in industrial scenarios. Summary of the Invention

[0003] Aiming at the deficiencies in the existing technology, the purpose of this application is to provide a method, device, medium and equipment for detecting the parallelism of workpieces, and this application can accurately detect the parallelism error of workpieces.

[0004] To achieve the above purpose, this application provides the following technical solutions: A method for detecting the parallelism of workpieces, the method includes: obtaining the parallelism reference data of the two side surfaces of a standard workpiece, and obtaining the three-dimensional point cloud map and two-dimensional image of the two side surfaces of a workpiece to be measured; constructing a parallelism detection model and training it; inputting the parallelism reference data of the two side surfaces of the standard workpiece, the three-dimensional point cloud map and two-dimensional image of the two side surfaces of the workpiece to be measured into the trained parallelism detection model, and outputting the parallelism error value and heat map of the workpiece to be measured.

[0005] Optionally, the parallelism detection model includes: an input layer, a feature extraction layer, a geometric analysis layer and an output layer. Among them, the input layer has three channels, which are respectively used to input the parallelism basic data of the standard workpiece, the three-dimensional point cloud map and two-dimensional image of the workpiece to be measured; the feature extraction layer includes a reference feature extraction sub-network, a three-dimensional point cloud feature extraction sub-network and a two-dimensional image feature extraction sub-network. Among them, the reference feature extraction sub-network is used to encode the parallelism basic data into a conditional vector; the three-dimensional point cloud feature extraction sub-network is used to extract features from the three-dimensional point cloud map to obtain three-dimensional point cloud features; the two-dimensional image feature extraction sub-network is used to extract features from the two-dimensional image to obtain two-dimensional image features; the geometric analysis layer is used to perform geometric analysis on the workpiece to be measured based on the parallelism basic data and the extracted three-dimensional point cloud features and two-dimensional image features, and output the parallelism error and heat map of the workpiece to be measured through the output layer.

[0006] Optionally, the parallelism detection model is trained through the following steps: Collect the three-dimensional point cloud data, two-dimensional image data of multiple workpieces with labeled parallelism error values, and the parallelism basic data of the standard workpiece to form a data set, and divide the data set into a training set and a validation set; Set the training parameters, and use the training set to train the model until the maximum number of iterations is satisfied; Use the validation set to verify the trained model. During the verification process, if the mean absolute error, mean square error, and root mean square error, which are used as model performance evaluation indicators, are all less than the threshold, the model verification passes; otherwise, adjust the training parameters or expand the training set samples to retrain the model until the verification passes.

[0007] The present application also provides a workpiece parallelism detection device, which includes: an acquisition module for acquiring the parallelism reference data of the two side surfaces of the standard workpiece, and obtaining the three-dimensional point cloud map and two-dimensional image of the two side surfaces of the workpiece to be measured; a model construction and training module for constructing and training a parallelism detection model; a detection module for inputting the parallelism reference data of the two side surfaces of the standard workpiece, the three-dimensional point cloud map and two-dimensional image of the two side surfaces of the workpiece to be measured into the trained parallelism detection model, and outputting the parallelism error value and heat map of the workpiece to be measured.

[0008] The present application also provides a storage medium, which includes instructions that, when running on a computer, cause the computer to execute a workpiece parallelism detection method as described in any one of the previous items.

[0009] The present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements a workpiece parallelism detection method as described in any one of the previous items when executing the program.

[0010] Compared with the prior art, the beneficial effects brought by the present application are: Through the collaborative analysis of multi-modal data that fuses three-dimensional point cloud and two-dimensional image, combined with dynamic graph construction, deformable graph convolution, multi-scale attention mechanism, and cross-modal cross-attention technology, the present application realizes high-precision and automated workpiece parallelism detection, effectively overcoming the problems of low efficiency, susceptibility to interference, and limitations of single-modal data in traditional contact measurement; the globally output error value and heat map not only quantify the parallelism deviation, but also accurately locate the local deformation area (such as the maximum error heat zone), providing a visual basis for process optimization and repair, and significantly improving the detection efficiency, accuracy, and industrial scenario adaptability. Description of the Drawings

[0011] Figure 1 It is a schematic flowchart of a workpiece parallelism detection method provided by an embodiment of the present application; Figure 2It is a schematic structural diagram of a parallelism detection model provided by another embodiment of the present application; Figure 3 It is a three-dimensional point cloud diagram of the two side surfaces of a workpiece provided by another embodiment of the present application; Figure 4 It is a schematic diagram of the Y-Z plane of the workpiece projected from the positive X direction provided by another embodiment of the present application; Figure 5 It is a schematic diagram of the X-Z plane of the workpiece projected from the positive Y direction provided by another embodiment of the present application; Figure 6 It is a thermal diagram of the workpiece provided by another embodiment of the present application; Figure 7 It is a schematic structural diagram of a workpiece parallelism detection device provided by another embodiment of the present application. Detailed implementation manners

[0012] Hereinafter, specific embodiments of the present application will be described in detail with reference to the accompanying drawings. Although specific embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0013] It should be noted that certain terms are used in the specification and claims to refer to specific components. Those skilled in the art should understand that technicians may use different terms to refer to the same component. The specification and claims do not use the difference in terms as a way to distinguish components, but use the difference in functions of components as the criterion for distinction. As used throughout the specification and claims, the terms "comprising" or "including" are open-ended terms and should be interpreted as "including but not limited to". The subsequent description of the specification is for the purpose of describing the preferred implementation manner of the present application, but the description is for the general purpose of the specification and is not intended to limit the scope of the present application. The protection scope of the present application shall be determined by the scope defined by the appended claims.

[0014] For the convenience of understanding the embodiments of the present application, the following will further explain with specific embodiments as examples in conjunction with the accompanying drawings, and each accompanying drawing does not constitute a limitation to the embodiments of the present application.

[0015] Figure 1 It is a schematic structural diagram of a workpiece parallelism detection method provided by an exemplary embodiment of the present application. As Figure 1 shown, the method includes the following steps: S100: Acquire parallelism benchmark data for both sides of the standard workpiece. Scan the workpiece 360° using a laser scanner to obtain a 3D point cloud image of both sides of the workpiece. Simultaneously, capture a 2D image of both sides of the workpiece. The parallelism benchmark data for both sides of the standard workpiece includes the ideal normal vector, ideal curvature distribution, key feature areas (specific areas on the standard workpiece that significantly affect parallelism, typically edges, holes, protrusions, or areas sensitive to local deformation), and reference directions. The workpieces include, but are not limited to, circular workpieces such as automotive drive shafts, pump housings, and steel pipes; rectangular workpieces such as machine tool worktables, switch cabinet door panels, and circuit boards; and other geometric workpieces with parallel sides.

[0016] S200: Build and train a parallelism detection model; S300: Inputting the parallelism reference data of the two side surfaces of the standard workpiece, the three-dimensional point cloud map and the two-dimensional image of the two side surfaces of the workpiece to be measured into the trained parallelism detection model, and outputting the parallelism error value and the thermal map of the workpiece to be measured.

[0017] In another exemplary embodiment, in step S300, Figure 2 As shown, the parallelism detection model includes: an input layer, a feature extraction layer, a cross-modal attention layer, a geometric analysis layer and an output layer, wherein the input layer adopts three channels, which are used to input the basic parallelism data of the standard workpiece, the three-dimensional point cloud map and the two-dimensional image of the workpiece to be tested.

[0018] The feature extraction layer includes a reference feature extraction subnetwork, a three-dimensional point cloud feature extraction subnetwork and a two-dimensional image feature extraction subnetwork, wherein the reference feature extraction subnetwork includes a fully connected layer for encoding the parallelism basic data into a conditional vector .

[0019] The three-dimensional point cloud feature extraction subnetwork includes an input preprocessing layer, a dynamic graph construction module, a multi-scale attention fusion layer, a global Transformer module, a lightweight feature compression module and an output layer. The input preprocessing layer is used to input the three-dimensional point cloud image of the workpiece to be measured, and normalize the three-dimensional point cloud coordinates in the local coordinate system through adaptive normalization, with the center of mass of the workpiece as the origin to eliminate the influence of translation invariance; in addition, the input preprocessing layer also introduces random geometric enhancement to apply random small-angle rotation (±5°) and scale jitter (±5°) to the three-dimensional point cloud image to improve the robustness of the model. The input preprocessing layer outputs the normalized three-dimensional point cloud image with enhanced geometric transformation parameters.

[0020] The dynamic graph construction module takes the preprocessed three-dimensional point cloud map as input, and uses an adaptive neighborhood construction strategy (KNN + radius search) and deformable graph convolution to dynamically capture the local geometric structure of the point cloud and generate multi-scale features. The adaptive neighborhood construction strategy includes: using KNN for dense regions (such as edges and holes), that is, for each center point, select its K = 16 nearest neighbor nodes to form a neighborhood set to fix the number of neighborhoods and ensure the stability of feature extraction in dense regions. For sparse regions, use radius search, that is, with the center point as the center, for example, set the radius r = 0.1m, and select all points within this range as the neighborhood set to adaptively adjust the neighborhood range and cover the potential structure of the sparse region, thus avoiding missed detection. Specifically, the dynamic graph construction module performs neighborhood searches with three radii (0.05m, 0.1m, 0.2m) for each point of the preprocessed three-dimensional point cloud, and independently applies deformable graph convolution to each scale of the neighborhood to generate features of different scales, specifically including: fine scale (radius 0.05m): capturing minute deformations (such as edge burrs and local depressions), suitable for high-density regions. Medium scale (radius 0.1m): balancing details and efficiency, and extracting the overall shape of the local region (such as holes and inclined planes). Coarse-grained scale (radius 0.2m): covering a larger range and reflecting the global geometric trend of the workpiece (such as overall tilt and symmetry).

[0021] The deformable graph convolution refers to adding deformable offset learning on the basis of traditional graph convolution to dynamically adjust the geometric weights of neighboring points to enhance the model's adaptability to local deformations. The deformable graph convolution first predicts the spatial offset of each neighboring point relative to the center point through a lightweight convolutional layer, then adjusts the position of the neighboring points according to the offset, and finally calculates the weighted features using the adjusted positions, that is:

[0022] Among them, represents the output feature of node ; represents a learnable weight matrix for linearly transforming the features of neighboring node ; represents the original input features (such as coordinates and curvature) of neighboring node ; represents the learnable spatial offset of neighboring node relative to node ; represents the offset activation function.

[0023] The features of each of the above scales are generated into three feature maps through independent deformable graph convolutions, which are respectively denoted as 、 and .

[0024] The multi-scale attention fusion layer includes a channel-spatial dual attention mechanism to fuse the feature maps extracted at three scales 、 and to form a multi-scale feature map. First, the channel attention mechanism compresses the feature maps 、 and along the spatial dimension respectively, then learns the relationship between channels through a fully connected layer, outputs scale-level weights, and applies the scale-level weights to the feature maps of the corresponding scales. After multiplying element-wise by channels, the channel-weighted feature maps are obtained. The spatial attention mechanism captures the spatial context of the channel-weighted feature map through 3D convolution and generates a spatial attention map . Finally, the spatial attention map is multiplied element-wise with the channel-weighted feature map , and the channel dimension is compressed through 2D convolution to generate the final multi-scale feature map .

[0025] The global Transformer module takes the multi-scale feature map as input. First, it downsamples to 512 key points through FPS (furthest point sampling) to reduce the computational amount. Secondly, local windows (each group contains 32 points) are divided on the 512 downsampled key points. For the 32 points in each window, the attention weights are calculated respectively to capture the local geometric relationship and long-range dependence relationship, and each window outputs local features .

[0026] Furthermore, the global Transformer module selects a representative point (such as the centroid point) from each window to form a set of proxy points, calculates the global attention weights for the set of proxy points, and obtains the global feature . Subsequently, the global feature is broadcast to each window, added element-wise with the local feature , and the features of all points in the window are aggregated through max pooling. Finally, the global semantic feature G is generated, and the global semantic feature G contains the overall structural information of the workpiece.

[0027] In summary, the global Transformer module downsamples the multi-scale feature map Downsampling to 512 key points can significantly reduce the computational complexity while retaining the key geometric information of the workpiece. Subsequently, the point cloud is divided into local windows (32 points per group). Within the windows, self-attention mechanism is used to capture local geometric dependencies, and cross-window interaction is combined to achieve dynamic fusion of global semantic features. This module utilizes fine-grained analysis within the windows and long-range cross-window correlations, and can effectively integrate local details of the workpiece (such as edge deformation) and overall structural trends (such as tilt direction), outputting a feature vector containing global semantics, which can provide a robust geometric context for subsequent parallelism error calculation, and has the characteristics of high efficiency, dynamic adaptability (supporting point clouds with uneven density) and sensitivity to complex deformations, which helps to improve the detection accuracy and scene generalization ability.

[0028] The lightweight feature compression layer takes the global semantic feature G as input. First, it adaptively selects key points through a dynamic max pooling layer. The dynamic max pooling layer can dynamically adjust the pooling region according to the feature response intensity, and preferentially retain geometrically significant regions (such as the maximum error hot zone, edge mutation points). The positions of the key points are determined by combining a sliding window strategy with local gradient analysis to ensure that the details in the high-error regions are not lost. Subsequently, depthwise separable convolution is used for feature compression. It extracts local geometric patterns through per-channel spatial convolution and then fuses cross-channel information through pointwise convolution, retaining the core semantics of multi-scale features while reducing the number of parameters (the number of parameters is only 1 / 8 - 1 / 9 of that of standard convolution), and finally outputs a compact feature (such as the dimension is compressed from 512×256 to 512×64). By compressing the global semantic feature G, the lightweight feature compression layer can not only reduce the subsequent computational complexity, but also ensure the high-fidelity transmission of key deformation information (such as local tilt angle, abnormal surface curvature), laying an efficient and robust feature foundation for the accurate calculation of parallelism error and the generation of heat maps.

[0029] The output layer uses skip connections, taking the feature maps 、 、 output by the dynamic graph construction module and the global semantic feature G after lightweight feature compression as inputs and fusing them through channel concatenation, and finally outputs the global feature of the 3D point cloud , and inputs it into the subsequent fusion layer for parallelism error calculation.

[0030] The two-dimensional image feature extraction sub-network includes an input layer, a dynamic deformable convolution module, a multi-scale attention pyramid, and a local-global vision Transformer module. Among them, the input layer is used to take the Y-Z plane diagram projected in the positive X direction and the X-Z plane diagram projected in the positive Y direction as dual-channel inputs respectively to form a feature map of multi-view fusion .

[0031] The dynamic deformable convolution module includes a normalization layer, a deformable convolution layer, and a depthwise separable convolution layer. The normalization layer performs adaptive histogram equalization on the input feature map to eliminate the interference of uneven illumination.

[0032] The deformable convolution layer first predicts the offset from the normalized feature map through the following formula:

[0033] where represents the weight parameter of the offset generation convolution layer.

[0034] Then, for each sampling point position of the standard convolution kernel, the actual sampling position is adjusted according to the offset :

[0035] where represents the coordinate of the th sampling point of the standard convolution kernel; represents the coordinate of the th sampling point after dynamic adjustment.

[0036] Finally, weighted summation is performed on the adjusted sampling points to generate the output feature map :

[0037] where represents the number of sampling points of the convolution kernel; represents the weight parameter of the standard convolution kernel.

[0038] The depthwise separable convolution layer first performs spatial convolution on each channel of the input output feature map independently, and outputs the depthwise convolution output feature map . Then, pointwise convolution is used to fuse cross-channel information, and the pointwise convolution output feature map is output.

[0039] Finally, the dynamic deformable convolution module uses residual connection to add the input feature map and the pointwise convolution output feature map element-wise to obtain the final output feature map (including the initial information retained through residual connection and the local deformation features of the workpiece, such as edge distortion, holes, etc.).

[0040] The local-global vision Transformer module first processes the input final output feature map by performing dynamic window partitioning, that is, dynamically adjusting the window size according to the local complexity of the feature map such as the gradient variance. For high-complexity regions (such as edges and deformation regions), small windows (such as 4×4) are used to finely capture details, and for low-complexity regions (such as flat surfaces), large windows (such as 16×16) are used to accelerate calculations.

[0041] The local-global vision Transformer module introduces a skip local attention mechanism. This mechanism first calculates the standard self-attention for each window to generate local features , then uses the [CLS] token (Classification Token) of each window as a global proxy for cross-window interaction, and passes information through a lightweight fully connected layer to generate cross-window correlation weights . Finally, the local features are weighted and fused with the cross-window correlation weights to generate enhanced features .

[0042] Finally, the local-global vision Transformer module performs global average pooling on the enhanced features to obtain the semantic vector E, and broadcasts E to the same size as the enhanced features , and multiplies it channel by channel with the enhanced features to highlight the globally semantic-related regions , and adds the feature map to the globally semantic-related regions to obtain the two-dimensional image features that combine local details and global semantics .

[0043] The cross-modal cross-attention layer uses the conditional vector and the global feature of the three-dimensional point cloud (the conditional vector is incorporated as an additional condition through concatenation into , that is as the Query (each three-dimensional point represents a key position on the workpiece surface (such as the centroid, edge point), carrying geometric offset information (coordinates, curvature, etc.) and the reference direction). Using the two-dimensional image features (including texture, edge, color, etc.) as the Key and Value (Key is used to calculate similarity, and Value is used to transfer features), guiding the three-dimensional point cloud features to focus on the corresponding regions in the two-dimensional image.

[0044] Specifically, for each feature point in the 3D point cloud (denoted as query ), calculate its similarity score with all feature regions in the 2D image (denoted as key K) :

[0045] where represents the query matrix, which is generated by fusing the global features of the 3D point cloud and the conditional vector ; K represents the 2D image feature , represents the transpose; represents and the dimension of each vector in K; represents calculating the dot product of each query vector in

[0046] with all key vectors in K; Softmax represents normalizing the attention scores for each query to generate attention weights. The above formula guides the extraction of the most relevant information from the 2D image for the 3D point cloud features by calculating the similarity between and all K. For example, if the 3D point cloud feature

[0047] represents the left edge of the workpiece, its similarity score with the left edge region (K) in the image is the highest. Furthermore, perform softmax normalization on all similarity scores for each 3D point cloud feature to generate attention weights, where the larger the weight value, the stronger the correlation between the 3D point cloud feature and the 2D image feature K. For example, if the 3D point cloud feature

[0048] corresponds to the upper left corner edge of the workpiece, its attention weight reaches a peak in the upper left corner edge pixel region of the 2D image. Finally, according to the attention weight matrix, perform weighted summation on the 2D image features (denoted as value V) to generate the fused 3D feature

[0049] and output it by the output layer. Perform geometric analysis to calculate the parallelism error on both sides of the workpiece to be measured. The geometric analysis layer includes: a dynamic block module, a local normal vector extraction and alignment degree calculation module, a weight adaptive mechanism, and a global error aggregation and heat map generation module. Among them, the dynamic block module dynamically divides the point cloud data of the workpiece to be measured based on the reference data of the standard workpiece (such as including the ideal curvature distribution, key feature regions). For example, for high-density regions (such as edges, holes), small grids (such as 5mm×5mm) are used, and combined with the sensitive regions marked in the reference data (such as easily deformed parts), priority is given to encrypting the blocks to ensure high-precision capture of local deformations; for low-density regions (such as flat surfaces), large grids (such as 20mm×20mm) are used, and the grid size is dynamically switched through the curvature threshold in the reference data to balance the calculation efficiency and coverage. Then, a unique identifier (such as B-{region number}-{reference label}) is generated for each block, and the corresponding block information of the standard workpiece (such as the ideal normal vector, allowable error threshold) is bound to achieve precise mapping between the measured blocks and the reference data.

[0050] The local normal vector extraction and alignment degree calculation module uses the ideal normal vector of the standard workpiece as the reference direction to calculate the two-dimensional alignment degree of the local normal vector of each block of the workpiece to be measured , specifically including: 1. Calculate the global included angle error with the global reference direction of the same-side surface of the workpiece :

[0051] 2. Calculate the local included angle error with the normal vector of the corresponding block of the standard workpiece :

[0052] 3. The final alignment error is a weighted comprehensive value:

[0053] where represents the weight coefficient, which is used to balance the influence of the global included angle error and the local included angle error .

[0054] The weight adaptive mechanism uses the final alignment error , the variance of the point cloud curvature within the block , and the projected area of the block on the plane perpendicular to the reference direction As the input, first perform the basic weight calculation:

[0055] Among them, , represents the adjustment coefficient, which is used to control the contribution intensity of curvature and error to the weight respectively; represents the basic weight.

[0056] Secondly, perform the area weight correction:

[0057] Among them, represents the corrected area weight of the th item; represents the projected area of the block on the plane perpendicular to the reference direction.

[0058] The global error aggregation and heat map generation module first synthesizes the weight and the error to calculate the global error :

[0059] Among them, represents the total number of data points participating in the calculation.

[0060] And further calculate the minimum value , maximum value and standard deviation of all block errors, which are used for heat map color mapping and key block screening.

[0061] Secondly, perform heat map generation, specifically including: 1. Project the three-dimensional point cloud of each block onto the plane perpendicular to the reference direction (such as the XY plane), and retain its two-dimensional coordinate range.

[0062] Example: If the reference direction is the Z axis, the projected coordinates are (x, y).

[0063] 2. Perform color coding Mapping rule: Color intensity and error are linearly or non-linearly correlated. For example:

[0064] Color scheme: blue ( ), the error is close to the minimum value; red ( ), the error is close to the maximum value.

[0065] Finally, block rendering is performed, specifically including: filling each block with a rectangular or fan-shaped area of corresponding color intensity according to the projection coordinate range, and marking the boundaries, that is, superimposing the block boundary lines to distinguish the coverage of different blocks.

[0066] 3. Screen key blocks First, perform dynamic threshold calculation:

[0067] in, represents the dynamic threshold parameter; represents the sensitivity coefficient, represents the standard deviation of all block errors.

[0068] Next, mark the key areas: Define the filter criteria: ; Output marking information, including: block 3D coordinate range, error value and heat maps are marked with high-volume borders or symbols (such as red boxes).

[0069] The final output includes: global parallelism error value Error (quantifies the overall parallelism quality of the workpiece, used for qualification judgment, such as is qualified) and heat map (including color gradient (indicating error distribution), block boundary lines and color bars and coordinate axis labels).

[0070] For example, this application takes a cylindrical workpiece (such as a car transmission shaft) as an example and performs parallelism detection on it using the method described in this application.

[0071] First, a laser scanner is used to scan and obtain the three-dimensional point cloud images of the surfaces of both sides of the cylindrical workpiece (such as Figure 3 As shown), at the same time, two-dimensional images of both sides of the cylindrical workpiece are obtained (as shown Figure 4 and Figure 5 As shown, Figure 4 is the YZ plane graph projected from the positive X direction, Figure 5 is the XZ plane projected from the positive Y direction).

[0072] Secondly, Figure 3 The three-dimensional point cloud shown in Figure 4 as well as Figure 5 The two-dimensional image shown is input into the parallelism detection model for detection, and the specific detection results are as follows: Global parallelism error index: Mean Error: 1.2 mm Maximum Error: 2.0 mm (in the middle area) Minimum error: 0.1 mm (at the edge area) Standard Deviation: 0.5 mm The error distribution of key blocks is shown in Table 1: Table 1

[0073] Figure 6 It is the thermal map output after the cylindrical workpiece is tested, such as Figure 6 As shown, the colored area in the middle of the figure is the error hotspot, and the color changes from blue to red, indicating the change of parallelism error from small to large. Specifically, the left and right sides are the projections of the point cloud sections of the rectangular workpiece (represented by black dots), simulating the two-dimensional view observed from the positive X direction or the positive Y direction (similar to the Figure 3 、 Figure 4 The X- and Y-axes are two-dimensional coordinate systems used to locate the hot zone. The error value color bar is displayed on the right, in millimeters (mm), increasing from 0.0 to 2.0. Blue (error ≈ 0.0 mm): The surface is flat and essentially parallel to the opposite side; green-yellow (error ≈ 0.5-1.5 mm): Indicates a certain degree of error; red (error ≈ 2.0 mm): Represents the maximum error area, typically indicating tilt, unevenness, or deformation.

[0074] based on Figure 6 , we can see that the error distribution characteristics of the workpiece are: The maximum error area is concentrated in the middle of the workpiece (block B-001), with an error value of 2.0 mm and distributed in a red oval shape.

[0075] The second largest error area: near the right edge (block B-002), the error value is 1.8 mm, spreading in an orange fan shape.

[0076] Low error area: The four corners and edge areas of the workpiece (such as block B-003) have errors less than 0.5 mm and are blue.

[0077] based on Figure 6 , it can be diagnosed that the middle part of the cylindrical workpiece has deformed, which may be caused by insufficient fixture support or uneven material force during processing. The local deviation on the right side may be caused by tool path offset or thermal expansion effect. In addition, although the workpiece contour is symmetrical (such as Figure 3 ), but the heat map shows that the parallelism in the middle is significantly deteriorated, indicating that shape symmetry is not equivalent to functional compliance.

[0078] In summary, after model diagnosis, the global average error of the workpiece is 1.2 mm, which exceeds the preset qualified threshold (≤1.0 mm), and the parallelism of the workpiece is judged to be unqualified.

[0079] Furthermore, based on the above determination, this application provides the following repair suggestions: 1. Local finishing: Finely grind or repair the red hot areas (B-001, B-002), giving priority to the areas with the largest errors.

[0080] 2. Adjust the fixture positioning strategy to enhance the middle support stiffness; optimize the processing path parameters to reduce deformation caused by tool vibration.

[0081] 3. Combined with the deformation trend of 3D point cloud ( Figure 3 ), reversely correct the robot arm's motion trajectory to improve processing consistency.

[0082] In another exemplary embodiment, in step S300, the parallelism detection model is trained by the following steps: S301: Collect 3D point cloud data, 2D image data, and basic parallelism data of a plurality of workpieces with annotated parallelism error values to form a data set, and divide the data set into a training set and a validation set, for example, with a division ratio of 7:3; S302: Set training parameters. For example, booster selects the tree-based model gbtree by default, sets learning_rate to 0.01, max_depth to 3, and the maximum number of iterations to 300. The model is trained using the training set. During the model training process, when the number of model iterations meets the preset value, the model training is completed. S303: Validate the trained model using the validation set. During the validation process, if the mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) as the model performance evaluation indicators are all less than the threshold (for example, the threshold of MAE is set to 0.5mm, and the threshold of MSE is set to 0.25mm), the model is validated. 2 , the RMSE threshold is set to 0.6mm), the model validation passes; otherwise, adjust the training parameters (for example, adjust learning_rate to 0.005 and max_depth to 5) or expand the training set samples (for example, adjust the partition ratio to 8:2) and retrain the model until the validation passes.

[0083] In another exemplary embodiment, Figure 7As shown in the figure, the present application also provides a workpiece parallelism detection device, which includes: an acquisition module 100 for acquiring the parallelism reference data of the two side surfaces of a standard workpiece and obtaining the three-dimensional point cloud map and two-dimensional image of the two side surfaces of a workpiece to be measured; a model construction and training module for constructing and training a parallelism detection model; a model construction and training module 200 for constructing and training a parallelism detection model; a detection module 300 for inputting the parallelism reference data of the two side surfaces of the standard workpiece, the three-dimensional point cloud map and two-dimensional image of the two side surfaces of the workpiece to be measured into the trained parallelism detection model, and outputting the parallelism error value and heat map of the workpiece to be measured.

[0084] In another exemplary embodiment, the present application also provides a storage medium, which includes instructions that, when running on a computer, cause the computer to execute a workpiece parallelism detection method as described in any one of the preceding items.

[0085] In another exemplary embodiment, the present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, it implements a workpiece parallelism detection method as described in any one of the preceding items.

[0086] The above embodiments are only used to illustrate the technical concept and features of the present application, and their purpose is to enable those skilled in the art to understand the content of the present application and implement it accordingly, and cannot be used to limit the protection scope of the present application. Any equivalent changes or modifications made according to the spirit and essence of the present application should be covered within the protection scope of the present application.

Claims

1. A method for detecting parallelism of a workpiece, characterized in that: The method comprises: Obtain parallelism benchmark data of both sides of the standard workpiece surface, as well as obtain three-dimensional point cloud maps and two-dimensional images of both sides of the workpiece surface to be measured; Build and train a parallelism detection model; The parallelism benchmark data of the surfaces on both sides of the standard workpiece, the three-dimensional point cloud map and the two-dimensional image of the surfaces on both sides of the workpiece to be measured are input into the trained parallelism detection model, and the parallelism error value and the thermal map of the workpiece to be measured are output.

2. The method for detecting the parallelism of a workpiece according to claim 1, characterized in that The parallelism detection model includes: Input layer, feature extraction layer, geometric analysis layer and output layer, where The input layer uses three channels, which are used to input the basic data of parallelism of the standard workpiece, the three-dimensional point cloud map and the two-dimensional image of the workpiece to be measured; The feature extraction layer includes a baseline feature extraction subnetwork, a 3D point cloud feature extraction subnetwork, and a 2D image feature extraction subnetwork. The baseline feature extraction subnetwork is used to encode the parallelism basic data into a conditional vector; the 3D point cloud feature extraction subnetwork is used to extract features from the 3D point cloud image to obtain 3D point cloud features; and the 2D image feature extraction subnetwork is used to extract features from the 2D image to obtain 2D image features. The geometric analysis layer is used to perform geometric analysis on the workpiece to be measured based on the parallelism basic data and the extracted three-dimensional point cloud features and two-dimensional image features, and output the parallelism error and thermal map of the workpiece to be measured through the output layer.

3. A workpiece parallelism detection method according to claim 1, characterized in that The parallelism detection model is trained by the following steps: Collect 3D point cloud data, 2D image data, and basic parallelism data of standard workpieces with annotated parallelism error values to form a data set, and divide the data set into a training set and a validation set; Set the training parameters and train the model using the training set until the maximum number of iterations is met; The trained model is verified using the validation set. During the verification process, if the mean absolute error, mean square error, and root mean square error, which are the model performance evaluation indicators, are all less than the threshold, the model verification passes; otherwise, the training parameters are adjusted or the training set samples are expanded to retrain the model until the verification passes.

4. A workpiece parallelism detection device, characterized in that, The device comprises: An acquisition module is used to obtain the parallelism reference data of the surfaces on both sides of the standard workpiece, as well as to obtain a three-dimensional point cloud map and a two-dimensional image of the surfaces on both sides of the workpiece to be measured; Model building and training module, used to build and train the parallelism detection model; The detection module is used to input the parallelism benchmark data of the surfaces on both sides of the standard workpiece, the three-dimensional point cloud map and the two-dimensional image of the surfaces on both sides of the workpiece to be tested into the trained parallelism detection model, and output the parallelism error value and thermal map of the workpiece to be tested.

5. A storage medium, characterized in that, The method comprises instructions, which, when run on a computer, enable the computer to execute a workpiece parallelism detection method according to any one of claims 1 to 3.

6. An electronic device, characterized in that, The electronic device comprises: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, a workpiece parallelism detection method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Method and device for seeking evidence of image tampering

    CN107025647A

  • Multi-task three-dimensional target detection method based on point cloud feature enhancement

    CN115238758A

  • Three-dimensional target detection method based on multi-modal fusion and deformable attention

    CN117975436A

  • Workpiece flaw detection method and system and computer program

    CN119399098A

  • Axis parallelism error detection method and related equipment

    CN120194592A