Laser cleaning trajectory compression method, device, equipment and storage medium
By segmenting, compressing, and merging the laser cleaning trajectory to generate a sparse point set, the problem of low cleaning efficiency caused by dense scanning trajectories is solved, and the scanning trajectory is simplified and efficiency is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YUSHAN COUNTY YUTOU SAND & GRAVEL CO LTD
- Filing Date
- 2022-08-11
- Publication Date
- 2026-07-24
AI Technical Summary
In existing laser cleaning technologies, the scanning trajectory is too dense, resulting in low cleaning efficiency.
By acquiring a dense set of points on the workpiece to be scanned, segmenting the trajectory and compressing it according to preset rules, merging adjacent trajectories, generating a sparse set of points, removing duplicate points, and obtaining the target scanning trajectory.
Simplify the scanning trajectory, improve communication and cleaning efficiency, while maintaining the cleaning effect.
Smart Images

Figure CN115330836B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of laser cleaning technology, and in particular to a method, apparatus, equipment, and storage medium for laser cleaning trajectory compression. Background Technology
[0002] Laser cleaning is a commonly used surface treatment technology in industry, used to remove grease, dust, rust, and residual solvents, adhesives, and other contaminants from workpiece surfaces to ensure the quality of subsequent processes such as electroplating, phosphating, spraying, welding, packaging, and integrated circuit assembly, all of which require surface cleaning beforehand. Laser cleaning is a "dry" cleaning method, requiring no cleaning fluids or other chemical solutions, and its cleanliness is far superior to chemical cleaning processes. It can handle various types of surface contaminants, has minimal environmental pollution, and does not damage the substrate. Currently, this method has become a supplement and extension to traditional cleaning methods, and its many inherent advantages have shown broad application prospects.
[0003] In laser cleaning, the identification and planning of the cleaning path is sometimes achieved manually, and sometimes automatically generated scanning trajectories. However, some scanning trajectories are too dense, leading to low communication efficiency and affecting the efficiency of laser cleaning. Therefore, how to improve laser cleaning efficiency while maintaining the shape of the scanning trajectory is an urgent technical problem to be solved.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a laser cleaning trajectory compression method, apparatus, device, and computer storage medium, aiming to solve the technical problem that the laser cleaning trajectory is too dense in the prior art, resulting in low cleaning efficiency.
[0006] To achieve the above objectives, the present invention provides a laser cleaning trajectory compression method, which includes the following steps:
[0007] Obtain the compressed scanning trajectory of the workpiece to be scanned, wherein the compressed scanning trajectory is a set of directed dense points;
[0008] Based on the dense point set, the scanning trajectory is divided into multiple trajectory segments;
[0009] The multiple trajectory segments are compressed according to preset rules to obtain the target scanning trajectory;
[0010] The target scanning trajectory is represented as a sparse point set, and the sparse point set is deduplicated to obtain the target scanning trajectory.
[0011] Preferably, the step of compressing the multiple trajectory segments according to a preset rule to obtain the target scanning trajectory includes:
[0012] Calculate the cosine value of the direction angle between each pair of adjacent trajectory segments;
[0013] Based on the cosine value of the direction angle, determine whether two adjacent trajectory segments can be merged;
[0014] If they can be merged, then the corresponding two adjacent trajectory segments are merged to obtain the first compressed scan trajectory;
[0015] The first compressed scan trajectory is compressed again to obtain the target scan trajectory.
[0016] Preferably, the step of compressing the first compressed scan trajectory again to obtain the target scan trajectory includes:
[0017] The first compressed scan trajectory is represented as a set of directed sparse points;
[0018] Based on the sparse point set, the first compressed scan trajectory is divided into multiple new trajectories;
[0019] Calculate the length of each segment of the new trajectory;
[0020] Based on the trajectory length, determine whether any two adjacent new trajectory segments can be merged;
[0021] If merging is possible, the two adjacent new trajectories will be merged to obtain the target scanning trajectory.
[0022] Preferably, determining whether two adjacent trajectory segments can be merged based on the cosine value of the direction angle includes:
[0023] Set an included angle threshold and calculate the cosine value of the included angle threshold;
[0024] If the cosine value of the direction angle is greater than the cosine value of the angle threshold, then the two adjacent trajectories can be merged.
[0025] Preferably, determining whether two adjacent new trajectory segments can be merged based on the trajectory length includes:
[0026] Set the minimum trajectory length threshold;
[0027] Determine whether at least one of the two adjacent new trajectory segments has a trajectory length less than the minimum length threshold;
[0028] If so, the two corresponding new trajectories can be merged.
[0029] Preferably, acquiring the compressed scanning trajectory of the workpiece to be scanned includes:
[0030] Obtain the workpiece mesh of the workpiece to be scanned, and calculate the minimum directed bounding box based on the workpiece mesh;
[0031] An initial scan trajectory is generated based on the minimum directed bounding box;
[0032] The workpiece mesh is projected onto the upper surface of the minimum bounding box to obtain a projected mesh;
[0033] Discretize the initial scan trajectory into a set of points;
[0034] Based on the projection grid, find the target projection grid surface that is closest to each point in the discrete point set of each initial scan trajectory, and record the target index of the target projection grid surface.
[0035] Project the discrete points in the point set onto the target grid corresponding to the target number in the workpiece grid to obtain the set of scan trajectory projection points;
[0036] The compressed scanning trajectory of the workpiece to be scanned is fitted based on the set of projection points of the scanning trajectory.
[0037] Preferably, acquiring the compressed scanning trajectory of the workpiece to be scanned includes:
[0038] Obtain the workpiece mesh of the workpiece to be scanned, and calculate the minimum directed bounding box based on the workpiece mesh;
[0039] An initial scan trajectory is generated based on the minimum directed bounding box;
[0040] The workpiece mesh is projected onto the upper surface of the minimum bounding box to obtain a projected mesh;
[0041] Traverse the four corner patches in the projection grid, find the four corner patches that intersect with the initial scanning trajectory, and obtain a set of candidate projection patches;
[0042] Traverse the edges of the four corner faces in the candidate projection face set, and find the intersecting edges and intersection points that intersect with the initial scanning trajectory;
[0043] Based on the intersecting edges and intersection points, the projection points of the intersection points are found in the workpiece mesh, and all the found projection points constitute a projection point set.
[0044] The compression scanning trajectory of the workpiece to be scanned is fitted based on the projection points in the projection point set.
[0045] Furthermore, to achieve the above objectives, the present invention also proposes a laser cleaning trajectory compression device, the laser cleaning trajectory compression device comprising:
[0046] The acquisition module is used to acquire the scan trajectory to be compressed of the workpiece to be scanned, wherein the scan trajectory to be compressed is a set of directed dense points;
[0047] A segmentation module is used to divide the scanning trajectory into multiple trajectory segments based on the dense point set;
[0048] A compression module is used to compress the multiple trajectory segments according to preset rules to obtain the target scanning trajectory;
[0049] The deduplication module is used to represent the target scanning trajectory as a sparse point set, and to perform deduplication processing on the sparse point set to obtain the target scanning trajectory.
[0050] Furthermore, to achieve the above objectives, the present invention also proposes a laser cleaning trajectory compression device, which includes: a memory, a processor, and a laser cleaning trajectory compression program stored in the memory and executable on the processor. When the laser cleaning trajectory compression program is executed by the processor, it implements the steps of the laser cleaning trajectory compression method described above.
[0051] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a laser cleaning trajectory compression program, wherein when the laser cleaning trajectory compression program is executed by a processor, it implements the steps of the laser cleaning trajectory compression method described above.
[0052] In this invention, the scanning trajectory to be compressed is obtained from the workpiece to be scanned. The scanning trajectory to be compressed is a set of directed dense points. Based on the dense point set, the scanning trajectory is divided into multiple segments. The multiple segments are compressed according to a preset rule to obtain the target scanning trajectory. The target scanning trajectory is represented as a sparse point set. The sparse point set is deduplicated to obtain the target scanning trajectory. Under the premise of ensuring the cleaning effect, the scanning trajectory is simplified, and the communication efficiency and cleaning efficiency are improved. Attached Figure Description
[0053] Figure 1 This is a schematic diagram of the structure of a laser cleaning trajectory compression device in the hardware operating environment involved in the embodiments of the present invention;
[0054] Figure 2 This is a flowchart illustrating the first embodiment of the laser cleaning trajectory compression method of the present invention;
[0055] Figure 3 This is a diagram showing the effect of the first compressed scan trajectory in an embodiment of the laser cleaning trajectory compression method of the present invention;
[0056] Figure 4 This is a diagram illustrating the effect of the target scanning trajectory in an embodiment of the laser cleaning trajectory compression method of the present invention.
[0057] Figure 5 This is a structural block diagram of the first embodiment of the laser cleaning trajectory compression device of the present invention.
[0058] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0059] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0060] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a laser cleaning trajectory compression device in the hardware operating environment of an embodiment of the present invention.
[0061] like Figure 1 As shown, the laser cleaning trajectory compression device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen, and optionally, it may also include a standard wired interface or a wireless interface. In this invention, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0062] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the laser cleaning trajectory compression device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0063] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a laser cleaning trajectory compression program.
[0064] exist Figure 1In the laser cleaning trajectory compression device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the user equipment; the laser cleaning trajectory compression device calls the laser cleaning trajectory compression program stored in the memory 1005 through the processor 1001 and executes the laser cleaning trajectory compression method provided in the embodiment of the present invention.
[0065] Based on the above hardware structure, an embodiment of the laser cleaning trajectory compression method of the present invention is proposed.
[0066] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the laser cleaning trajectory compression method of the present invention, which presents the first embodiment of the laser cleaning trajectory compression method of the present invention.
[0067] In the first embodiment, the laser cleaning trajectory compression method includes the following steps:
[0068] Step S10: Obtain the scan trajectory to be compressed on the workpiece to be scanned, wherein the scan trajectory to be compressed is a set of dense points arranged in a directed manner.
[0069] It should be understood that the execution subject of this embodiment is the laser cleaning trajectory compression device, which can be an electronic device such as a personal computer, industrial control computer, robot, or server; this embodiment does not limit this. A 3D camera is fixed directly above the workpiece to be welded, triggering an image capture to obtain an ordered point cloud of the workpiece. For any point v in the ordered point cloud... i,j Search for v according to the row and column sorting index rules i,j neighboring point v i,j+1 v i+1,j+1 v i+1,j Among them, the values of v in the i-th row and j-th column, i-th row and j+1 column, i+1 row and j+1 column, and i+1 row and j-th column in the ordered point cloud data are respectively... i,j v i,j+1 v i+1,j+1 v i+1,j Four points form a quadrilateral patch, and the points forming the quadrilateral patch are called grid vertices. Quadrilateral patches are added according to the index relationship until all vertices in the ordered point cloud have been searched. The vertices and quadrilateral patches together form a quadrilateral grid. Each vertex v... i,j The 3D spatial coordinates of the facets are denoted as (x, y, z). Based on the vertex coordinates of the four corner facets, the normal vector of each corner facet is calculated. The normal vectors of all four corner facets constitute the set of face normal vectors of the four corner mesh. Where N F This represents the number of corner faces contained within the four-corner grid.
[0070] It should be noted that the four corner meshes are planarly segmented to obtain the workpiece mesh to be scanned; the four corner mesh contours of the workpiece mesh to be scanned are extracted; and the minimum directed bounding box is calculated based on the four corner mesh contours. Based on the topological relationships between the vertices of the four corner meshes, the inner vertex v of any mesh... i,j Its number of adjacent vertices must be four; otherwise, vertex v i,j These are the edge points. This allows for the extraction of the mesh contour of the workpiece to be scanned. To accurately identify the pose of objects of arbitrary shapes, the pose of the workpiece under the minimum envelope is calculated based on the four corner mesh contour points, thus obtaining the minimum directed bounding box.
[0071] Further, based on the four-corner mesh contour, the centroid of the workpiece mesh to be scanned in the camera coordinate system is calculated; the inertia tensor matrix of the workpiece mesh to be scanned relative to the centroid in the camera coordinate system is calculated; the preliminary pose matrix of the workpiece mesh to be scanned in the coordinate system of the centroid is calculated based on the inertia tensor matrix; and the minimum directed bounding box of the workpiece to be scanned is calculated based on the preliminary pose matrix.
[0072] The center of mass refers to the center of an object's mass; it is considered an imaginary point where the object's mass is concentrated. The coordinates of the object's center of mass are P. c The calculation formula is as follows:
[0073] Where M is the total mass of the object, m i To divide an object into i parts, let r be the mass of the i-th part. i For m i The coordinates are then used to calculate the centroid of the workpiece mesh in the camera coordinate system according to the formula for calculating the centroid coordinates of an object.
[0074] The inertia tensor is a physical quantity that describes the magnitude of the inertia of a rigid body rotating around a fixed point. When a rigid body rotates around a fixed point, only one point remains stationary. Furthermore, the inertia tensor is a real-valued three-dimensional symmetric matrix, which is defined for any reference point Q in three-dimensional space and a Cartesian coordinate system Q' with that reference point as the origin. xyz Its inertial tensor representation is as follows:
[0075]
[0076] Among them, diagonal element I xx I yy I zz These are the moments of inertia with respect to the x-axis, y-axis, and z-axis, respectively. The moment of inertia generally refers to the property of a cross-section to resist bending. Let (x, y, z) be a small mass d. m For the relative position of point Q, the formulas for calculating these moments of inertia are as follows:
[0077]
[0078]
[0079]
[0080] The non-diagonal elements, known as the product of inertia, can be defined as:
[0081]
[0082]
[0083]
[0084] Find the inertia tensor matrix of the four corner mesh profiles relative to the centroid. According to the parallel axis theorem, let...
[0085] x i ′=x i -p x
[0086] y i ′=y i -p y
[0087] z i ′=z i -p z
[0088] Where (p) x p y p z (x) represents the coordinates of the centroid of the four corner grid contours in the camera coordinate system. i y i , z i Let be the coordinates of the point cloud in the camera coordinate system. The inertia tensor matrix of the four corner mesh contours relative to the centroid can then be obtained, and its final calculation formula is as follows:
[0089]
[0090] By iterating through all the four-corner mesh contours and substituting them into the above formula, the inertial tensor matrix I of the four-corner mesh contours relative to the centroid in the camera coordinate system is calculated.
[0091] By employing a diagonalization method, the inertia product is made zero, thus transforming the inertia tensor into a diagonal matrix. Since the principal elements of a symmetric matrix are all positive numbers, the three eigenvalues obtained are necessarily positive real numbers, and the three eigenvectors are necessarily mutually orthogonal. This allows us to calculate the eigenvalues λ1, λ2, and λ3 of the inertia tensor matrix.
[0092] Based on the eigenvalues of the inertia tensor matrix, the eigenvectors of the inertia tensor matrix are calculated using the following formula: Iω = λω. The eigenvectors of the inertia tensor matrix are also the principal axes of inertia. Using these principal axes, the coordinate system of the four corner mesh contours in the centroid is defined, thus obtaining the rotation matrix R of the four corner mesh contours about the principal axes of rotation of the centroid in the camera coordinate system. o2c Based on the rotation matrix and the centroid in the camera coordinate system, the rotation and translation matrix from the camera coordinate system to the centroid coordinate system of the point cloud is calculated to obtain the preliminary pose matrix T of the workpiece to be scanned. o2c This refers to the minimum directed bounding box. Wherein, the translation matrix t from the camera coordinate system to the centroid of the point cloud is... o2c Equal to the center of mass P c coordinate.
[0093] It should be noted that the initial scan trajectory is generated based on the minimum directed bounding box. The minimum point B of the minimum directed bounding box is then located. min and the maximum point B max By B min and B max The coordinates of the vertices on the upper surface of the directed bounding box can be given as A(x) min ,y min ,z min ), B(x) min ,y max ,z min ), C(x) max ,y max ,z min ), D(x max ,y min ,z min The four vertices are arranged counterclockwise. The scan trajectory is generated by scanning a single trajectory along the positive X-axis and multiple trajectories along the positive Y-axis. Alternatively, the four vertices can be arranged clockwise, and the scan trajectory is generated by scanning a single trajectory in reverse along the X-axis and multiple trajectories in reverse along the Y-axis. This embodiment does not impose any limitations on this method.
[0094] In a specific implementation, in order to ensure that the laser beam completely covers the workpiece to be scanned while being evenly distributed on the surface of the workpiece to be scanned, and to maximize the use of the laser beam's energy, the laser cleaning trajectory generated based on the minimum bounding box is projected onto the workpiece grid surface to obtain the scanning trajectory to be compressed.
[0095] It should be understood that any of the stated scan trajectories T to be compressed i It can be formed by a set of directed dense points. It means that among them
[0096] Step S20: Based on the dense point set, divide the scanning trajectory into multiple trajectory segments.
[0097] Understandably, based on the dense point set, the scan trajectory T to be compressed... i Starting from the starting point, two points form a trajectory, the trajectory T to be compressed during scanning. i It is divided into multiple trajectory segments.
[0098] Step S30: Compress the multiple trajectory segments according to preset rules to obtain the target scanning trajectory.
[0099] It should be understood that the trajectory compression process consists of two steps. First, based on the angle between two consecutive trajectories, two trajectories with an angle less than a certain threshold are merged. Second, based on the minimum trajectory length, two trajectories with a length less than a certain threshold are merged.
[0100] Step S40: Represent the target scanning trajectory as a sparse point set, perform deduplication processing on the sparse point set, and obtain the target scanning trajectory.
[0101] It should be noted that the scan trajectory T to be compressed i Compressed Trajectory Sparse Point Set The process involves deduplication to remove duplicate points, resulting in the target scanning trajectory. Typically, the pose of each point in the target scanning trajectory can also be calculated, and the scanning pose of each point can be transformed from the camera coordinate system to the robot coordinate system through hand-eye calibration. This final scanning trajectory is then sent to the robot. Because the compressed target scanning trajectory is simplified, the communication efficiency between the robot and the robot is improved. The robot then performs laser scanning on the workpiece based on the final scanning trajectory, achieving laser cleaning.
[0102] In this embodiment, the scanning trajectory to be compressed is obtained from the workpiece to be scanned. The scanning trajectory to be compressed is a set of directed dense points. Based on the dense point set, the scanning trajectory is divided into multiple segments. The multiple segments are compressed according to a preset rule to obtain the target scanning trajectory. The target scanning trajectory is represented as a sparse point set. The sparse point set is deduplicated to obtain the target scanning trajectory. Under the premise of ensuring the cleaning effect, the scanning trajectory is simplified, and the communication efficiency and cleaning efficiency are improved.
[0103] Continue to refer to Figure 2 Based on the first embodiment described above, a second embodiment of the laser cleaning trajectory compression method of the present invention is proposed.
[0104] In the second embodiment, step S30 includes:
[0105] Calculate the cosine value of the direction angle between each pair of adjacent trajectory segments;
[0106] Based on the cosine value of the direction angle, determine whether two adjacent trajectory segments can be merged;
[0107] If they can be merged, then the corresponding two adjacent trajectory segments are merged to obtain the first compressed scan trajectory;
[0108] The first compressed scan trajectory is compressed again to obtain the target scan trajectory.
[0109] In the specific implementation, firstly, an angle threshold θ1 is set, which can be set based on empirical values. In this embodiment, determining whether two adjacent trajectory segments can be merged based on the cosine value of the direction angle includes: setting an angle threshold and calculating the cosine value of the angle threshold; if the cosine value of the direction angle is greater than the cosine value of the angle threshold, then the corresponding two adjacent trajectory segments can be merged.
[0110] (1) Calculate the scan trajectory T to be compressed i The cosine of the angle between the directions of the k-th and (k+1)-th segments of the trajectory.
[0111] (2) If the cosine of the direction angle between the k-th segment of the trajectory and the (k+1)-th segment of the trajectory satisfies:
[0112]
[0113] Then merge the k-th segment trajectory and the (k+1)-th segment trajectory, that is, take the starting point of the k-th segment trajectory as the starting point of the merged trajectory and take the ending point of the (k+1)-th segment trajectory as the ending point of the merged trajectory, and execute step (3); otherwise, execute step (4).
[0114] (3) Determine whether the (k+1)th segment of the trajectory is the scan trajectory T to be compressed. i If the last segment of the trajectory is the last segment, record the coordinates of the start and end points of the merged trajectory and end the search; otherwise, repeat step (2).
[0115] (4) Record the coordinates of the start and end points of the kth segment of the trajectory, and repeat steps (2) to (3) starting from the start point of the (k+1)th segment of the trajectory.
[0116] Furthermore, in this embodiment, the step of compressing the first compressed scan trajectory again to obtain the target scan trajectory includes:
[0117] The first compressed scan trajectory is represented as a set of directed sparse points;
[0118] Based on the sparse point set, the first compressed scan trajectory is divided into multiple new trajectories;
[0119] Calculate the length of each segment of the new trajectory;
[0120] Based on the trajectory length, determine whether any two adjacent new trajectory segments can be merged;
[0121] If merging is possible, the two adjacent new trajectories will be merged to obtain the target scanning trajectory.
[0122] Understandably, after trajectory compression based on direction, the first compressed scan trajectory obtained can be composed of a set of sparse points arranged in a directed manner. Indicates, such as Figure 3 As shown by the black dot in the middle, Figure 3 This is the result of the first compressed scan trajectory. At this point, the number of fitted points in each scan trajectory may not be equal.
[0123] It should be understood that the minimum trajectory length threshold L can be set based on empirical values. In this embodiment, determining whether two adjacent new trajectory segments can be merged based on the trajectory length includes: setting a minimum trajectory length threshold; determining whether at least one of the two adjacent new trajectory segments has a trajectory length less than the minimum length threshold; if so, the corresponding two new trajectory segments can be merged.
[0124] (A) Calculate the first compressed scan trajectory W i The lengths L of the k-th and (k+1)-th segments of the trajectory are... k and L k+1 :
[0125]
[0126] (B) If L k <L or L k+1 If L < L, then the k-th trajectory segment and the (k+1)-th trajectory segment will be merged, that is, the starting point of the k-th trajectory segment will be taken as the starting point of the merged trajectory, and the ending point of the (k+1)-th trajectory segment will be taken as the ending point of the merged trajectory, and step (C) will be executed; if L k >L and L k+1 If the value is greater than L, then proceed to step (D).
[0127] (C) Determine whether the (k+1)th segment of the trajectory is the first compressed scan trajectory W. i If the last segment of the trajectory is the final segment, record the coordinates of the start and end points of the merged trajectory and end the search. Otherwise, repeat step (B).
[0128] (D) Record the starting and ending coordinates of the kth and k+1th segments of the trajectory, and repeat (B) to (C) starting from the starting point of the k+2th segment of the trajectory.
[0129] After secondary trajectory compression based on length, the obtained target scanning trajectory can be represented by a set of directed sparse points. The diagram shows the effect of secondary trajectory compression based on trajectory length, i.e., the effect of the target scanning trajectory. Figure 4 As shown.
[0130] In this embodiment, during actual scanning, excessively dense points can reduce communication efficiency with the robot. Since the surface of the workpiece being scanned is mostly a smooth curved surface, continuous scanning can be performed. Therefore, by calculating the cosine value of the direction angle between each pair of adjacent trajectory segments, it is determined whether each pair of adjacent trajectory segments can be merged based on the cosine value of the direction angle. If they can be merged, the corresponding pair of adjacent trajectory segments are merged to obtain the first compressed scanning trajectory. The first compressed scanning trajectory is then compressed again to obtain the target scanning trajectory. The projected trajectory is simplified, and redundant points are removed while maintaining the trajectory shape.
[0131] Continue to refer to Figure 2 Based on the first or second embodiment described above, a third embodiment of the laser cleaning trajectory compression method of the present invention is proposed.
[0132] In this embodiment, step S10 includes:
[0133] Obtain the workpiece mesh of the workpiece to be scanned, and calculate the minimum directed bounding box based on the workpiece mesh;
[0134] An initial scan trajectory is generated based on the minimum directed bounding box;
[0135] The workpiece mesh is projected onto the upper surface of the minimum bounding box to obtain a projected mesh;
[0136] Discretize the initial scan trajectory into a set of points;
[0137] Based on the projection grid, find the target projection grid surface that is closest to each point in the discrete point set of each initial scan trajectory, and record the target index of the target projection grid surface.
[0138] Project the discrete points in the point set onto the target grid corresponding to the target number in the workpiece grid to obtain the set of scan trajectory projection points;
[0139] The compressed scanning trajectory of the workpiece to be scanned is fitted based on the set of projection points of the scanning trajectory.
[0140] It should be noted that the mesh is projected onto the top surface of the minimum bounding box. The coordinates of the vertices on the top surface of the minimum bounding box are A(x...). min ,y min ,z min ), B(x) min ,y max ,z min ), C(x) max ,y max,z min ), D(x max ,y min ,z min Then for any v oi (x oi ,y oi ,z oi Let z oi =z min , to obtain the projected mesh.
[0141] It should be understood that the distance from the walk is set to Δt = R. res R res For point cloud resolution; the initial scan trajectory G i A set of points discretized into a directed arrangement
[0142] It should be noted that the initial scan trajectory G i A set of discrete points arranged in a directed manner. any point in Find the match in the projected grid The nearest target projection grid surface Record The ID number, i.e., the target sequence number, forms a sequence pair of points and projection surfaces.
[0143] Understandably, the initial scan trajectory G i Each point in Projecting along the z-axis onto the mesh surface with index id in the 3D workpiece mesh, obtain the set of projection points for the scan trajectory. in This indicates projection along the z-axis.
[0144] In a specific implementation, the scanning trajectory to be compressed can be fitted within a preset error range in the z-direction based on the set of projection points of the scanning trajectory. The preset error range is set according to an empirical value, such as 1 mm.
[0145] In this embodiment, the step length is taken as the point cloud resolution, and dense points are obtained to fit the cleaning trajectory, maximizing the use of laser beam energy and making the laser beam energy uniformly distributed on the workpiece surface, thereby improving the cleaning effect.
[0146] Continue to refer to Figure 2 Based on the first or second embodiment described above, a fourth embodiment of the laser cleaning trajectory compression method of the present invention is proposed.
[0147] In this embodiment, step S10 includes:
[0148] Obtain the workpiece mesh of the workpiece to be scanned, and calculate the minimum directed bounding box based on the workpiece mesh;
[0149] An initial scan trajectory is generated based on the minimum directed bounding box;
[0150] The workpiece mesh is projected onto the upper surface of the minimum bounding box to obtain a projected mesh;
[0151] Traverse the four corner patches in the projection grid, find the four corner patches that intersect with the initial scanning trajectory, and obtain a set of candidate projection patches;
[0152] Traverse the edges of the four corner faces in the candidate projection face set, and find the intersecting edges and intersection points that intersect with the initial scanning trajectory;
[0153] Based on the intersecting edges and intersection points, the projection points of the intersection points are found in the workpiece mesh, and all the found projection points constitute a projection point set.
[0154] The compression scanning trajectory of the workpiece to be scanned is fitted based on the projection points in the projection point set.
[0155] It should be understood that the mesh is projected onto the top surface of the minimum bounding box. The coordinates of the vertices on the top surface of the minimum bounding box are A(x...). min ,y min ,z min ), B(x) min ,y max ,z min ), C(x) max ,y max ,z min ), D(x max ,y min ,z min Then for any v oi (x oi ,y oi ,z oi Let z oi =z min , to obtain the projected mesh.
[0156] Understandably, for any given initial scan trajectory, the side length of the directed bounding box along the X-axis is calculated. The number of laser cleaning trajectories is:
[0157]
[0158] in For the floor function, i ∈ [0, N). Traverse the four corner faces in the projection grid, calculate the center of each corner face, and based on the corner face centers, for any initial scan trajectory, find the corner faces that intersect the initial scan trajectory, and record the target index of the intersecting corner faces. All corner faces that meet the conditions constitute the candidate projection face set P. Fi , i∈[0,N).
[0159] It should be noted that traversing the set of candidate projection patches P Fi Find the edges of the four corner faces that correspond to the initial scan trajectory T. i For intersecting edges, calculate the intersection point and record the target index (id) of the intersecting edge and the coordinates of the intersection point. Sequence pairs that make up intersections and edges
[0160] In a specific implementation, based on the target index ID of the intersecting edge, the target edge corresponding to the target index ID is located in the original workpiece mesh, and the projection point of the intersection point is found on the target edge. Specifically, the coordinates of the intersection point can be calculated based on the intersecting edge. Based on the coordinates of the intersection point Find the corresponding point on the target edge in the original workpiece mesh. As a point The projection point on the grid surface; alternatively, the point on the target edge can be calculated based on the coordinates of the two endpoints of the target edge. The projection points on the grid surface. This embodiment does not impose any limitations on this.
[0161] It should be understood that, based on the projection points in the projection point set, multiple points are fitted into a line to fit the compressed scanning trajectory of the workpiece to be scanned.
[0162] In this embodiment, by finding the intersecting edges and intersection points that intersect with the initial scanning trajectory, projection points are found in the workpiece grid based on the intersecting edges and intersection points. All the found projection points constitute a projection point set. The actual scanning trajectory of the workpiece to be scanned is fitted based on the projection points in the projection point set. The fitted scanning trajectory to be compressed can overcome the limitations of the shape and placement of the workpiece to be cleaned, so that the laser beam energy is evenly distributed on the surface of the workpiece, thereby improving the cleaning effect.
[0163] Furthermore, the present invention also proposes a storage medium storing a laser cleaning trajectory compression program, wherein when the laser cleaning trajectory compression program is executed by a processor, it implements the steps of the laser cleaning trajectory compression method described above.
[0164] In addition, refer to Figure 5The present invention also proposes a laser cleaning trajectory compression device, which includes:
[0165] The acquisition module 10 is used to acquire the scan trajectory to be compressed of the workpiece to be scanned, wherein the scan trajectory to be compressed is a set of dense points arranged in a directed manner.
[0166] The segmentation module 20 is used to divide the scanning trajectory into multiple trajectory segments based on the dense point set;
[0167] Compression module 30 is used to compress the multiple trajectory segments according to preset rules to obtain the target scanning trajectory;
[0168] The deduplication module 40 is used to represent the target scanning trajectory as a sparse point set, perform deduplication processing on the sparse point set, and obtain the target scanning trajectory.
[0169] Other embodiments or specific implementations of the laser cleaning trajectory compression device of the present invention can be referred to the above-described method embodiments, and will not be repeated here.
[0170] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0171] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the unit claims listing several devices, several of these devices may be embodied by the same hardware item. The use of the terms first, second, and third, etc., does not indicate any order and can be interpreted as identifiers.
[0172] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0173] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A laser cleaning trajectory compression method, characterized in that, The laser cleaning trajectory compression method includes the following steps: Obtain the compressed scanning trajectory of the workpiece to be scanned, wherein the compressed scanning trajectory is a set of directed dense points; Based on the dense point set, the scanning trajectory is divided into multiple trajectory segments; The multiple trajectory segments are compressed according to preset rules to obtain the target scanning trajectory; The target scanning trajectory is represented as a sparse point set, and the sparse point set is deduplicated to obtain the target scanning trajectory. The step of compressing the multiple trajectory segments according to a preset rule to obtain the target scanning trajectory includes: Calculate the cosine value of the direction angle between each pair of adjacent trajectory segments; Based on the cosine value of the direction angle, determine whether two adjacent trajectory segments can be merged; If they can be merged, then the corresponding two adjacent trajectory segments are merged to obtain the first compressed scan trajectory; The first compressed scan trajectory is compressed again to obtain the target scan trajectory; The step of compressing the first compressed scan trajectory again to obtain the target scan trajectory includes: The first compressed scan trajectory is represented as a set of directed sparse points; Based on the sparse point set, the first compressed scan trajectory is divided into multiple new trajectories; Calculate the length of each segment of the new trajectory; Based on the trajectory length, determine whether any two adjacent new trajectory segments can be merged; If merging is possible, the two adjacent new trajectories will be merged to obtain the target scanning trajectory.
2. The laser cleaning trajectory compression method as described in claim 1, characterized in that, The step of determining whether two adjacent trajectory segments can be merged based on the cosine value of the direction angle includes: Set an included angle threshold and calculate the cosine value of the included angle threshold; If the cosine value of the direction angle is greater than the cosine value of the angle threshold, then the two adjacent trajectories can be merged.
3. The laser cleaning trajectory compression method as described in claim 1, characterized in that, The step of determining whether two adjacent new trajectory segments can be merged based on the trajectory length includes: Set the minimum trajectory length threshold; Determine whether at least one of the two adjacent new trajectory segments has a trajectory length less than the minimum length threshold; If so, the two corresponding new trajectories can be merged.
4. The laser cleaning trajectory compression method according to any one of claims 1 to 3, characterized in that, The process of acquiring the compressed scanning trajectory of the workpiece to be scanned includes: Obtain the workpiece mesh of the workpiece to be scanned, and calculate the minimum directed bounding box based on the workpiece mesh; An initial scan trajectory is generated based on the minimum directed bounding box; The workpiece mesh is projected onto the upper surface of the smallest oriented bounding box to obtain the projected mesh; Discretize the initial scan trajectory into a set of points; Based on the projection grid, find the target projection grid surface that is closest to each point in the discrete point set of each initial scan trajectory, and record the target index of the target projection grid surface. Project the discrete points in the point set onto the target grid corresponding to the target number in the workpiece grid to obtain the set of scan trajectory projection points; The compressed scanning trajectory of the workpiece to be scanned is fitted based on the set of projection points of the scanning trajectory.
5. The laser cleaning trajectory compression method according to any one of claims 1 to 3, characterized in that, The process of acquiring the compressed scanning trajectory of the workpiece to be scanned includes: Obtain the workpiece mesh of the workpiece to be scanned, and calculate the minimum directed bounding box based on the workpiece mesh; An initial scan trajectory is generated based on the minimum directed bounding box; The workpiece mesh is projected onto the upper surface of the smallest oriented bounding box to obtain the projected mesh; Traverse the four corner faces in the projection grid, find the four corner faces that intersect with the initial scanning trajectory, and obtain a set of candidate projection faces; Traverse the edges of the four corner faces in the candidate projection face set, and find the intersecting edges and intersection points that intersect with the initial scanning trajectory; Based on the intersecting edges and intersection points, the projection points of the intersection points are found in the workpiece mesh, and all the found projection points constitute a projection point set. The compression scanning trajectory of the workpiece to be scanned is fitted based on the projection points in the projection point set.
6. A laser cleaning trajectory compression device, which applies the laser cleaning trajectory compression method as described in claim 1, characterized in that, The laser cleaning trajectory compression device includes: The acquisition module is used to acquire the scan trajectory to be compressed of the workpiece to be scanned, wherein the scan trajectory to be compressed is a set of directed dense points; A segmentation module is used to divide the scanning trajectory into multiple trajectory segments based on the dense point set; A compression module is used to compress the multiple trajectory segments according to preset rules to obtain the target scanning trajectory; The deduplication module is used to represent the target scanning trajectory as a sparse point set, and to perform deduplication processing on the sparse point set to obtain the target scanning trajectory.
7. A laser cleaning trajectory compression device, characterized in that, The laser cleaning trajectory compression device includes: a memory, a processor, and a laser cleaning trajectory compression program stored in the memory and executable on the processor. When the laser cleaning trajectory compression program is executed by the processor, it implements the steps of the laser cleaning trajectory compression method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores a laser cleaning trajectory compression program, which, when executed by a processor, implements the steps of the laser cleaning trajectory compression method as described in any one of claims 1 to 5.