Workpiece edge trajectory planning method and device, computer equipment and storage medium
By acquiring the 3D point cloud information and local point cloud information of the workpiece, and combining it with the projection reference plane correction, the key points of the workpiece edge are identified, which solves the problems of low efficiency and insufficient accuracy of workpiece edge trajectory recognition in the existing technology, and realizes efficient and high-precision edge trajectory planning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SPEEDBOT ROBOTICS CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies have low efficiency and insufficient accuracy in the welding, plasma cutting and precision grinding processes of large structural components, especially when the workpiece surface is uneven or the placement posture is tilted, the accuracy of edge trajectory recognition is even lower.
By acquiring the 3D point cloud information of the workpiece to be tested and combining it with the preset workpiece template information, the initial edge trajectory is determined. Local point cloud information is then acquired through a scanning device to identify multiple key edge points. Finally, the edge trajectory of the workpiece is determined based on these key points and the initial edge trajectory. Data dimensionality reduction and correction are performed using the 3D point cloud information and the projection reference plane to improve the recognition accuracy.
It improves the accuracy and efficiency of workpiece edge trajectory recognition, ensuring high-precision edge trajectory planning under complex workpiece surface conditions.
Smart Images

Figure CN121904087B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial automation technology, and in particular to a workpiece edge trajectory planning method, apparatus, computer equipment, and computer-readable storage medium. Background Technology
[0002] In modern industrial automation, particularly in welding, plasma cutting, and precision grinding processes for large structural components, accurately obtaining the bevel trajectory of the workpiece edge is a core element in ensuring processing quality. A bevel refers to a groove or inclined edge with a specific shape and angle pre-machined on the workpiece edge before welding, cutting, or other processes, designed to ensure weld penetration and joint strength. In actual production, manual teaching or image-based visual positioning methods are primarily used to determine the workpiece edge trajectory, which serves as the path for beveling.
[0003] Manual teaching requires an operator to hold a teaching pendant and control the robot's end effector to approach the workpiece edge point by point, recording a series of waypoints to obtain the workpiece edge trajectory. This method relies on the operator's experience and is relatively inefficient. Image-based visual localization methods identify the workpiece edges from a two-dimensional image of the workpiece. While this improves efficiency, the accuracy of edge trajectory recognition is low when the workpiece surface has undulations or the placement posture is tilted. Therefore, how to efficiently identify workpiece edge trajectories while improving their accuracy has become an urgent problem to be solved in this field. Summary of the Invention
[0004] Therefore, it is necessary to provide a workpiece edge trajectory planning method, apparatus, computer equipment, and computer-readable storage medium that can improve both the efficiency and accuracy of workpiece edge trajectory recognition, in order to address the aforementioned technical problems.
[0005] In a first aspect, this application provides a workpiece edge trajectory planning method for computer equipment, the method comprising:
[0006] Acquire the three-dimensional point cloud information of the workpiece under test in three-dimensional space;
[0007] The initial edge trajectory of the workpiece to be tested is determined based on the 3D point cloud information and the preset workpiece template information.
[0008] Acquire multiple local point cloud information of the workpiece to be tested, wherein the local point cloud information is obtained by the scanning device based on the initial edge trajectory;
[0009] Based on the local point cloud information, multiple key edge points of the workpiece to be tested are determined.
[0010] The edge trajectory of the workpiece to be measured is determined based on each edge key point and the initial edge trajectory.
[0011] In one embodiment, determining the initial edge trajectory of the workpiece to be tested based on the 3D point cloud information and the preset workpiece template information includes:
[0012] Determine the projection reference plane based on 3D point cloud information;
[0013] A two-dimensional point cloud image is obtained by projecting three-dimensional point cloud information onto a projection reference plane.
[0014] Determine the offset parameters between the 2D point cloud image and the workpiece template information;
[0015] The workpiece template information is mapped to three-dimensional space based on the offset parameters to obtain the initial edge trajectory of the workpiece to be tested.
[0016] In one embodiment, the initial edge trajectory includes multiple primitives; acquiring multiple local point cloud information of the workpiece to be measured includes:
[0017] Based on the length of each graphic element and the target sampling interval corresponding to each graphic element, multiple sampling points in each graphic element are determined;
[0018] Acquire local point cloud information of the workpiece under test at each sampling point.
[0019] In one embodiment, the method further includes:
[0020] For each graphic element, the number of sampling points for that graphic element is determined based on its length and the corresponding preset sampling interval.
[0021] If the number of sampling points is within a preset range, the preset sampling interval will be used as the target sampling interval.
[0022] If the number of sampling points is outside the preset range, the target sampling interval for each graphic element is determined based on the number of sampling points for each graphic element and the preset sampling interval.
[0023] In one embodiment, the workpiece to be tested includes a side surface, a first surface, and a second surface, which are arranged opposite to each other, with the second surface located on a processing platform; the local point cloud information is obtained by scanning the first surface and the side surface at sampling points using a scanning device; multiple edge key points of the edge of the workpiece to be tested are determined based on the local point cloud information, including:
[0024] For each local point cloud information, the surface information of the first surface and the side information of the side surface are determined based on the local point cloud information;
[0025] Based on the surface and side information corresponding to each local point cloud information, the intersection line between the first surface and the side corresponding to each local point cloud information is determined respectively.
[0026] The intersection points between each line and the scanning plane of the scanning device are all taken as edge key points.
[0027] In one embodiment, determining the edge trajectory of the workpiece to be measured based on each edge key point and the initial edge trajectory includes:
[0028] Determine the projection reference plane based on 3D point cloud information;
[0029] The initial edge trajectory and each edge key point are projected onto the projection reference plane to obtain a two-dimensional trajectory and multiple projection points;
[0030] The two-dimensional trajectory is corrected based on the distance from each projection point to the two-dimensional trajectory to obtain the optimized two-dimensional trajectory;
[0031] The two-dimensional optimized trajectory is mapped to three-dimensional space to obtain the edge trajectory of the workpiece to be tested.
[0032] In one embodiment, the two-dimensional trajectory includes multiple line segments; the two-dimensional trajectory is corrected based on the distance from each projection point to the two-dimensional trajectory to obtain an optimized two-dimensional trajectory, including:
[0033] In a series of line segments on a two-dimensional trajectory, determine the nearest neighbor line segment corresponding to each projection point;
[0034] The correction parameters for the two-dimensional trajectory are determined based on the perpendicular distance between each projection point and its corresponding nearest neighbor line segment.
[0035] The two-dimensional trajectory is corrected based on the correction parameters to obtain the optimized two-dimensional trajectory.
[0036] Secondly, this application also provides a workpiece edge trajectory planning device, comprising:
[0037] The three-dimensional information acquisition module is used to acquire the three-dimensional point cloud information of the workpiece under test in three-dimensional space;
[0038] The coarse positioning module is used to determine the initial edge trajectory of the workpiece to be measured based on the 3D point cloud information and the preset workpiece template information.
[0039] The local information acquisition module is used to acquire multiple local point cloud information of the workpiece to be tested. The local point cloud information is obtained by the scanning device based on the initial edge trajectory.
[0040] The edge recognition module is used to determine multiple key edge points of the workpiece under test based on local point cloud information.
[0041] The trajectory positioning module is used to determine the edge trajectory of the workpiece to be measured based on each edge key point and the initial edge trajectory.
[0042] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0043] Acquire the three-dimensional point cloud information of the workpiece under test in three-dimensional space;
[0044] The initial edge trajectory of the workpiece to be tested is determined based on the 3D point cloud information and the preset workpiece template information.
[0045] Acquire multiple local point cloud information of the workpiece to be tested, wherein the local point cloud information is obtained by the scanning device based on the initial edge trajectory;
[0046] Based on the local point cloud information, multiple key edge points of the workpiece to be tested are determined.
[0047] The edge trajectory of the workpiece to be measured is determined based on each edge key point and the initial edge trajectory.
[0048] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0049] Acquire the three-dimensional point cloud information of the workpiece under test in three-dimensional space;
[0050] The initial edge trajectory of the workpiece to be tested is determined based on the 3D point cloud information and the preset workpiece template information.
[0051] Acquire multiple local point cloud information of the workpiece to be tested, wherein the local point cloud information is obtained by the scanning device based on the initial edge trajectory;
[0052] Based on the local point cloud information, multiple key edge points of the workpiece to be tested are determined.
[0053] The edge trajectory of the workpiece to be measured is determined based on each edge key point and the initial edge trajectory.
[0054] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0055] Acquire the three-dimensional point cloud information of the workpiece under test in three-dimensional space;
[0056] The initial edge trajectory of the workpiece to be tested is determined based on the 3D point cloud information and the preset workpiece template information.
[0057] Acquire multiple local point cloud information of the workpiece to be tested, wherein the local point cloud information is obtained by the scanning device based on the initial edge trajectory;
[0058] Based on the local point cloud information, multiple key edge points of the workpiece to be tested are determined.
[0059] The edge trajectory of the workpiece to be measured is determined based on each edge key point and the initial edge trajectory.
[0060] The aforementioned workpiece edge trajectory planning method, apparatus, computer equipment, and computer-readable storage medium acquire three-dimensional point cloud information of the workpiece under test in three-dimensional space; determine the initial edge trajectory of the workpiece under test based on the three-dimensional point cloud information and preset workpiece template information; acquire multiple local point cloud information of the workpiece under test, wherein the local point cloud information is obtained by scanning equipment based on the initial edge trajectory; determine multiple edge key points of the edge of the workpiece under test based on each local point cloud information; and determine the edge trajectory of the workpiece under test based on each edge key point and the initial edge trajectory. By determining the surface shape and placement posture of the workpiece under test in three-dimensional space through the three-dimensional point cloud information of the workpiece under test, the initial edge trajectory of the workpiece under test is initially determined. Compared with the method of recognizing workpiece edge trajectories through two-dimensional images, the accuracy of edge recognition can be improved. Then, local point cloud information is acquired based on the initial edge trajectory, and multiple edge key points on the edge of the workpiece under test are further determined based on the local point cloud information. The initial edge trajectory is refined based on the edge key points, further improving the accuracy of edge trajectory recognition. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0062] Figure 1 This is an application environment diagram of the workpiece edge trajectory planning method in one embodiment;
[0063] Figure 2 This is a flowchart illustrating a workpiece edge trajectory planning method in one embodiment;
[0064] Figure 3 This is a detailed flowchart illustrating the steps for determining the initial edge trajectory of the workpiece to be tested based on 3D point cloud information and preset workpiece template information in one embodiment.
[0065] Figure 4 This is a detailed flowchart illustrating the steps for acquiring multiple local point cloud information of a workpiece under test in one embodiment.
[0066] Figure 5 This is a flowchart illustrating the workpiece edge trajectory planning method in another embodiment;
[0067] Figure 6 This is a detailed flowchart illustrating the steps for determining multiple edge key points of the workpiece edge based on local point cloud information in one embodiment.
[0068] Figure 7 This is a detailed flowchart illustrating the steps for determining the edge trajectory of a workpiece under test based on each edge key point and the initial edge trajectory in one embodiment.
[0069] Figure 8 This is a detailed flowchart illustrating the steps of correcting the two-dimensional trajectory based on the distance from each projection point to the two-dimensional trajectory in one embodiment to obtain the two-dimensional optimized trajectory.
[0070] Figure 9 This is a schematic flowchart of an example of a workpiece edge trajectory planning method in one embodiment;
[0071] Figure 10 This is a structural block diagram of a workpiece edge trajectory planning device in one embodiment;
[0072] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0074] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0075] The workpiece edge trajectory planning method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with scanning device 104 via a network. When performing trajectory detection on a workpiece under test, terminal 102 controls scanning device 104 to scan the workpiece. The workpiece can be placed on a processing platform or held by a fixture. Scanning device 104 scans the workpiece, acquires its 3D point cloud information in three-dimensional space, and sends it to terminal 102. Terminal 102 determines the initial edge trajectory of the workpiece based on the 3D point cloud information and the workpiece template information stored in the terminal. Then, it controls scanning device 104 to scan the workpiece along the initial edge trajectory, acquiring multiple local point cloud information of the workpiece. This local point cloud information is then sent to terminal 102. Terminal 102 analyzes the local point cloud information to identify multiple edge key points on the edge of the workpiece and corrects the initial edge trajectory based on these edge key points to obtain the final edge trajectory of the workpiece. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and IoT devices. IoT devices can be industrial computers, etc. The scanning device 104 may include devices such as structured light cameras, laser profilometers, and line scan cameras that can be used to scan the three-dimensional information of objects.
[0076] In one exemplary embodiment, such as Figure 2 As shown, a workpiece edge trajectory planning method is provided, which can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps 201 to 205. Wherein:
[0077] Step 201: Obtain the three-dimensional point cloud information of the workpiece to be tested in three-dimensional space.
[0078] The workpiece to be tested refers to a three-dimensional solid object that requires edge detection, such as industrial parts or molds. Three-dimensional point cloud information refers to a collection of three-dimensional coordinate points obtained by scanning the surface of the workpiece using a three-dimensional scanning device. Each point contains a spatial position (X, Y, Z coordinates) and is used to characterize the geometric shape of the workpiece surface.
[0079] In this embodiment, the terminal controls the 3D scanning device to perform a complete scan of the workpiece under test, collecting dense point data of the workpiece surface in three-dimensional space. This point data constitutes 3D point cloud information, completely covering the visible surface area of the workpiece, forming a digital representation of the workpiece's geometry.
[0080] Step 202: Determine the initial edge trajectory of the workpiece to be tested based on the 3D point cloud information and the preset workpiece template information.
[0081] The preset workpiece template information refers to the pre-stored standard 3D model or point cloud data of the reference workpiece, which includes the workpiece's ideal geometric dimensions, shape features, and edge position information. The initial edge trajectory refers to the preliminary estimated continuous path of the edge of the workpiece to be measured in 3D space. This path may deviate due to workpiece placement or manufacturing errors.
[0082] In this embodiment, the terminal registers and compares the 3D point cloud information of the workpiece to be tested with the workpiece template information, and calculates the spatial transformation relationship between the two. Based on the comparison result, the edge positions defined in the workpiece template information are mapped onto the 3D point cloud information to generate a preliminary edge trajectory.
[0083] Step 203: Obtain multiple local point cloud information of the workpiece to be tested.
[0084] Among them, local point cloud information refers to the point cloud data obtained by the scanning device along the initial edge trajectory. It has a narrow coverage area but a high point density and can be used to depict detailed features.
[0085] In this embodiment, the terminal controls the scanning device to move along the initial edge trajectory and repeatedly scans the trajectory edge to acquire a series of local point clouds that can reflect the edge features of the workpiece. Each local point cloud corresponds to a neighborhood of the edge trajectory, and the density of the local scan point cloud can be set to be higher than that of the global scan result to capture subtle geometric changes in the edge region.
[0086] Step 204: Determine multiple edge key points of the workpiece edge to be measured based on the local point cloud information.
[0087] Among them, edge key points refer to three-dimensional points in the local point cloud that characterize the edge features of the workpiece, such as curvature change points, boundary turning points, or normal vector discontinuities. These points are the core points that constitute the actual edge trajectory.
[0088] In this embodiment, the terminal analyzes each local point cloud and identifies feature points belonging to the workpiece edge. By processing all local point clouds, a set of discretely distributed three-dimensional key points are extracted, which together depict the local geometry of the workpiece edge.
[0089] Step 205: Determine the edge trajectory of the workpiece to be measured based on each edge key point and the initial edge trajectory.
[0090] Among them, the edge trajectory refers to the continuous path of the edge of the workpiece to be measured in three-dimensional space, which is ultimately determined and represented by a series of ordered three-dimensional coordinate points or parametric curves, reflecting the precise position of the actual edge of the workpiece.
[0091] In this embodiment, all extracted edge key points are fused with the initial edge trajectory via a terminal, and the initial trajectory is corrected and optimized using the key points. Curve fitting, spline interpolation, or iterative optimization algorithms can be used to generate a smooth, continuous 3D trajectory that fits the key points. The optimization process ensures that the trajectory conforms to the spatial distribution of the key points while maintaining the geometric continuity of the edges.
[0092] The surface shape and orientation of the workpiece in three-dimensional space are determined by using the three-dimensional point cloud information of the workpiece to be tested, and the initial edge trajectory of the workpiece is initially determined. Compared with the method of recognizing the edge trajectory of the workpiece through two-dimensional images, the accuracy of edge recognition can be improved. Then, local point cloud information is obtained based on the initial edge trajectory, and multiple edge key points on the edge of the workpiece are further determined based on the local point cloud information. The initial edge trajectory is refined based on the edge key points, which further improves the accuracy of edge trajectory recognition.
[0093] In some embodiments, such as Figure 3 As shown, step 202 above includes steps 301 to 304. Wherein:
[0094] Step 301: Determine the projection reference plane based on the 3D point cloud information.
[0095] The projection reference plane refers to a reference plane that is manually defined or automatically fitted in three-dimensional space. It can be the main surface or feature plane of the workpiece under test, used to reduce the three-dimensional point cloud to two-dimensional space for processing. For thinner sheet workpieces, the worktable plane can be used directly as the projection reference; for curved workpieces, cylindrical projection or unrolling projection can be used to map the 3D curved surface into a 2D image for processing.
[0096] When detecting workpiece edges, 3D point cloud data of the workpiece surface can be directly acquired using a 3D scanning device. Point cloud registration is then performed using 3D feature descriptors (such as FPFH and SHOT), or the ICP (Iterative Closest Point) algorithm is used to align the acquired point cloud with a standard model, thereby calculating the workpiece's pose in the robot's base coordinate system. However, directly performing ICP registration between the point cloud and the model in 3D space is a non-convex optimization problem. When the initial pose deviation of the workpiece is large, or when there is a lot of noise in the point cloud due to ambient light interference, the ICP algorithm is prone to getting trapped in local minima, leading to mismatches. In addition, processing millions of point cloud data is time-consuming, making it difficult to meet the cycle time requirements of online production. Therefore, the 3D data can be projected into 2D for matching and correction before being remapped back to 3D space to reduce the computational complexity of the registration process.
[0097] In this embodiment, the terminal performs spatial analysis on the 3D point cloud information, selects a relatively flat and representative area on the workpiece surface, and calculates an optimal fitting plane in 3D spatial coordinates as the projection reference plane. For example, the main planar regions in the 3D point cloud are fitted into a mathematical plane equation using the least squares method to ensure that the plane can reasonably reflect the overall orientation and layout of the workpiece.
[0098] Step 302: Project the three-dimensional point cloud information onto the projection reference plane to obtain a two-dimensional point cloud image.
[0099] Among them, a two-dimensional point cloud image refers to the set of points formed on a two-dimensional plane after the three-dimensional point cloud is projected perpendicularly along the normal direction of the projection reference plane. Each point retains its two-dimensional coordinate information on the reference plane, while discarding the coordinate components in the height direction.
[0100] In this embodiment, the terminal orthogonally projects each point in the 3D point cloud along the normal direction of the projection reference plane, mapping all points into the 2D coordinate system where the reference plane is located, generating a 2D point cloud image containing only planar coordinates. The relative positional relationships of the points are maintained during the projection process, ensuring that the workpiece's contour and edge features are preserved in the 2D image.
[0101] Step 303: Determine the offset parameters between the two-dimensional point cloud image and the workpiece template information.
[0102] The offset parameter refers to the transformation parameter that describes the positional difference between the two-dimensional point cloud image and the workpiece template information. It usually includes translation amount, rotation angle and possible scaling factor, and is used to spatially align the template with the measured data.
[0103] In this embodiment, the terminal performs feature matching or correlation calculation on the two-dimensional point cloud image and the workpiece template information, detects the differences between the two in translation, rotation, and scaling, and calculates a set of transformation parameters. These parameters quantitatively describe what geometric transformations the template needs to undergo to coincide with the measured point cloud image on the two-dimensional plane.
[0104] Step 304: Map the workpiece template information to three-dimensional space according to the offset parameters to obtain the initial edge trajectory of the workpiece to be tested.
[0105] In this embodiment, the terminal uses the calculated offset parameters to perform corresponding translation, rotation and scaling transformations on the edge path defined in the workpiece template. Then, in three-dimensional space, combined with the position and direction of the projection reference plane, the transformed two-dimensional edge trajectory is back-projected onto the original three-dimensional coordinate system to generate the initial edge trajectory of the workpiece to be measured in three-dimensional space.
[0106] Specifically, in one example, the terminal is inputted with a set of workpiece point clouds acquired by a 3D structured light camera. Since the original point cloud contains background noise (such as conveyor belts and fixtures), it is necessary to first define the Region of Interest (ROI) and perform statistical filtering to remove noise.
[0107] Subsequently, the RANSAC (Random Sample Consensus) algorithm was used to perform plane fitting on the first surface of the workpiece to eliminate the influence of workpiece tilt. The plane equation is expressed as:
[0108] Ax + By + Cz + D = 0
[0109] Where n = (A, B, C) T Let be the unit normal vector. Construct a local planar coordinate system F based on this normal vector. local Its rotation matrix Rp lane =[u, v, w], where w=n, u is any unit vector in the plane, and v=w×u. This step ensures that subsequent projection operations are performed along the workpiece normal, avoiding projection distortion.
[0110] To avoid complex 3D matching, the 3D data is reduced to 2D. A projection resolution ρ is defined (e.g., 0.5 mm / pixel). For any point p in the point cloud... k Transform it to a local coordinate system and project it:
[0111]
[0112] Among them O local Let z be the projection of the centroid of the point cloud onto the plane. Discard z. k 'Component, will (x k ′,y k Discretize into image pixel coordinates (u') k v k ):
[0113]
[0114] In the generated 2D image, the pixel value of the area covered by point clouds is set to 255, and the background is set to 0. Simultaneously, the workpiece's DXF file is read, and a standard workpiece template binary image is drawn at the same resolution ρ. A template binary image is then generated based on the workpiece DXF.
[0115] Then, a shape-based template matching algorithm (such as gradient direction-based matching) is used to search for the workpiece template in the projection image and calculate the transformation parameters of the workpiece in the image coordinate system: center translation (u0, v0) and rotation angle θ0.
[0116] Based on this matching result, the discrete points (u) of all primitives (lines, arcs) in the DXF file will be... dxf v dxfBy back-projecting back into the 3D world coordinate system, the coarse positioning trajectory P is obtained. world :
[0117]
[0118]
[0119] The trajectory accuracy obtained at this time is usually around ±3mm, which is sufficient to guide the movement of subsequent line scanning cameras and prevent collisions.
[0120] By introducing a projection reference plane and two-dimensional projection processing, the complex three-dimensional registration problem is transformed into a more efficient two-dimensional image registration problem, significantly reducing computational complexity and time consumption. Precise mapping based on offset parameters ensures the alignment accuracy between the template information and the actual workpiece spatial position, enabling the generated initial edge trajectory to closely match the expected position of the actual workpiece edge.
[0121] In one exemplary embodiment, the initial edge trajectory includes multiple primitives; such as Figure 4 As shown, step 203 above includes steps 401 and 402, wherein:
[0122] Step 401: Determine multiple sampling points in each graphic element based on the length of each graphic element and the target sampling interval corresponding to each graphic element.
[0123] In this context, primitives refer to the basic geometric units that constitute the initial edge trajectory, typically straight line segments, circular arc segments, or spline curve segments. Each primitive represents a continuous geometric shape within the edge trajectory. The target sampling interval refers to the preset desired distance between adjacent sampling points; this parameter determines the density and coverage of local point cloud information acquisition. Sampling points refer to discrete location points selected on the primitives according to certain rules; these points are used to guide the scanning equipment in performing high-precision data acquisition of local areas.
[0124] In this embodiment, the terminal analyzes each primitive in the initial edge trajectory and calculates the number and specific location of sampling points to be set on each primitive based on its geometric length and the preset target sampling interval. For example, for straight primitives, sampling points can be calculated using an equal-interval method; for curved primitives, sampling is performed using equal arc length or adaptive intervals based on the arc length. The calculation ensures that the sampling points are evenly distributed along the primitive or according to its curvature, covering the entire edge trajectory.
[0125] Step 402: Obtain local point cloud information of the workpiece under test at each sampling point.
[0126] Among them, local point cloud information refers to the point cloud data obtained by high-resolution 3D scanning of a narrow surrounding area with each sampling point as the center. This data focuses on the vicinity of the edge and has high point density and detail resolution.
[0127] In this embodiment, the terminal controls the scanning device to move sequentially to each sampling point location and performs a high-precision 3D scan on the local area near each sampling point to acquire dense point cloud data of that area. Each local point cloud information covers a limited neighborhood range centered on the sampling point, ensuring the capture of microscopic geometric features of the edge region, such as edge corners, chamfers, or defect morphologies.
[0128] By acquiring high-resolution local point clouds at each sampling point, high-detail geometric information along the edge trajectory was obtained. These local point cloud sets together constitute a complete high-precision dataset of the edge region, providing high-precision input for subsequent accurate extraction of edge key points, effectively improving the detail resolution and overall accuracy of edge detection.
[0129] In one exemplary embodiment, such as Figure 5 As shown, the workpiece edge trajectory planning method further includes steps 501 to 503, wherein:
[0130] Step 501: For each graphic element, determine the number of sampling points for the graphic element based on the length of the graphic element and the corresponding preset sampling interval.
[0131] The preset sampling interval refers to the theoretical sampling interval value set in advance according to the detection accuracy requirements. It is used to guide the initial calculation of the number of sampling points to ensure that the sampling density on the edge trajectory meets the basic requirements. The number of sampling points refers to the preliminary number of sampling points calculated for each primitive based on its geometric length and the preset sampling interval. This number may be a decimal and can be rounded or otherwise processed to determine the actual number of usable integer sampling points.
[0132] In this embodiment, the terminal processes each graphic element individually. First, it reads the preset sampling interval parameter, and then calculates the initial number of sampling points that should be distributed on the graphic element based on its geometric length. The calculation method is usually to divide the graphic element length by the preset sampling interval, and the result is the theoretical number of sampling points for that graphic element.
[0133] Step 502: If the number of sampling points is within a preset range, the preset sampling interval is used as the target sampling interval.
[0134] The preset sampling range refers to a pre-defined reasonable interval for the number of sampling points. This interval specifies the upper and lower limits of the acceptable number of sampling points for each graphic element, used to determine whether the initial number of sampling points needs adjustment. Too many sampling points will result in overly complex data, while too few sampling points will make it difficult for the acquired data to reflect the true characteristics of the graphic elements, resulting in low accuracy. The target sampling interval refers to the final interval value determined and used for actual sampling. This value may be the same as the preset sampling interval, or it may be adjusted to adapt to the specific length constraints of the graphic elements.
[0135] In this embodiment, the terminal compares the calculated number of sampling points for each graphic element with a preset range. If the number of sampling points for a graphic element falls within the preset range, it indicates that the number of points generated by sampling the graphic element according to the preset sampling interval is within an acceptable range, and there is no need to adjust the sampling density. In this case, the preset sampling interval is directly determined as the target sampling interval for the graphic element.
[0136] Step 503: When the number of sampling points is outside the preset range, determine the target sampling interval for each graphic element based on the number of sampling points for each graphic element and the preset sampling interval.
[0137] In this embodiment, when the initially calculated number of sampling points is too high or too low, the terminal will recalculate a required integer number of sampling points based on the length of the graphic element and the preset number range, and then deduce the actual target sampling interval to be used. For example, for excessively long graphic elements, the interval may need to be slightly increased to control the total number of sampling points from exceeding the upper limit; for excessively short graphic elements, the interval may need to be slightly decreased to ensure that the number of sampling points is not lower than the lower limit.
[0138] Specifically, to avoid an imbalance in the feature weights of long and short sides in the initial edge trajectory, the basic sampling distance can be set to X0 (defined by the user), and the current primitive length can be L. The theoretical number of samples Y = L / X0 is calculated. The actual sampling interval ΔS is strictly executed according to the following piecewise function:
[0139]
[0140] In addition, the orientation of the line scan camera needs to be planned. A "slanted side scan" strategy is adopted, in which the camera optical axis forms an acute angle between 30° and 60° with the normal vector n of the first surface of the workpiece, ensuring that the laser line can simultaneously cover the first and side surfaces of the workpiece, providing a data foundation for high-precision edge extraction.
[0141] First, the initial number of sampling points is calculated for each graphic element based on a unified preset sampling interval. Then, the calculation results are judged for compliance within a preset range, and the target sampling interval is adjusted for non-compliant graphic elements. This ensures that the sampling point planning does not mechanically apply a fixed interval, but rather adaptively optimizes it according to the specific geometric length of each graphic element. While maintaining a basic standard for sampling density at the global level, it achieves flexible adaptation to differences in graphic element length at the local level, thereby ensuring the uniformity and rationality of the sampling point distribution across the entire edge trajectory.
[0142] In an exemplary embodiment, the workpiece to be tested includes a side surface, a first surface, and a second surface, which are arranged opposite to each other, with the second surface located on a processing platform; the local point cloud information is obtained by scanning the first surface and the side surface at sampling points using a scanning device; as shown... Figure 6 As shown, step 204 above includes steps 601 to 603, wherein:
[0143] Step 601: For each local point cloud information, determine the surface information of the first surface and the side information of the side surface based on the local point cloud information.
[0144] In this context, the first surface refers to a primary outer surface of the workpiece that requires edge detection, typically the working surface or feature surface of the workpiece, with its edges being the targets for detection. The side surface refers to the workpiece surface adjacent to and intersecting the first surface; this surface, together with the first surface, constitutes the edge line to be detected. Surface information refers to the set of three-dimensional points belonging to the first surface separated from the local point cloud and their fitted geometric representation, such as a fitted plane equation or surface model. Side surface information refers to the set of three-dimensional points belonging to the side surface separated from the local point cloud and their fitted geometric representation, such as another plane equation or surface model.
[0145] In this embodiment, the terminal processes the local point cloud information acquired at the sampling points. First, the dense point cloud is segmented and classified into regions, and the point data belonging to the first surface and the side surface are clustered separately. Then, geometric fitting is performed on the classified point sets to generate a geometric model representing the spatial orientation of the first surface and the side surface, thereby extracting accurate information representing these two surfaces.
[0146] Step 602: Based on the surface information and side information corresponding to each local point cloud information, determine the intersection line between the first surface and the side corresponding to each local point cloud information.
[0147] In this context, the intersection line refers to the common line formed by the intersection of two geometric surfaces in three-dimensional space. Specifically, it refers to the theoretical intersection line calculated by intersecting the geometric models of the first surface (obtained through fitting) and the side surfaces.
[0148] In this embodiment, the terminal performs an intersection operation on the fitted geometric model of the first surface (e.g., a plane) and the geometric model of the side surface (e.g., another plane). By solving the simultaneous equations of the two geometric models, the intersection line in three-dimensional space is calculated. This intersection line represents the theoretical position of the edge between the first surface and the side surface of the workpiece in this local sampling area.
[0149] Step 603: The intersection points between each intersection line and the scanning plane of the scanning device are all taken as edge key points.
[0150] The scanning plane refers to the two-dimensional plane formed in space by the scanning beam or scanning pattern of the scanning device during a single local scan. For devices such as line laser scanners, this plane is clearly defined. The intersection point refers to the three-dimensional spatial point generated when the calculated three-dimensional spatial intersection line intersects with the scanning plane where the scanning device is located when acquiring the local point cloud.
[0151] In this embodiment, the terminal calculates the intersection of the line and the scanning plane equation determined by the specific spatial pose of the scanning device when acquiring the point cloud for each local point cloud information. This involves calculating the intersection point of the line and the scanning plane in three-dimensional space. Since the scanning plane is the physical constraint surface during point cloud data acquisition, this intersection point represents the precise three-dimensional location of the edge on the scanning plane that is captured during the actual scanning process. The set of intersection points obtained from processing all local point clouds constitutes the edge key points.
[0152] Specifically, the robot moves the line scan camera to collect several frames of local point cloud data. For each frame of point cloud data, the algorithm automatically segments it into a "first surface point set" and a "side surface point set".
[0153] The local plane equations of the two surfaces are fitted separately, and the line of intersection of the two planes is calculated. The intersection point of this line of intersection with the scanning plane is the high-precision physical edge key point q. j .
[0154] This method elevates edge detection from traditional direct identification based on local point cloud features (such as normal mutations) to indirect computation based on region geometric model reconstruction. This significantly enhances robustness to point cloud noise and local defects. Simultaneously, through geometric computation and physical constraints, it avoids the problem of numerous false edges generated by single-viewpoint edge extraction due to the presence of chamfers, burrs, or reflections on actual workpiece edges. This improves the accuracy and reliability of edge key point localization, providing an accurate set of discrete feature points for ultimately generating high-precision workpiece edge trajectories.
[0155] In one exemplary embodiment, such as Figure 7 As shown, step 205 above includes steps 701 to 704, wherein:
[0156] Step 701: Determine the projection reference plane based on the 3D point cloud information.
[0157] In this embodiment, similarly, the terminal performs spatial analysis on the 3D point cloud information, selects a relatively flat and representative area on the workpiece surface, and calculates an optimal fitting plane in 3D spatial coordinates as the projection reference plane. For example, the main planar regions in the 3D point cloud are fitted into a mathematical plane equation using the least squares method to ensure that the plane can reasonably reflect the overall orientation and layout of the workpiece.
[0158] Step 702: Project the initial edge trajectory and each edge key point onto the projection reference plane to obtain a two-dimensional trajectory and multiple projection points.
[0159] In this context, the two-dimensional trajectory refers to a continuous curve obtained on a two-dimensional plane after orthogonally projecting the initial edge trajectory in three-dimensional space along the normal direction of the projection reference plane. The projection point refers to a series of discrete points on a two-dimensional plane obtained after projecting each three-dimensional edge key point onto the projection reference plane in the same manner.
[0160] In this embodiment, the terminal performs a geometric projection transformation, projecting the initial edge trajectory spatial curve and all extracted edge key points perpendicularly along the normal direction of the determined projection reference plane. The projection process converts the three-dimensional coordinates (X, first surface Y, first surface Z) into two-dimensional coordinates (U, first surface V) on the projection plane, thereby generating a two-dimensional initial trajectory line and a set of two-dimensional projection points distributed near the trajectory line.
[0161] Step 703: Correct the two-dimensional trajectory based on the distance from each projection point to the two-dimensional trajectory to obtain the optimized two-dimensional trajectory.
[0162] The distance from the projection point to the two-dimensional trajectory refers to the straight-line distance from each projection point to the nearest point on the two-dimensional trajectory curve within the two-dimensional coordinate system defined by the projection reference plane. This distance reflects the deviation between the initial trajectory and the measured key points. The optimized two-dimensional trajectory refers to a new two-dimensional curve that is closer to all projection points, obtained by geometrically adjusting the original two-dimensional trajectory based on the distance deviations from each projection point to the original two-dimensional trajectory.
[0163] In methods that directly acquire workpiece edges using 3D scanning, for large workpieces exceeding 1 meter in length, while a wide-field-of-view 3D camera can cover the entire surface at once, its spatial resolution is typically between 1mm and 2mm. Furthermore, due to the multipath reflection effect of structured light at the workpiece edges, the point cloud often exhibits "flying points" or rounded corner distortion, failing to meet the ±0.5mm or even higher precision requirements for beveling. Conversely, using a high-precision line scan camera results in an extremely narrow field of view (typically only tens of millimeters), making it impossible to directly locate the workpiece without coarse positioning guidance. Therefore, an initial edge trajectory can be acquired first using a low-resolution wide-field-of-view camera, followed by the acquisition of local details of the workpiece using a high-precision 3D camera to correct the initial edge trajectory, resulting in a final high-resolution 3D trajectory.
[0164] In this embodiment, the terminal calculates the vertical distance or shortest distance from each projection point to the two-dimensional trajectory. These distance values constitute the deviation dataset for trajectory correction. Subsequently, the original two-dimensional trajectory is shaped and smoothed based on the vertical distance or shortest distance to generate a new optimized two-dimensional trajectory. This trajectory more closely conforms to the overall distribution of the projection points in terms of shape.
[0165] Step 704: Map the two-dimensional optimized trajectory to three-dimensional space to obtain the edge trajectory of the workpiece to be tested.
[0166] In this embodiment, the terminal backprojects each point on the two-dimensional optimized trajectory back into three-dimensional space along the normal direction of the determined projection reference plane, based on the spatial position and orientation of the plane. During backprojection, point cloud information or the height information of the initial three-dimensional trajectory needs to be combined to assign the correct depth coordinates to the two-dimensional points, thereby reconstructing a complete continuous edge trajectory in three-dimensional space.
[0167] This transforms the complex three-dimensional nonlinear optimization problem into a more manageable and computationally efficient two-dimensional planar curve fitting problem, thereby significantly reducing the complexity of the optimization algorithm and the consumption of computational resources while ensuring the accuracy of the final three-dimensional trajectory. Simultaneously, the measurement accuracy of discrete edge key points is utilized to correct the continuous initial trajectory, achieving an efficient fusion of theoretical guidance and measured data, ultimately improving the overall reconstruction accuracy and reliability of the workpiece edge trajectory.
[0168] In one exemplary embodiment, the two-dimensional trajectory includes multiple line segments; such as Figure 8 As shown, step 703 above includes steps 801 to 803, wherein:
[0169] Step 801: Among the multiple line segments of the two-dimensional trajectory, determine the nearest neighbor line segment corresponding to each projection point.
[0170] In this context, a line segment refers to a straight line segment that constitutes a two-dimensional trajectory. A two-dimensional trajectory is composed of a series of line segments connected end to end. The nearest neighbor line segment refers to the line segment with the shortest perpendicular distance to any given projection point among all the line segments that make up the two-dimensional trajectory.
[0171] In this embodiment, the terminal calculates for each projection point, traversing all line segments in the two-dimensional trajectory. For each projection point, it calculates the perpendicular distance from it to each line segment (if the foot of the perpendicular falls outside the endpoint of the line segment, it calculates the distance to the nearest endpoint), and finds the line segment with the smallest distance by comparison, and determines this line segment as the nearest neighbor line segment of the projection point. This process establishes a local geometric correspondence between each projection point and the two-dimensional trajectory that is most directly related to it.
[0172] Step 802: Determine the correction parameters of the two-dimensional trajectory based on the vertical distance between each projection point and its corresponding nearest neighbor line segment.
[0173] The vertical distance refers to the straight-line distance from a projection point to the foot of the perpendicular from the line containing its nearest neighbor segment. This distance characterizes the degree to which the projection point deviates from the line segment. The correction parameters refer to the set of parameters used to adjust the position and orientation of the line segment, which may include the translation amount and / or rotation angle of the line segment. Their values are calculated based on the vertical distances of all projection points associated with the line segment.
[0174] In this embodiment, the terminal processes each line segment. First, it collects all projection points of the line segment whose nearest neighbor is the given line segment and calculates the perpendicular distance from these projection points to the line segment. Then, based on these distance values, an optimization algorithm (such as least squares) is used to calculate a set of correction parameters. For example, the average or weighted average of these distances is calculated as a reference for the line segment translation, or a new line segment direction is fitted based on the distribution of points. The goal of the correction parameters is to make the corrected line segment closer to all its associated projection points.
[0175] Alternatively, the target point with the shortest distance to the correction point can be determined in the two-dimensional trajectory. The correction parameters can be solved by minimizing the sum of the distances between each correction point and its corresponding target point. Heuristic algorithms such as Genetic Algorithm (GA) or Particle Swarm Optimization (PSO) can be used to solve this problem, in order to handle extreme cases with extremely large initial errors.
[0176] Step 803: Correct the two-dimensional trajectory according to the correction parameters to obtain the optimized two-dimensional trajectory.
[0177] Among them, the two-dimensional optimized trajectory refers to a new, continuous two-dimensional trajectory formed by reconnecting the adjusted line segments after applying correction parameters to adjust each line segment.
[0178] In this embodiment, the terminal applies the calculated overall correction parameters to the original two-dimensional trajectory. Geometric transformations such as translation and rotation are then performed on the original two-dimensional trajectory. This results in a continuous trajectory composed of corrected line segments. This new trajectory has a smaller average distance to all projection points, meaning it better matches the distribution of the projection points.
[0179] This allows the final 2D optimized trajectory to fully utilize the precision advantage of discrete edge key points, finely adjust each part of the initial trajectory, thereby significantly improving the accuracy and smoothness of the optimized trajectory, and providing a high-quality 2D foundation for the final mapping to generate a high-precision 3D edge trajectory.
[0180] Specifically, collect all collected edge keypoint sets. Utilizing the first stage of R planeProjecting it onto a 2D physical plane, we get :
[0181]
[0182] The workpiece DXF template is transformed to the same plane according to the coarse positioning results. At this time, the measured points... There is a slight pose deviation between the model and the DXF contour. A point-to-line correspondence needs to be established: for each... Find the DXF line segment S to which it belongs through nearest neighbor search. k(j) .
[0183] Construct a nonlinear least squares optimization problem to find the optimal rigid body transformation parameters x = [Δx, Δy, Δθ]. T This minimizes the sum of the vertical distances from all measured edge points to their corresponding DXF line segments.
[0184] Define a transformation function T to transform the DXF line segment to the current measurement coordinate system. The optimization objective function J(x) is expressed as:
[0185]
[0186] Where ρ j A robust kernel function (such as HuberLoss) is used to suppress the impact of individual outliers on the optimization.
[0187] The matrix form of the transformation model T is as follows:
[0188]
[0189] The solution is obtained iteratively using the Gauss-Newton method or the Levenberg-Marquardt algorithm. until the error converges (e.g., ΔJ < 10). -6 ).
[0190] Using the solved optimal transformation parameter x, all discrete trajectory points in the original DXF file are globally corrected. The corrected 2D trajectory is then back-projected back into the 3D spatial coordinate system using a formula to generate high-precision beveling code containing position (x, y, z) and orientation (Rx, Ry, Rz).
[0191] For example, such as Figure 9As shown, the entire workpiece edge trajectory planning method can be divided into two stages. In the first stage, the terminal first inputs the 3D point cloud information acquired by the scanning device and the preset workpiece template information. Then, based on the 3D point cloud information, plane fitting is performed to obtain the projection reference plane, and a spatial coordinate system is established based on this. The resolution of the spatial normal vector and the 3D point cloud information is obtained. Then, the 3D point cloud information is projected onto the projection reference plane to obtain a 2D point cloud image. At the same time, based on the normal vector and resolution, the workpiece template information is rasterized to obtain 2D workpiece template information. After that, the 2D point cloud image and the 2D workpiece template information are matched to calculate the offset parameter of the workpiece template information relative to the 2D point cloud image. Based on this offset parameter, the 2D workpiece template information is remapped to 3D space to obtain the initial edge trajectory. If the resolution at this time is sufficient to meet the needs of actual production, the initial edge trajectory can be directly used as the final edge trajectory. If the accuracy is insufficient, the sampling density is determined according to the length of the primitives in the initial edge trajectory, and the sampling interval of each primitive is determined according to the number of sampling points in each primitive. Then, the local point cloud information at the sampling point is obtained by the scanning device at a 45-degree angle to the normal of the workpiece surface. In the second stage, the edge key points of the workpiece are extracted based on the intersection of the first surface and the side surface of the workpiece in the local point cloud information. Then, the edge key points and the initial edge trajectory are projected onto the two-dimensional image. The nearest neighbor line segment of each projection point in the two-dimensional trajectory is found. The correction parameters are solved by minimizing the distance between each projection point and the nearest neighbor line segment. After correction based on the correction parameters, the image is mapped to three-dimensional space to obtain the final edge trajectory.
[0192] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0193] Based on the same inventive concept, this application also provides a workpiece edge trajectory planning device for implementing the workpiece edge trajectory planning method described above. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more workpiece edge trajectory planning device embodiments provided below can be found in the limitations of the workpiece edge trajectory planning method described above, and will not be repeated here.
[0194] In one exemplary embodiment, such as Figure 10 As shown, a workpiece edge trajectory planning device is provided, comprising:
[0195] The three-dimensional information acquisition module 1001 is used to acquire the three-dimensional point cloud information of the workpiece under test in three-dimensional space;
[0196] The coarse positioning module 1002 is used to determine the initial edge trajectory of the workpiece to be measured based on the three-dimensional point cloud information and the preset workpiece template information.
[0197] The local information acquisition module 1003 is used to acquire multiple local point cloud information of the workpiece to be tested, wherein the local point cloud information is obtained by the scanning device based on the initial edge trajectory.
[0198] The edge recognition module 1004 is used to determine multiple edge key points of the workpiece edge to be measured based on local point cloud information.
[0199] The trajectory positioning module 1005 is used to determine the edge trajectory of the workpiece to be measured based on each edge key point and the initial edge trajectory.
[0200] In one embodiment, the coarse positioning module 1002 is further configured to determine a projection reference plane based on three-dimensional point cloud information; project the three-dimensional point cloud information onto the projection reference plane to obtain a two-dimensional point cloud image; determine the offset parameters between the two-dimensional point cloud image and the workpiece template information; and map the workpiece template information to three-dimensional space according to the offset parameters to obtain the initial edge trajectory of the workpiece to be measured.
[0201] In one embodiment, the initial edge trajectory includes multiple primitives; the local information acquisition module 1003 is further configured to determine multiple sampling points in each primitive based on the length of each primitive and the target sampling interval corresponding to each primitive; and acquire the local point cloud information of the workpiece to be tested at each sampling point.
[0202] In one embodiment, the local information acquisition module 1003 is further configured to determine the number of sampling points for each graphic element based on the length of the graphic element and the corresponding preset sampling interval; if the number of sampling points is within a preset range, the preset sampling interval is used as the target sampling interval; if the number of sampling points is outside the preset range, the target sampling interval corresponding to each graphic element is determined based on the number of sampling points for each graphic element and the preset sampling interval.
[0203] In one embodiment, the workpiece to be tested includes a side surface, a first surface, and a second surface, which are arranged opposite to each other, with the second surface located on a processing platform. The local point cloud information is obtained by scanning the first surface and the side surface at sampling points using a scanning device. The edge recognition module 1004 is further configured to determine the surface information of the first surface and the side surface information of the side surface for each local point cloud information; determine the intersection line between the first surface and the side surface corresponding to each local point cloud information based on the surface information and side surface information corresponding to each local point cloud information; and take the intersection points between each intersection line and the scanning plane of the scanning device as edge key points.
[0204] In one embodiment, the trajectory positioning module 1005 is further configured to determine the projection reference plane based on the three-dimensional point cloud information; project the initial edge trajectory and each edge key point onto the projection reference plane to obtain a two-dimensional trajectory and multiple projection points; correct the two-dimensional trajectory according to the distance from each projection point to the two-dimensional trajectory to obtain a two-dimensional optimized trajectory; and map the two-dimensional optimized trajectory onto three-dimensional space to obtain the edge trajectory of the workpiece to be measured.
[0205] In one embodiment, the two-dimensional trajectory includes multiple line segments; the trajectory positioning module 1005 is further configured to determine the nearest neighbor line segment corresponding to each projection point among the multiple line segments of the two-dimensional trajectory; determine the correction parameters of the two-dimensional trajectory based on the vertical distance between each projection point and the corresponding nearest neighbor line segment; and correct the two-dimensional trajectory based on the correction parameters to obtain the two-dimensional optimized trajectory.
[0206] Each module in the aforementioned workpiece edge trajectory planning device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0207] In one exemplary embodiment, a computer device is provided, the internal structure of which can be as shown in the figure. Figure 11As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores control data for the computer device. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a workpiece edge trajectory planning method.
[0208] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0209] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described workpiece edge trajectory planning method embodiment.
[0210] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps in the above-described workpiece edge trajectory planning method embodiment.
[0211] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described workpiece edge trajectory planning method embodiment.
[0212] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0213] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0214] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for planning the edge trajectory of a workpiece, characterized in that, The method includes: Acquire three-dimensional point cloud information of the workpiece under test in three-dimensional space; the workpiece under test includes a side surface, a first surface and a second surface, the first surface and the second surface are arranged opposite to each other, and the second surface is located on the processing platform; The initial edge trajectory of the workpiece to be tested is determined based on the three-dimensional point cloud information and the preset workpiece template information; the initial edge trajectory includes multiple primitives, and the primitives include multiple sampling points; Multiple local point cloud information of the workpiece to be tested are acquired, wherein the local point cloud information is obtained by scanning the first surface and the side surface at the sampling point by the scanning device; For each of the local point cloud information, the surface information of the first surface and the side information of the side are determined based on the local point cloud information; Based on the surface information and side information corresponding to each of the local point cloud information, the intersection line between the first surface and the side corresponding to each of the local point cloud information is determined respectively; The intersection points between each of the aforementioned lines and the scanning plane of the scanning device are all taken as edge key points; The projection reference plane is determined based on the three-dimensional point cloud information; The initial edge trajectory and each edge key point are projected onto the projection reference plane to obtain a two-dimensional trajectory and multiple projection points; the two-dimensional trajectory includes multiple line segments. Among the multiple line segments of the two-dimensional trajectory, determine the nearest neighbor line segment corresponding to each projection point; The correction parameters of the two-dimensional trajectory are determined based on the vertical distance between each projection point and its corresponding nearest neighbor line segment. The two-dimensional trajectory is corrected according to the correction parameters to obtain the optimized two-dimensional trajectory; The two-dimensional optimized trajectory is mapped onto the three-dimensional space to obtain the edge trajectory of the workpiece to be tested.
2. The method according to claim 1, characterized in that, Determining the initial edge trajectory of the workpiece to be tested based on the three-dimensional point cloud information and the preset workpiece template information includes: The projection reference plane is determined based on the three-dimensional point cloud information; The three-dimensional point cloud information is projected onto the projection reference plane to obtain a two-dimensional point cloud image; Determine the offset parameter between the two-dimensional point cloud image and the workpiece template information; The workpiece template information is mapped to the three-dimensional space based on the offset parameters to obtain the initial edge trajectory of the workpiece to be tested.
3. The method according to claim 1, characterized in that, The acquisition of multiple local point cloud information of the workpiece under test includes: Based on the length of each graphic element and the target sampling interval corresponding to each graphic element, multiple sampling points in each graphic element are determined; Obtain local point cloud information of the workpiece under test at each of the sampling points.
4. The method according to claim 3, characterized in that, The method further includes: For each graphic element, the number of sampling points for that graphic element is determined based on its length and the corresponding preset sampling interval. When the number of sampling points is within a preset range, the preset sampling interval is taken as the target sampling interval; If the number of sampling points is outside the preset range, the target sampling interval corresponding to each graphic element is determined based on the number of sampling points for each graphic element and the preset sampling interval.
5. A workpiece edge trajectory planning device, characterized in that, The device includes: A 3D information acquisition module is used to acquire 3D point cloud information of the workpiece under test in 3D space; the workpiece under test includes a side, a first surface and a second surface, the first surface and the second surface are arranged opposite to each other, and the second surface is located on the processing platform; The coarse positioning module is used to determine the initial edge trajectory of the workpiece to be tested based on the three-dimensional point cloud information and the preset workpiece template information; the initial edge trajectory includes multiple primitives, and the primitives include multiple sampling points; The local information acquisition module is used to acquire multiple local point cloud information of the workpiece to be tested, wherein the local point cloud information is obtained by scanning the first surface and the side surface at the sampling point by the scanning device; An edge recognition module is used to determine the surface information of the first surface and the side information of the side surface for each local point cloud information; determine the intersection line between the first surface and the side surface corresponding to each local point cloud information based on the surface information and the side information; and take the intersection points between each intersection line and the scanning plane of the scanning device as edge key points. The trajectory positioning module is used to determine a projection reference plane based on the three-dimensional point cloud information; project the initial edge trajectory and each edge key point onto the projection reference plane to obtain a two-dimensional trajectory and multiple projection points; the two-dimensional trajectory includes multiple line segments; among the multiple line segments of the two-dimensional trajectory, determine the nearest neighbor line segment corresponding to each projection point; determine the correction parameters of the two-dimensional trajectory according to the vertical distance between each projection point and the corresponding nearest neighbor line segment; correct the two-dimensional trajectory according to the correction parameters to obtain a two-dimensional optimized trajectory; and map the two-dimensional optimized trajectory onto the three-dimensional space to obtain the edge trajectory of the workpiece to be measured.
6. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.