Cutting trajectory detection methods, systems, workpieces, electronic equipment, and computer media
By performing an affine transformation on the bevel of the workpiece to be cut to generate an affine trajectory contour point set, and combining the comparison of trajectory distance and angle difference, the problem of misjudgment of cutting trajectory in the prior art is solved, the accurate judgment of cutting trajectory is realized, and the generation of cutting waste is avoided.
Patent Information
- Application Number
- CN202310079688.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-31
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2043-01-31
AI Technical Summary
In existing technologies, vision-based beveling technology is prone to misjudgment due to calculation parameter errors and environmental interference when generating cutting trajectories, resulting in the production of defective parts. This is especially true when the workpiece has a complex shape or changes in position and angle, making it difficult to accurately determine the qualification of the cutting trajectory.
By acquiring the actual trajectory of the workpiece to be cut at the bevel, an affine transformation is performed to generate an affine trajectory contour point set. The affine transformation matrix is used to eliminate the influence of position and angle changes. By combining the comparison of trajectory distance and angle difference, large distance points and deviation points are determined. The qualification of the trajectory is judged by a metric factor and a voting mechanism.
It effectively eliminates the misjudgment of cutting trajectory deviation caused by changes in workpiece position and angle due to loading and unloading, improves the accuracy of cutting trajectory, and avoids the generation of cutting waste.
Smart Images

