Trimming processing error evaluation method based on three-dimensional point cloud
By combining 3D point cloud and grayscale image methods, the cutting edge is stably extracted, solving the problem of low accuracy in cutting edge measurement under ambient light and workpiece interference, and realizing high-precision cutting edge error assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing edge measurement methods are unstable under the influence of ambient light and workpiece interference, and cannot accurately assess processing errors. In particular, contact measurement equipment is expensive and non-contact measurement has low accuracy when the grayscale image quality is poor.
By combining 3D point cloud and grayscale image, the theoretical position of the cutting edge is located in the 3D point cloud and the edge points are extracted in the grayscale image. The second derivative and rectangular selection box techniques are used to stably extract the cutting edge, avoid edge disconnection and improve accuracy.
It can still stably extract the cutting edge even when the grayscale image quality is poor, which improves the accuracy of cutting processing error assessment and meets the precision inspection requirements of the automotive industry.
Smart Images

Figure CN121810778A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection, and more specifically to a method for evaluating edge cutting errors based on three-dimensional point clouds. Background Technology
[0002] Edge cutting refers to the cutting line on the edge of a workpiece. Among the many measured features, edge cutting is an important category to be measured. Whether the machining position of the edge cutting is accurate directly affects the mechanical properties of the workpiece and is an important basis for the later installation of the workpiece and the evaluation of whether the shape design meets the requirements.
[0003] Existing methods for measuring cut edges include contact measurement and non-contact measurement.
[0004] Contact measurement refers to measurement using a coordinate measuring machine (CMM). It employs a mechanical probe or other trigger-type measuring head, and measures points by planning a scanning path through programming. Each probe probe acquires the X, Y, and Z coordinates of the spatial boundary. While this method offers high measurement accuracy and has no special requirements regarding the material and color of the measured object, CMMs are expensive, have extremely high environmental requirements (needing a constant temperature and humidity environment), are slow, can only measure a limited number of points, require manual intervention, and necessitate compensation for probe damage and radius, resulting in low efficiency.
[0005] Non-contact measurement refers to vision-based measurement methods that utilize industrial cameras to capture images of cut edges and analyze edge contour dimensions using image processing algorithms. For example, patent document CN110021027B proposes a method for calculating cut edge points based on binocular vision. This method uses binocular vision to acquire left and right images, extracts the cut edge line from the images, and then obtains the three-dimensional coordinates of each contour point on the cut edge line. Using a point cloud fitting plane, the three-dimensional coordinates of the contour points are projected onto the fitting plane to obtain... The theoretical coordinates and theoretical normals of the cutting edge points are also projected onto the fitting plane I. Using the theoretical values of the points to be measured as a guide, distance constraints are applied to calculate the measurement coordinates of the cutting edge points, thereby detecting the cutting edge quality. When there is no ambient light or interference from other workpieces around the cutting edge to be detected, the boundary of the cutting edge in the grayscale image is clear, and this method can extract complete and burr-free cutting edge lines. However, when the cutting edge to be detected exhibits the following conditions, the stability of this method decreases, and it cannot effectively assess processing errors:
[0006] Scenario 1: The workpiece under inspection is affected by ambient light, resulting in uneven reflection. This will cause blurred edges and high noise in the grayscale image (e.g., ...). Figure 1 ).
[0007] Scenario 2: There are other workpieces around the workpiece to be inspected, resulting in poor contrast of the cut edges in the grayscale image.
[0008] In the above situations, conventional edge extraction algorithms may encounter errors in edge extraction (such as...). Figure 2 In cases where there are false edges (or edges that cannot be extracted) or the edges are not connected, the stability of the algorithm deteriorates, and it is unable to extract accurate cutting points; this affects the accuracy of the evaluation of cutting processing errors. Summary of the Invention
[0009] To address the aforementioned issues, this invention proposes a method for evaluating edge trimming errors based on 3D point clouds. This method reduces the quality requirements for grayscale images, and can still stably extract boundary positions even when the edge boundaries in the image are blurred, noisy, and have low contrast, avoiding edge discontinuity and improving the stability of edge extraction. Furthermore, by locating the actual position of the edge using edge lines, the accuracy of edge trimming precision evaluation is improved, meeting the inspection requirements of precision manufacturing industries such as the automotive industry.
[0010] The technical solution is as follows:
[0011] A method for evaluating the cutting error based on three-dimensional point cloud is proposed. A point on the cutting edge to be detected is selected in advance from the workpiece digital model. The digital model coordinates at this point are recorded as the theoretical coordinates P0 of the cutting point, and the extension direction of the cutting edge to be detected is recorded as the A direction.
[0012] The following steps are used to evaluate the cutting edge error of a batch of workpieces:
[0013] 1) Obtain the 3D point cloud and grayscale image of the workpiece cut edge; align the 3D point cloud and the workpiece digital model to the same coordinate system; in the 3D point cloud, find the position coordinate P1 corresponding to the theoretical coordinate P0, and the vector a of the A direction in the 3D point cloud;
[0014] Draw a spatial line along vector a through position coordinate P1 to obtain spatial line L;
[0015] 2) Project the position coordinates P1 and the spatial line L onto the image coordinate system to obtain the two-dimensional coordinate point Q and the plane line C; in the grayscale image, construct a rectangular selection box with the two-dimensional coordinate point Q as the center, and the short side of the rectangular selection box is parallel to the plane line C;
[0016] 3) Within the rectangular selection box, draw a straight line parallel to the long side of the rectangular selection box through the pixels on the short side of the rectangular selection box, and record the gray value of each pixel on the line in sequence to obtain the gray value sequence.
[0017] Take the second derivative of the discrete function corresponding to the gray value sequence, and mark the points where the sign of the second derivative changes or the value of the second derivative is zero as edge points;
[0018] 4) Perform step 3) on each pixel on the short side of the rectangular selection box to obtain all edge points;
[0019] 5) Fit the edge points to obtain the edge line; draw a straight line L1 parallel to the long side of the rectangular selection box through the two-dimensional coordinate point Q, and find the intersection point of the edge line and the straight line L1; back-project the intersection point to the coordinate system of the three-dimensional point cloud to obtain the measured three-dimensional coordinates K of the cutting edge point;
[0020] The deviation between the measured three-dimensional coordinates K and the theoretical coordinates P0 of the cutting point is used to evaluate the cutting error.
[0021] Preferably, in step 3), if there are multiple edge points, the sorting of each pixel in the grayscale value sequence is checked. If the sorting is from the pixels in the background area to the pixels in the workpiece area, the first marked edge point is stored and the other edge points are removed; otherwise, the last marked edge point is stored and the other edge points are removed.
[0022] Furthermore, using either method one or method two, locate the position coordinate P1 corresponding to the theoretical coordinate P0 in the 3D point cloud:
[0023] Method 1: In the 3D point cloud, the 3D point closest to the theoretical coordinate P0 is recorded as the position coordinate P1;
[0024] Method 2: Construct a cylinder with theoretical coordinate P0 as the center, and make the central axis of the cylinder parallel to the normal vector of the plane containing theoretical coordinate P0;
[0025] The centroid of the 3D point cloud inside the cylinder is denoted as position coordinate P1.
[0026] Preferably, the following processing is performed before proceeding to step 1):
[0027] On the workpiece model, obtain the normal vector of the plane containing the theoretical coordinate P0, and denote the direction that is perpendicular to both direction A and the normal vector as direction B; translate the theoretical coordinate P0 along direction B so that the translated theoretical coordinate P0 is inside the workpiece, and use the translated theoretical coordinate P0 to perform step 1).
[0028] Preferably, the distance of translation along the B direction from the theoretical coordinate P0 is 5 to 20 times the point cloud density.
[0029] Preferably, the shorter side of the rectangular selection frame is 5 to 20 times the point cloud density, and the longer side is 30 to 100 times the point cloud density.
[0030] This method combines 3D point clouds with grayscale images. Using the theoretical coordinates of the cut edge, it locates the region containing the cut edge in the grayscale image. Within a specified region, the cut edge position is obtained by differentiating the discrete function of the grayscale sequence. This method reduces the quality requirements of the grayscale image. Even when the cut edge boundary is blurred, noisy, or has low contrast, it can still stably extract the boundary position, avoiding edge discontinuity and improving the stability of cut edge extraction.
[0031] Furthermore, by locating the actual position of the cut edge using the edge line, the accuracy of the cut edge processing precision assessment is improved, meeting the testing requirements of precision manufacturing industries such as the automotive industry.
[0032] Meanwhile, to prevent large changes in the position of the cutting edge point due to workpiece machining deviations, and to address the issue that a rectangular selection box based on the theoretical cutting edge point cannot select the workpiece area, this method translates the theoretical cutting edge point to ensure that it is inside the workpiece, thereby selecting a suitable workpiece cutting edge area. Attached Figure Description
[0033] Figure 1 This is a grayscale image of the workpiece under inspection when the reflection is uneven.
[0034] Figure 2 A diagram illustrating errors (false edges) in the extraction of cut edges;
[0035] Figure 3 This is a schematic diagram of the rectangular selection box constructed with the two-dimensional coordinate point Q as the center in step 2);
[0036] Figure 4 This is a schematic diagram of all edge points within the rectangular selection box in step 4). Detailed Implementation
[0037] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0038] A method for evaluating the cutting error based on three-dimensional point cloud is proposed. A point on the cutting edge to be detected is selected in advance from the workpiece digital model. The digital model coordinates at this point are recorded as the theoretical coordinates P0 of the cutting point, and the extension direction of the cutting edge to be detected is recorded as the A direction.
[0039] The following steps are used to evaluate the cutting edge error of a batch of workpieces:
[0040] 1) Obtain the 3D point cloud and grayscale image (e.g., of the workpiece cut edge) Figure 1 Align the 3D point cloud with the workpiece digital model to the same coordinate system; in the 3D point cloud, find the position coordinates P1 corresponding to the theoretical coordinate P0, and the vector a in the 3D point cloud in the A direction;
[0041] Draw a spatial line along vector a through position coordinate P1 to obtain spatial line L;
[0042] 2) Project the position coordinates P1 and the spatial line L onto the image coordinate system to obtain the two-dimensional coordinate point Q and the plane line C; in the grayscale image, construct a rectangular selection box centered on the two-dimensional coordinate point Q (e.g., ...). Figure 3 The shorter side of the rectangular selection box is parallel to the plane line C;
[0043] 3) Within the rectangular selection box, draw a straight line parallel to the long side of the rectangular selection box, passing through the pixel on the short side (e.g., ...). Figure 3 (The red dashed line in the image) records the grayscale values of each pixel along the line in sequence, resulting in the grayscale value sequence G. i , i=1,2……n, where n is the total number of pixels on the long side of the rectangular selection box;
[0044] For the discrete function (G) corresponding to the gray value sequence i =f(i))Calculate the second derivative G i '': G i ''= G i+1 + G i-1 -2×G i ;
[0045] Points where the sign of the second derivative changes or the value of the second derivative is zero are denoted as edge points;
[0046] 4) Perform step 3) on each pixel on the short side of the rectangular selection box to obtain all edge points (e.g., Figure 4 );
[0047] 5) Fit the edge points to obtain the edge line; draw a straight line L1 parallel to the long side of the rectangular selection box through the two-dimensional coordinate point Q, and find the intersection point of the edge line and the straight line L1; back-project the intersection point to the coordinate system of the three-dimensional point cloud to obtain the measured three-dimensional coordinates K of the cutting edge point;
[0048] The deviation between the measured three-dimensional coordinates K and the theoretical coordinates P0 of the cutting point is used to evaluate the cutting error.
[0049] like Figure 2 When the workpiece to be inspected is affected by ambient light, resulting in uneven reflection and blurred edges in the grayscale image with high noise, step 3) may extract multiple edge points (such as...). Figure 2 This means that the grayscale sequence contains multiple grayscale value jumps. To address this issue, the following processing is used to remove interference points inside the workpiece, ensuring that only edge points of the cutting boundary are extracted each time. Specifically:
[0050] In step 3), if there are multiple edge points, check the sorting of each pixel in the grayscale value sequence. If the sorting is from the pixels in the background area to the pixels in the workpiece area (e.g., ...), then... Figure 3If the sorting is from bottom to top, then store the first marked edge point and remove the other edge points; otherwise (e.g. Figure 3 (Sorted from top to bottom), store the last marked edge point and remove other edge points. For example... Figure 4 After the removal process, only one edge point is retained in each grayscale value sequence to avoid extracting false edges.
[0051] In practice, using either method one or method two, the position coordinates P1 corresponding to the theoretical coordinates P0 are located in the 3D point cloud.
[0052] Method 1: In the 3D point cloud, the 3D point closest to the theoretical coordinate P0 is recorded as the position coordinate P1;
[0053] Method 2: Construct a cylinder with theoretical coordinate P0 as the center, and make the central axis of the cylinder parallel to the normal vector of the plane containing theoretical coordinate P0;
[0054] The centroid of the 3D point cloud inside the cylinder is denoted as position coordinate P1.
[0055] To prevent large changes in the position of the cutting point due to workpiece machining deviations, and the inability to select the workpiece area by establishing a rectangular selection box for the theoretical cutting point, this embodiment obtains the normal vector of the plane containing the theoretical coordinate P0 on the workpiece model before performing step 1). The direction that is perpendicular to both direction A and the normal vector is denoted as direction B. The theoretical coordinate P0 is translated along direction B so that the translated theoretical coordinate P0 is inside the workpiece (ensuring that the cutting point after the movement is inside the workpiece and not in the background area). Step 1 is then performed using the translated theoretical coordinate P0.
[0056] As a preferred implementation, the distance of translating the theoretical coordinate P0 along the B direction is 5 to 20 times the point cloud density.
[0057] The shorter side of the rectangular selection box is 5 to 20 times the point cloud density (in this embodiment, the value is 5 to 30 pixels), and the longer side is 30 to 100 times the point cloud density (in this embodiment, the value is 30 to 100 pixels).
[0058] In practice, in order to improve the detection speed, in step 3), the gray values of each integer pixel on the straight line are recorded in sequence to obtain a gray value sequence;
[0059] In step 4), each integer pixel on the short side of the rectangular selection box is processed in step 3) to obtain all edge points.
[0060] The foregoing description of specific exemplary embodiments of the present invention is for illustrative and descriptive purposes. It is not intended to be exhaustive, nor to limit the invention to the precise forms disclosed; obviously, many changes and variations are possible in accordance with the foregoing teachings. The exemplary embodiments were chosen and described to explain the specific principles of the invention and its practical application, thereby enabling others skilled in the art to implement and utilize various exemplary embodiments of the invention, as well as their different alternatives and modifications. The scope of the invention is intended to be defined by the appended claims and their equivalents.
Claims
1. A method for evaluating edge trimming errors based on 3D point clouds, characterized in that: A point on the cut edge to be inspected is selected in advance from the workpiece model. The model coordinates at this point are recorded as the theoretical coordinates of the cut edge point P0, and the extension direction of the cut edge to be inspected is recorded as the A direction. The following steps are used to evaluate the cutting edge error of a batch of workpieces: 1) Obtain the 3D point cloud and grayscale image of the workpiece cut edge; align the 3D point cloud and the workpiece digital model to the same coordinate system; in the 3D point cloud, find the position coordinate P1 corresponding to the theoretical coordinate P0, and the vector a of the A direction in the 3D point cloud; Draw a spatial line along vector a through position coordinate P1 to obtain spatial line L; 2) Project the position coordinates P1 and the spatial line L onto the image coordinate system to obtain the two-dimensional coordinate point Q and the plane line C; in the grayscale image, construct a rectangular selection box with the two-dimensional coordinate point Q as the center, and the short side of the rectangular selection box is parallel to the plane line C; 3) Within the rectangular selection box, draw a straight line parallel to the long side of the rectangular selection box through the pixels on the short side of the rectangular selection box, and record the gray value of each pixel on the line in sequence to obtain the gray value sequence. Take the second derivative of the discrete function corresponding to the gray value sequence, and mark the points where the sign of the second derivative changes or the value of the second derivative is zero as edge points; 4) Perform step 3) on each pixel on the short side of the rectangular selection box to obtain all edge points; 5) Fit the edge points to obtain the edge line; draw a straight line L1 parallel to the long side of the rectangular selection box through the two-dimensional coordinate point Q, and find the intersection point of the edge line and the straight line L1; back-project the intersection point to the coordinate system of the three-dimensional point cloud to obtain the measured three-dimensional coordinates K of the cutting edge point; The deviation between the measured three-dimensional coordinates K and the theoretical coordinates P0 of the cutting point is used to evaluate the cutting error.
2. The method for evaluating edge cutting errors based on three-dimensional point clouds as described in claim 1, characterized in that: In step 3), if there are multiple edge points, check the sorting of each pixel in the grayscale value sequence. If the sorting is from the pixels in the background area to the pixels in the workpiece area, store the first marked edge point and remove the other edge points; otherwise, store the last marked edge point and remove the other edge points.
3. The method for evaluating edge cutting errors based on three-dimensional point clouds as described in claim 1, characterized in that: Using either method one or method two, find the position coordinate P1 corresponding to the theoretical coordinate P0 in the 3D point cloud: Method 1: In the 3D point cloud, the 3D point closest to the theoretical coordinate P0 is recorded as the position coordinate P1; Method 2: Construct a cylinder with theoretical coordinate P0 as the center, and make the central axis of the cylinder parallel to the normal vector of the plane containing theoretical coordinate P0; The centroid of the 3D point cloud inside the cylinder is denoted as position coordinate P1.
4. The method for evaluating edge cutting errors based on three-dimensional point clouds as described in claim 1, characterized in that: Before proceeding to step 1), the following steps must be taken: On the workpiece model, obtain the normal vector of the plane containing the theoretical coordinate P0, and denote the direction that is perpendicular to both direction A and the normal vector as direction B; translate the theoretical coordinate P0 along direction B so that the translated theoretical coordinate P0 is inside the workpiece, and use the translated theoretical coordinate P0 to perform step 1).
5. The method for evaluating edge cutting errors based on three-dimensional point clouds as described in claim 4, characterized in that: The distance of translation along direction B from the theoretical coordinate P0 is 5 to 20 times the point cloud density.
6. The method for evaluating edge cutting errors based on three-dimensional point clouds as described in claim 1, characterized in that: The shorter side of the rectangular selection box is 5 to 20 times the point cloud density, and the longer side is 30 to 100 times the point cloud density.
Citation Information
Patent Citations
A method for calculating cutting edge points based on binocular vision
CN110021027B