Figure CN116051520B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of workpiece processing technology, and in particular to a cutting trajectory detection method, system, workpiece, electronic device, and computer medium. Background Technology
[0002] Beveling is an indispensable processing step in the machinery manufacturing industry. Compared with traditional cutting methods, it has advantages such as high efficiency and stable cutting results.
[0003] Vision-based beveling technology primarily uses industrial cameras to acquire images of the workpiece. Image processing techniques are then used to identify and locate the workpiece and obtain its contour. A cutting trajectory is generated based on this contour, guiding a robot to perform batch cutting of the workpieces. Therefore, the generation of the cutting trajectory has a significant impact on the subsequent cutting effect. If the generated cutting trajectory is deformed, the cut products will not meet processing requirements, resulting in scrap and wasted production costs.
[0004] Currently, in order to prevent the generation of defective parts due to incorrect cutting trajectories, before cutting the workpiece, parameters such as the actual trajectory area, size, point distance, and overlap are calculated and then compared with preset thresholds to determine whether the generated cutting trajectory deviates significantly from the preset trajectory.
[0005] However, workpieces come in a variety of shapes, including straight lines, circles, ellipses, parabolas, broken lines, curves, and combinations of straight lines. Calculating the actual trajectory area and dimensions is problematic. Firstly, it's inconvenient to calculate the area of oddly shaped trajectories. Secondly, calculating the dimensions and area of workpiece trajectories for different shapes and setting appropriate thresholds is time-consuming and laborious. Furthermore, calculating the point distance and overlap between actual and preset trajectory points can be inaccurate due to factors such as positional and angular offsets caused by workpiece loading and unloading, foreign objects on the workpiece surface, and environmental interference. This can easily lead to misjudgments of the cutting trajectory. Summary of the Invention
[0006] This invention provides a cutting trajectory detection method, system, workpiece, electronic device, and computer medium to solve the defects in the prior art that easily lead to misjudgment of the cutting trajectory by directly comparing the calculated actual trajectory area, size, and other parameters with a preset threshold to determine the deviation of the generated cutting trajectory. It realizes accurate judgment of the generated cutting trajectory based on affine contour points and preset contour points, thereby avoiding the generation of cutting waste due to cutting trajectory errors.
[0007] This invention provides a cutting trajectory detection method, comprising:
[0008] Obtain the affine trajectory contour point set generated by performing an affine transformation on the actual trajectory of the workpiece to be cut bevel;
[0009] Affine contour points whose trajectory distance in the affine trajectory contour point set is greater than a first preset distance threshold are defined as large distance points, where the trajectory distance is the distance between each affine contour point and each preset contour point in the preset trajectory contour point set.
[0010] Based on the relationship between the average and median distances of each trajectory and the second preset distance threshold, a metric factor for amplifying the large-distance points is determined.
[0011] Based on the metric factor, determine the number of deviation points in each of the large distance points;
[0012] When the number is greater than the preset number, the actual trajectory is determined to be an unqualified trajectory; otherwise, it is a qualified trajectory.
[0013] According to the cutting trajectory detection method of the present invention, the step of obtaining the affine trajectory contour point set generated by affine transformation of the actual trajectory of the workpiece to be cut includes:
[0014] The rotation center, the first rotation angle, and the second rotation angle are determined respectively. The rotation center includes the rotation center of the preset trajectory and the rotation center of the actual trajectory. The first rotation angle is the rotation angle between set contour points in the preset trajectory contour point set, and the second rotation angle is the rotation angle between set contour points in the actual trajectory.
[0015] Construct a set of angle difference values consisting of the difference between the absolute values of the first rotation angle and the absolute values of the second rotation angle;
[0016] Based on the number of values less than a preset angle difference threshold in the set of angle difference values and a preset radian threshold, the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory are determined respectively. The preset radian threshold is a radian limit preset based on the characteristics of the trajectory shape.
[0017] Based on the rotation center, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory, the affine transformation matrix is determined;
[0018] Based on the affine transformation matrix and the contour points of the actual trajectory, the contour points of the affine trajectory are determined, and the contour point set of the affine trajectory is formed.
[0019] According to the cutting trajectory detection method of the present invention, the step of determining the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory based on the number of values less than a preset angle difference threshold in the set of angle difference values and a preset radian threshold, respectively, includes:
[0020] Determine whether the number of values in the set of angle differences that are less than a preset angle difference threshold reaches a preset proportion of the total number of values in the set of angle differences;
[0021] If so, both the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are set to 0.
[0022] If not, determine the ratio between each value in the set of angle difference values and the average value of the set of angle difference values;
[0023] The ratio is compared with the preset radian threshold determined based on the shape characteristics of the preset trajectory to determine the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory, respectively.
[0024] According to the cutting trajectory detection method of the present invention, the preset radian threshold includes: a first radian threshold, a second radian threshold, and a third radian threshold;
[0025] The step of comparing the ratio with the preset radian threshold determined based on the shape characteristics of the preset trajectory, and determining the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory respectively, includes:
[0026] When the ratio is greater than the first radian threshold and less than the second radian threshold, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are both determined to be 0.
[0027] When the preset trajectory is a circle or an ellipse, the first rotation angle and the second rotation angle corresponding to the ratio that is greater than or equal to the second radian threshold and less than or equal to the third radian threshold are respectively used as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory.
[0028] When the preset trajectory is a shape other than a circle or an ellipse, the first rotation angle and the second rotation angle corresponding to the ratio that is less than or equal to the first radian threshold are respectively used as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory.
[0029] According to the cutting trajectory detection method of the present invention, determining the metric factor for amplifying the large-distance point based on the relationship between the average and median distances of each trajectory and a second preset distance threshold includes:
[0030] When the median is greater than the second preset distance threshold and less than the average value, the median is used as the measurement factor.
[0031] When the average value is greater than a third preset distance threshold and less than a second preset distance threshold, the average value is used as the measurement factor.
[0032] When the average value is less than the third preset distance threshold or greater than the fourth preset distance threshold, the third preset distance threshold is used as the measurement factor, and the fourth preset distance threshold is greater than the second preset distance threshold.
[0033] According to the cutting trajectory detection method of the present invention, determining the number of deviation points among the large-distance points based on the metric factor includes:
[0034] The ratio of the large distance point to the metric factor is used as the distance metric;
[0035] The distance measurement that is greater than a preset measurement threshold is taken as the deviation point;
[0036] Determine the number of deviation points.
[0037] The present invention also provides a cutting trajectory detection system, comprising:
[0038] The point set acquisition module is used to acquire the affine trajectory contour point set generated by performing an affine transformation on the actual trajectory of the workpiece to be cut bevel.
[0039] The large distance point determination module is used to determine affine contour points whose trajectory distance in the affine trajectory contour point set is greater than a first preset distance threshold as large distance points, wherein the trajectory distance is the distance between each affine contour point and each preset contour point in the preset trajectory contour point set.
[0040] The metric factor determination module is used to determine the metric factor for amplifying the large distance point based on the relationship between the average and median distances of each trajectory and a second preset distance threshold.
[0041] The deviation point determination module is used to determine the number of deviation points among the large distance points based on the metric factor.
[0042] The result determination module is used to determine that the actual trajectory is an unqualified trajectory when the number is greater than a preset number, and otherwise it is a qualified trajectory.
[0043] The present invention also provides a workpiece obtained by beveling along a cutting trajectory, characterized in that the cutting trajectory is a qualified trajectory determined by any of the cutting trajectory detection methods described above.
[0044] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the cutting trajectory detection method as described above.
[0045] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the cutting trajectory detection method as described above.
[0046] This invention provides a cutting trajectory detection method, system, workpiece, electronic device, and computer medium. On one hand, it acquires an affine trajectory contour point set generated by affine transformation of the actual trajectory of the workpiece's bevel to be cut. Then, based on a comparison between each affine contour point in the affine trajectory contour point set and a first preset distance threshold, it determines whether the actual trajectory is qualified. The affine transformation effectively eliminates misjudgments of cutting trajectory deviations caused by changes in workpiece position and angle due to loading and unloading. On the other hand, after identifying affine contour points in the affine trajectory contour point set whose distance from each preset contour point in the preset trajectory contour point set is greater than the first preset distance threshold as large-distance points, it determines a metric factor for amplifying these large-distance points based on the relationship between the average and median distances of each trajectory and a second preset distance threshold. Based on this metric factor, it determines the number of deviation points among the large-distance points. When the number exceeds a preset number, the actual trajectory is determined as unqualified. This achieves separation between large-distance points and normal distances and avoids the influence of outliers on trajectory qualification judgment, thereby improving the accuracy of cutting trajectory determination. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the cutting trajectory detection method provided in an embodiment of the present invention;
[0049] Figure 2 This is a flowchart illustrating an existing beveling process.
[0050] Figure 3 This is a schematic diagram of the process for determining the affine trajectory contour point set using the cutting trajectory detection method provided in the embodiments of the present invention;
[0051] Figure 4This is a flowchart illustrating the process of determining whether the actual trajectory is qualified using the cutting trajectory detection method provided in this embodiment of the invention.
[0052] Figure 5 This is a schematic diagram of the structure of a cutting trajectory detection system provided in an embodiment of the present invention;
[0053] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0055] The following is combined Figures 1 to 4 The present invention describes a cutting trajectory detection method that can be executed by software and / or hardware in electronic devices such as computers, tablets, and mobile phones.
[0056] The cutting trajectory detection method provided in this embodiment of the invention, such as... Figure 1 As shown, it includes the following steps:
[0057] 101. Obtain the affine trajectory contour point set generated by performing an affine transformation on the actual trajectory of the workpiece to be cut bevel;
[0058] Understandably, the actual trajectory of the workpiece's bevel to be cut can be generated by a vision system. Through affine transformation, changes in the workpiece's position and angle caused by loading and unloading can be eliminated, thereby improving the accuracy of determining whether the actual trajectory is acceptable.
[0059] 102. The affine contour points whose trajectory distance in the affine trajectory contour point set is greater than a first preset distance threshold are determined as large distance points, wherein the trajectory distance is the distance between each of the affine contour points and each preset contour point in the preset trajectory contour point set.
[0060] Specifically, under normal circumstances, the curve of the affine trajectory generated by the affine transformation of the actual trajectory should coincide or partially coincide with the curve of the preset trajectory. When there is a non-coincidence, the trajectory point with a large deviation from the preset trajectory, i.e. the large distance point, can be determined by comparing the distance between the affine contour point and the preset contour point with the first preset distance threshold.
[0061] More specifically, each preset contour point in the preset trajectory contour point set is a contour point on the preset trajectory obtained by mapping the workpiece drawing, thereby making the preset trajectory highly reliable. This ensures the reliability of determining whether the actual trajectory is qualified by the distance between each affine contour point in the affine trajectory contour point set and each preset contour point.
[0062] Furthermore, the first preset distance threshold can be obtained based on cutting experiments on a large number of workpieces, analysis of data collected during the workpiece production process, and other methods.
[0063] 103. Based on the relationship between the average and median distances of each trajectory and the second preset distance threshold, determine the metric factor used to amplify the large-distance points;
[0064] Specifically, the average value of each trajectory distance can reflect the central location where the values of each trajectory distance are relatively concentrated, while the median value of each trajectory distance can reflect the general situation of the trajectory distance. Therefore, the metric factor used to amplify large distance points can be determined based on the relationship between the average value and the median value of each trajectory distance. For example, the metric factor can be determined as the smaller value between the average value and the median value of each trajectory distance, thereby improving the rationality of the determined metric factor.
[0065] More specifically, by setting the metric factor Measure_OP, the value of the large distance point can be amplified by dividing Dist_Big by Measure_OP, thereby separating the large distance point from the normal trajectory distance.
[0066] 104. Based on the metric factor, determine the number of deviation points in each of the large distance points;
[0067] Specifically, based on the metric factor, D = Dist_Big / Measure_OP can be used as the distance metric, and a voting mechanism can be used to determine the number of deviation points among the major distance points.
[0068] For example: a distance metric threshold Th1 is set in advance, and when D is greater than Th1, count1 is counted once, and then the total number is obtained by calculating the distance metric D of all affine contour points.
[0069] 105. When the number is greater than the preset number, the actual trajectory is determined to be an unqualified trajectory; otherwise, it is a qualified trajectory.
[0070] Specifically, the preset quantity is a pre-defined threshold value, representing the maximum allowable deviation of trajectory points from the preset trajectory in the affine trajectory. This threshold can be verified through experimentation or derived from practical production experience. Therefore, whether the actual trajectory is a qualified trajectory can be determined by checking if the preset quantity is greater than the preset quantity.
[0071] More specifically, the cutting trajectory detection method provided in this embodiment of the invention can be applied to, for example, Figure 2 In the bevel cutting workflow shown, in the step of verifying whether the actual trajectory is a qualified curve, the cutting trajectory detection method provided in this embodiment of the invention, on the one hand, obtains the affine trajectory contour point set generated by affine transformation of the actual trajectory of the workpiece to be cut, and then determines whether the actual trajectory is qualified based on the comparison between each affine contour point in the affine trajectory contour point set and a first preset distance threshold. This effectively eliminates the misjudgment of cutting trajectory deviation caused by changes in workpiece position and angle due to loading and unloading. On the other hand, after determining the affine contour points in the affine trajectory contour point set whose distance from each preset contour point in the preset trajectory contour point set is greater than the first preset distance threshold as large distance points, a metric factor for amplifying large distance points is determined based on the relationship between the average and median distances of each trajectory and a second preset distance threshold. Based on the metric factor, the number of deviation points among the large distance points is determined so that when the number is greater than a preset number, the actual trajectory is determined to be an unqualified trajectory. This achieves the separation of large distance points from normal distances and avoids the influence of outliers on the determination of whether the trajectory is qualified, thereby improving the accuracy of cutting trajectory determination.
[0072] Based on the above embodiments, obtaining the affine trajectory contour point set generated by affine transformation of the actual trajectory of the workpiece to be cut includes:
[0073] The rotation center, the first rotation angle, and the second rotation angle are determined respectively. The rotation center includes the rotation center of the preset trajectory and the rotation center of the actual trajectory. The first rotation angle is the rotation angle between set contour points in the preset trajectory contour point set, and the second rotation angle is the rotation angle between set contour points in the actual trajectory.
[0074] Construct a set of angle difference values consisting of the difference between the absolute values of the first rotation angle and the absolute values of the second rotation angle;
[0075] Based on the number of values less than a preset angle difference threshold in the set of angle difference values and a preset radian threshold, the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory are determined respectively. The preset radian threshold is a radian limit preset based on the characteristics of the trajectory shape.
[0076] Based on the rotation center, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory, the affine transformation matrix is determined;
[0077] Based on the affine transformation matrix and the contour points of the actual trajectory, the contour points of the affine trajectory are determined, and the contour point set of the affine trajectory is formed.
[0078] Understandably, when performing affine transformations, both the preset trajectory and the actual trajectory need to generate rotation angles and rotation centers.
[0079] Specifically, assuming the rotation center of the preset trajectory and the rotation center of the actual trajectory are respectively the center coordinates (X, Y, Z) of the trajectory. oc ,Y oc ) and (X cc ,Y cc ), the preset contour trajectory point set and the actual trajectory contour point set are respectively {(X o1 ,Y o1 ), (X o2 ,Y o2 ), ...(X op ,Y op )} and {(X c1 ,Y c1 ), (X c2 ,Y c2 ), ...(X cm ,Y cm If p and m are the number of contour points of the trajectory, then the rotation angle can be calculated every n points. The contour points determined based on the value of n are the set contour points, thus generating p / n and m / n first rotation angles Angle1 and second rotation angles Angle2 respectively.
[0080] Furthermore, based on Formula 1, the difference Dist2[k] between the absolute values of the Angle1 set and the Angle2 set is calculated to obtain the angle difference set Dist2[q]:
[0081] Dist2[k]=abs(Angle1[i])-abs(Angle2[j]), i={0,1,,m}, j={0,1,…,p},
[0082] k = {0, 1, ..., q} (1)
[0083] Where q is the smaller of p / n and m / n.
[0084] More specifically, the preset angle difference threshold represents the maximum allowable deviation when the preset trajectory and the actual trajectory have the same rotation angle. This can be verified through experiments. Therefore, when the number of values in the set of angle difference values that are less than the preset angle difference threshold reaches a certain number, it can be considered that the actual trajectory has hardly rotated compared to the preset trajectory. Thus, it can be used to determine that the preset trajectory and the actual trajectory have the same rotation angle. The preset radian threshold is a radian limit preset based on the characteristics of the trajectory shape. By setting radian limits, different affine rotation angles can be set for differences in the trajectory curves, thus effectively reducing the problem of trajectory verification failure caused by inaccurate affine transformations.
[0085] Furthermore, after determining the rotation center and the affine transformation rotation angles of the actual trajectory and the preset trajectory, the affine matrix T can be calculated using the affine transformation rotation angles and rotation center of the preset trajectory, as well as the affine transformation rotation angles and rotation centers of the actually generated cutting trajectory. Then, by multiplying the contour of the actual trajectory by the affine transformation matrix T, the contour points {(X... a1 ,Y a1 ), (X a2 ,Y a2 ), ...(X am ,Y am )}.
[0086] Based on the above embodiments, determining the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory based on the number of values less than a preset angle difference threshold in the set of angle difference values and a preset radian threshold, respectively, includes:
[0087] Determine whether the number of values in the set of angle differences that are less than a preset angle difference threshold reaches a preset proportion of the total number of values in the set of angle differences;
[0088] If so, both the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are set to 0.
[0089] If not, determine the ratio between each value in the set of angle difference values and the average value of the set of angle difference values;
[0090] The ratio is compared with the preset radian threshold determined based on the shape characteristics of the preset trajectory to determine the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory, respectively.
[0091] Specifically, when determining the number of values in the angle difference set that are less than the preset angle difference threshold, a voting mechanism can also be used. That is, when a value less than the preset angle difference threshold appears in the angle difference set, count2 is counted once to obtain the total number of values in the angle difference set that are less than the preset angle difference threshold.
[0092] More specifically, the preset angle difference and preset ratio can be determined through experimental verification and experience. When the number of values in the angle difference set that are less than the preset angle difference threshold reaches the preset ratio of the total number of values in the angle difference set, it can be considered that the rotation angle of the actual trajectory and the preset trajectory are the same. Therefore, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory can both be determined to be 0.
[0093] Furthermore, the average value of each value in the set of angle difference values can reflect the relatively concentrated position of each value in the set of angle difference values. When it is determined that the number of values in the set of angle difference values that are less than the preset angle difference threshold is less than the preset proportion of the total number of values in the set of angle difference values, the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory can be determined by further determining the relationship between the ratio between each value in the set of angle difference values and the average value of each value in the set of angle difference values and the preset radian threshold. In this way, the accuracy of the affine transformation can be improved by limiting the affine rotation angle.
[0094] Based on the above embodiments, the preset radian threshold includes: a first radian threshold, a second radian threshold, and a third radian threshold;
[0095] The step of comparing the ratio with the preset radian threshold determined based on the shape characteristics of the preset trajectory, and determining the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory respectively, includes:
[0096] When the ratio is greater than the first radian threshold and less than the second radian threshold, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are both determined to be 0.
[0097] When the preset trajectory is a circle or an ellipse, the first rotation angle and the second rotation angle corresponding to the ratio that is greater than or equal to the second radian threshold and less than or equal to the third radian threshold are respectively used as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory.
[0098] When the preset trajectory is a shape other than a circle or an ellipse, the first rotation angle and the second rotation angle corresponding to the ratio that is less than or equal to the first radian threshold are respectively used as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory.
[0099] The radian threshold is a threshold obtained through experimental verification. Specifically, different rotation angles are set based on the shape differences of the trajectory curves. When the preset trajectory is a circle or ellipse, the first and second rotation angles corresponding to the ratio greater than or equal to the second radian threshold and less than or equal to the third radian threshold are respectively used as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory. When the preset trajectory is a straight line, a partial curve, a parabola, a combination of a straight line and a curve, or other shapes other than a circle or ellipse, the first and second rotation angles corresponding to the ratio less than or equal to the first radian threshold are respectively used as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory. Furthermore, when the ratio is greater than the first radian threshold and less than the second radian threshold, the rotation angles of the actual trajectory and the preset trajectory are considered to be the same, and therefore both the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are set to 0.
[0100] Furthermore, taking a set of thresholds obtained through experimental verification of this invention as an example, the specific method for determining the rotation angle of an affine transformation is explained below. The preset angle difference threshold is 0.00999, the preset ratio is 2 / 3, and the first, second, and third radian thresholds are 0.6, 0.9, and 1.25, respectively. A voting mechanism can then be used to determine the affine transformation matrix T. That is, when Dist2 is less than 0.00999, count2 is counted once. When count2 is greater than 2 / 3 of the total number of values in the angle difference set, Angle1 = 0 and Angle2 = 0. When the count does not exceed 2 / 3, the ratio of Dist2 to its average value (radio) is calculated, and the flag isLine is set. By default, when isLine = 0, the trajectory curve is a straight line, a partial curve, a parabola, or a combination of a straight line and a curve. When isLine = 1, the trajectory curve is a circle or an ellipse. This is illustrated in Formula 2.
[0101]
[0102] That is: when the trajectory curve is a circle or an ellipse (isLine=1), assuming that 0.9≤radio≤1.25 is the value of group a, then the values of Angle1[a] and Angle2[a] are taken as the rotation angle of the affine transformation; when the trajectory curve is a straight line, a partial curve, a parabola, or a combination of a straight line and a curve (isLine=0), assuming that radio≤0.6 is the value of group b, then the values of Angle1[b] and Angle2[b] are taken as the rotation angle of the affine transformation, where radians 0.6, 0.9 and 1.25 correspond to 34.377 degrees, 51.566 degrees and 71.620 degrees respectively.
[0103] Therefore, the process for determining the affine trajectory contour point set using the cutting trajectory detection method described in the above embodiments is as follows: Figure 3 As shown, by calculating the affine transformation rotation angle and setting different rotation angles according to different trajectory curves, the problem of affine transformation failure can be effectively avoided.
[0104] Based on the above embodiments, determining the metric factor for amplifying the large-distance point based on the relationship between the average and median distances of each trajectory and the second preset distance threshold includes:
[0105] When the median is greater than the second preset distance threshold and less than the average value, the median is used as the measurement factor.
[0106] When the average value is greater than a third preset distance threshold and less than a second preset distance threshold, the average value is used as the measurement factor.
[0107] When the average value is less than the third preset distance threshold or greater than the fourth preset distance threshold, the third preset distance threshold is used as the measurement factor, and the fourth preset distance threshold is greater than the second preset distance threshold.
[0108] Specifically, by using the median as the measurement factor when the median is greater than the second preset distance threshold and less than the average, and using the average as the measurement factor when the average is greater than the third preset distance threshold and less than the second preset distance threshold, the smaller of the average and median can be selected as the measurement factor when it is determined that the preset trajectory deviates normally from the affine trajectory. When the average is less than the third preset distance threshold or greater than the fourth preset distance threshold (the fourth preset distance threshold is greater than the second preset distance threshold), the third preset distance threshold can be used as the measurement factor. This allows the measurement factor to be set to a relatively small value, thereby ensuring that large-distance points are effectively separated and avoiding the influence of outliers.
[0109] More specifically, the second, third, and fourth preset distance thresholds can all be determined through experimental verification or experience.
[0110] Based on the above embodiments, determining the number of deviation points among the large-distance points based on the metric factor includes:
[0111] The ratio of the large distance point to the metric factor is used as the distance metric;
[0112] The distance measurement that is greater than a preset measurement threshold is taken as the deviation point;
[0113] Determine the number of deviation points.
[0114] Specifically, taking a set of distance thresholds obtained through experimental verification by this invention as an example, the specific method for determining whether the cutting trajectory is qualified by this invention is explained. The first preset distance threshold, the second preset distance threshold, the third preset distance threshold, and the fourth preset distance threshold are 3, 0.5, 0.0001, and 50, respectively. The preset quantity is 10, and the preset measurement threshold is 5. The process for determining whether the cutting trajectory, i.e., the actual trajectory, is qualified specifically includes: first, when the distance Dist1 between the affine contour point and the preset contour point is determined to be greater than 3, the affine contour point is determined as the large-distance point Dist1_Big. Then, a voting mechanism as shown in Formula 3 can be used to determine the measurement factor Measure_OP.
[0115]
[0116] Then, assuming Dist1_Big has k large-distance points, the distance metric D obtained by dividing Dist1_Big(k) by the metric factor Measure_OP can effectively identify the points among the large-distance points that deviate from Measure_OP:
[0117] D=Dist_Big[k] / Measure_OP (4)
[0118] Finally, based on the voting mechanism, when the distance metric D is greater than 5, count1 is counted once, and when the count is greater than 10, the actual trajectory is determined to be an unqualified trajectory; otherwise, it is a qualified trajectory.
[0119] Therefore, the process for determining whether the actual trajectory is qualified using the cutting trajectory detection method described in the above embodiments is as follows: Figure 4 As shown, by introducing a metric factor, the influence of outliers on the final judgment result is effectively avoided, and the accuracy of trajectory judgment is improved.
[0120] The following describes a cutting trajectory detection system provided by the present invention. The cutting trajectory detection system described below can be referred to in correspondence with the cutting trajectory detection method described above.
[0121] The cutting trajectory detection system described in this embodiment of the invention, such as Figure 5 As shown, it includes: a point set acquisition module 510, a large-distance point determination module 520, a metric factor determination module 530, an offset point determination module 540, and a result determination module 550; wherein,
[0122] The point set acquisition module 510 is used to acquire the affine trajectory contour point set generated by performing an affine transformation on the actual trajectory of the bevel to be cut on the workpiece.
[0123] The large distance point determination module 520 is used to determine the affine contour points in the affine trajectory contour point set whose trajectory distance is greater than a first preset distance threshold as large distance points, wherein the trajectory distance is the distance between each of the affine contour points and each preset contour point in the preset trajectory contour point set.
[0124] The metric factor determination module 530 is used to determine the metric factor for amplifying the large distance point based on the relationship between the average and median distances of each trajectory and the second preset distance threshold.
[0125] The deviation point determination module 540 is used to determine the number of deviation points among the large distance points based on the metric factor;
[0126] The result determination module 550 is used to determine that the actual trajectory is an unqualified trajectory when the number is greater than a preset number, and otherwise it is a qualified trajectory.
[0127] The cutting trajectory detection system provided in this invention, on the one hand, obtains an affine trajectory contour point set generated by affine transformation of the actual trajectory of the workpiece to be cut bevel, and then determines whether the actual trajectory is qualified based on the comparison between each affine contour point in the affine trajectory contour point set and a first preset distance threshold. The affine transformation effectively eliminates the misjudgment of cutting trajectory deviation caused by changes in workpiece position and angle due to loading and unloading. On the other hand, after determining the affine contour points in the affine trajectory contour point set whose distance from each preset contour point in the preset trajectory contour point set is greater than the first preset distance threshold as large distance points, a metric factor for amplifying large distance points is determined based on the relationship between the average and median distances of each trajectory and a second preset distance threshold. Based on the metric factor, the number of deviation points among the large distance points is determined so that when the number is greater than a preset number, the actual trajectory is determined to be an unqualified trajectory. This achieves the separation of large distance points from normal distances and avoids the influence of outliers on the determination of whether the trajectory is qualified, thereby improving the accuracy of cutting trajectory determination.
[0128] Optionally, the point set acquisition module 510 is specifically used for:
[0129] The rotation center, the first rotation angle, and the second rotation angle are determined respectively. The rotation center includes the rotation center of the preset trajectory and the rotation center of the actual trajectory. The first rotation angle is the rotation angle between set contour points in the preset trajectory contour point set, and the second rotation angle is the rotation angle between set contour points in the actual trajectory.
[0130] Construct a set of angle difference values consisting of the difference between the absolute values of the first rotation angle and the absolute values of the second rotation angle;
[0131] Based on the number of values less than a preset angle difference threshold in the set of angle difference values and a preset radian threshold, the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory are determined respectively. The preset radian threshold is a radian limit preset based on the characteristics of the trajectory shape.
[0132] Based on the rotation center, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory, the affine transformation matrix is determined;
[0133] Based on the affine transformation matrix and the contour points of the actual trajectory, the contour points of the affine trajectory are determined, and the contour point set of the affine trajectory is formed.
[0134] Optionally, the point set acquisition module 510 is more specifically used for:
[0135] Determine whether the number of values in the set of angle differences that are less than a preset angle difference threshold reaches a preset proportion of the total number of values in the set of angle differences;
[0136] If so, both the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are set to 0.
[0137] If not, determine the ratio between each value in the set of angle difference values and the average value of the set of angle difference values;
[0138] The ratio is compared with the preset radian threshold determined based on the shape characteristics of the preset trajectory to determine the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory, respectively.
[0139] Optionally, the preset radian threshold includes: a first radian threshold, a second radian threshold, and a third radian threshold;
[0140] The point set acquisition module 510 is more specifically used for:
[0141] When the ratio is greater than the first radian threshold and less than the second radian threshold, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are both determined to be 0.
[0142] When the preset trajectory is a circle or an ellipse, the first rotation angle and the second rotation angle corresponding to the ratio that is greater than or equal to the second radian threshold and less than or equal to the third radian threshold are respectively used as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory.
[0143] When the preset trajectory is a shape other than a circle or an ellipse, the first rotation angle and the second rotation angle corresponding to the ratio that is less than or equal to the first radian threshold are respectively used as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory.
[0144] Optionally, the metric factor determination module 530 is specifically used for:
[0145] When the median is greater than the second preset distance threshold and less than the average value, the median is used as the measurement factor.
[0146] When the average value is greater than a third preset distance threshold and less than a second preset distance threshold, the average value is used as the measurement factor.
[0147] When the average value is less than the third preset distance threshold or greater than the fourth preset distance threshold, the third preset distance threshold is used as the measurement factor, and the fourth preset distance threshold is greater than the second preset distance threshold.
[0148] Optionally, the deviation point determination module 540 is specifically used for:
[0149] The ratio of the large distance point to the metric factor is used as the distance metric;
[0150] The distance measurement that is greater than a preset measurement threshold is taken as the deviation point;
[0151] Determine the number of deviation points.
[0152] This invention also provides a workpiece obtained by beveling along a cutting trajectory, wherein the cutting trajectory is a qualified trajectory determined by the cutting trajectory detection method described in any of the above embodiments.
[0153] It is understood that the workpiece obtained by beveling along the qualified trajectory determined by the cutting trajectory detection method described in any of the above embodiments has all the advantages and technical effects of the cutting trajectory detection method described in any of the above embodiments, and will not be repeated here.
[0154] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a cutting trajectory detection method. The method includes: acquiring an affine trajectory contour point set generated by performing an affine transformation on the actual trajectory of the workpiece to be cut bevel; determining affine contour points in the affine trajectory contour point set whose trajectory distance is greater than a first preset distance threshold as large-distance points, wherein the trajectory distance is the distance between each affine contour point and each preset contour point in the preset trajectory contour point set; determining a metric factor for amplifying the large-distance points based on the relationship between the average and median of each trajectory distance and a second preset distance threshold; determining the number of deviation points in each large-distance point based on the metric factor; and determining the actual trajectory as an unqualified trajectory when the number is greater than a preset number, otherwise, it is a qualified trajectory.
[0155] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0156] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer is able to execute the cutting trajectory detection method provided by the above methods, the method including: obtaining an affine trajectory contour point set generated by performing an affine transformation on the actual trajectory of the bevel to be cut on the workpiece; determining affine contour points in the affine trajectory contour point set whose trajectory distance is greater than a first preset distance threshold as large-distance points, the trajectory distance being the distance between each of the affine contour points and each preset contour point in the preset trajectory contour point set; determining a metric factor for amplifying the large-distance points based on the relationship between the average and median of each of the trajectory distances and a second preset distance threshold; determining the number of deviation points in each of the large-distance points based on the metric factor; when the number is greater than a preset number, determining the actual trajectory as an unqualified trajectory, otherwise, it is a qualified trajectory.
[0157] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a cutting trajectory detection method. The method includes: acquiring an affine trajectory contour point set generated by performing an affine transformation on the actual trajectory of the bevel to be cut on a workpiece; identifying affine contour points in the affine trajectory contour point set whose trajectory distance is greater than a first preset distance threshold as large-distance points, wherein the trajectory distance is the distance between each affine contour point and each preset contour point in the preset trajectory contour point set; determining a metric factor for amplifying the large-distance points based on the relationship between the average and median of each trajectory distance and a second preset distance threshold; determining the number of deviation points among each large-distance point based on the metric factor; and determining the actual trajectory as an unqualified trajectory when the number is greater than a preset number, otherwise, as a qualified trajectory.
[0158] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0159] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cutting trajectory detection method, characterized by, The method comprises the following steps: An affine trajectory contour point set is obtained by performing affine transformation on the actual trajectory of the workpiece to-be-cut bevel, comprising: The rotation center, the first rotation angle and the second rotation angle are determined respectively, the rotation center comprises the rotation center of the preset trajectory and the rotation center of the actual trajectory, the first rotation angle is the rotation angle between the set contour points in the preset trajectory contour point set, and the second rotation angle is the rotation angle between the set contour points in the actual trajectory; An angle difference value set composed of the absolute value difference between the first rotation angle and the absolute value of the second rotation angle is constructed; Based on the number of values less than the preset angle difference threshold in the angle difference value set and the preset radian threshold, the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory are determined respectively, and the preset radian threshold is a radian limit value preset based on the trajectory shape characteristics; Based on the rotation center, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory, the affine transformation matrix is determined; Based on the affine transformation matrix and the contour points of the actual trajectory, the contour points of the affine trajectory are determined, and the affine trajectory contour point set is formed; The affine contour points in the affine trajectory contour point set with a trajectory distance greater than a first preset distance threshold are determined as large-distance points, and the trajectory distance is the distance between each affine contour point and each preset contour point in the preset trajectory contour point set; Based on the relationship between the average value of each trajectory distance and the second preset distance threshold, a scaling factor for enlarging the large-distance points is determined, comprising: When the median is greater than the second preset distance threshold and less than the average value, the median is taken as the scaling factor; When the average value is greater than the third preset distance threshold and less than the second preset distance threshold, the average value is taken as the scaling factor; When the average value is less than the third preset distance threshold or greater than the fourth preset distance threshold, the third preset distance threshold is taken as the scaling factor, and the fourth preset distance threshold is greater than the second preset distance threshold; Based on the scaling factor, the number of deviation points in each large-distance point is determined, comprising: The ratio of the large-distance point to the scaling factor is taken as the distance measure; The distance measure greater than the preset scaling threshold is taken as the deviation point; The number of deviation points is determined; When the number is greater than the preset number, the actual trajectory is determined as an unqualified trajectory, otherwise, it is a qualified trajectory.
2. The cutting trajectory detection method according to claim 1, characterized in that, Based on the number of values less than the preset angle difference threshold in the angle difference value set and the preset radian threshold, the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory are determined respectively, comprising: Determine whether the number of values less than the preset angle difference threshold in the angle difference set reaches the preset proportion of the total number of values in the angle difference set; If yes, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are both determined as 0; If not, the ratio between each value in the angle difference value set and the average value of each value in the angle difference value set is determined; The ratio is compared with the preset radian threshold determined based on the shape characteristics of the preset trajectory to determine the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory respectively.
3. The cutting trajectory detection method according to claim 2, characterized in that, The preset radian threshold comprises a first radian threshold, a second radian threshold and a third radian threshold. The ratio is compared with a preset radian threshold determined based on shape features of the preset trajectory, and an affine transformation rotation angle of the preset trajectory and an affine transformation rotation angle of the actual trajectory are determined respectively, including: When the ratio is greater than a first radian threshold and less than a second radian threshold, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory are both determined as 0; When the preset trajectory is a circle or an ellipse, a first rotation angle and a second rotation angle corresponding to the ratio greater than or equal to the second radian threshold and less than or equal to a third radian threshold are respectively taken as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory; When the preset trajectory is a shape other than a circle or an ellipse, a first rotation angle and a second rotation angle corresponding to the ratio less than or equal to the first radian threshold are respectively taken as the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory.
4. A cutting trajectory detection system characterized by, Including: The point set acquisition module is configured to acquire an affine trajectory contour point set generated by performing affine transformation on an actual trajectory of a workpiece to-be-cut bevel, including: The rotation center, the first rotation angle and the second rotation angle are determined respectively, the rotation center includes a rotation center of the preset trajectory and a rotation center of the actual trajectory, the first rotation angle is a rotation angle between set contour points in the preset trajectory contour point set, and the second rotation angle is a rotation angle between set contour points of the actual trajectory; An angle difference value set composed of a difference value between an absolute value of the first rotation angle and an absolute value of the second rotation angle is constructed; Based on the number of values less than a preset angle difference threshold in the angle difference value set and a preset radian threshold, the affine transformation rotation angle of the preset trajectory and the affine transformation rotation angle of the actual trajectory are determined respectively, and the preset radian threshold is a radian limit value preset based on trajectory shape features; Based on the rotation center, the affine transformation rotation angle of the actual trajectory and the affine transformation rotation angle of the preset trajectory, an affine transformation matrix is determined; Based on the affine transformation matrix and the contour points of the actual trajectory, contour points of the affine trajectory are determined, and an affine trajectory contour point set is formed; The large-distance point determination module is configured to determine, as large-distance points, affine contour points in the affine trajectory contour point set whose trajectory distances from preset contour points in the preset trajectory contour point set are greater than a first preset distance threshold; The metric factor determination module is configured to determine, based on a relationship between the average value of the trajectory distances and the median and a second preset distance threshold, a metric factor for enlarging the large-distance points, including: When the median is greater than the second preset distance threshold and less than the average value, the median is taken as the metric factor; When the average value is greater than a third preset distance threshold and less than the second preset distance threshold, the average value is taken as the metric factor; When the average value is less than the third preset distance threshold or greater than a fourth preset distance threshold, the third preset distance threshold is taken as the metric factor, and the fourth preset distance threshold is greater than the second preset distance threshold; The deviating point determination module is configured to determine, based on the metric factor, a number of deviating points in the large-distance points, including: The ratio of the large-distance point to the metric factor is taken as a distance metric; The distance metric greater than a preset metric threshold is taken as a deviating point; The number of deviating points is determined. A result determining module is configured to determine the actual trajectory as an unqualified trajectory when the number is greater than the preset number, and otherwise, as a qualified trajectory.
5. A workpiece obtained by beveling along a cutting trajectory, characterized in that The cutting trajectory is a qualified trajectory determined by the cutting trajectory detection method according to any one of claims 1 to 3.
6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the cutting trajectory detection method according to any one of claims 1 to 3 when executing the computer program.
7. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the cutting trajectory detection method according to any one of claims 1 to 3. The computer program is executed by the processor to implement the cutting trajectory detection method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Curve fitting method for discrete cutter path
CN105425725A
Method and device for automatically generating groove cutting track, computer equipment and medium
CN113751824A