A straightness measurement method and device based on iterative search

By using an iterative search-based method in straightness measurement, using point cloud data of the workpiece profile and convex hull vertices to determine the ideal straight line, the problem of insufficient straightness measurement accuracy in the prior art is solved, and higher measurement accuracy and better inclusion are achieved.

CN115371596BActive Publication Date: 2025-06-20SHENZHEN LINGYUN VISION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211065046.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2025-06-20
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

Among the existing straightness measurement methods, the real straightness between the ideal straight line and the workpiece profile is large, resulting in a large difference between the calculated straightness and the real value, making it difficult to meet the accuracy requirements and the principle of minimum inclusion.

Method used

Using a straightness measurement method based on iterative search, the point cloud data of the workpiece contour is scanned, the convex hull vertices are determined, and multiple initial search directions are iteratively searched to obtain the target search direction, and then the ideal straight line of the workpiece contour is determined.

Benefits of technology

The accuracy of linearity measurement is improved, making the calculated linearity closer to the true value, satisfying the principle of minimum inclusion, and reducing redundant operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115371596B_ABST
    Figure CN115371596B_ABST
Patent Text Reader

Abstract

This application relates to the technical field of straightness measurement. Specifically, it involves a straightness measurement method and device based on iterative search, which can, to a certain extent, solve the problem that the straightness calculated based on the ideal straight line obtained by the straightness measurement method has a large difference compared with the straightness of the true straight line, does not conform to the minimum envelope principle, and is also difficult to meet the requirements for measurement accuracy. The straightness measurement method based on iterative search includes: scanning the workpiece to obtain the point cloud data of the workpiece contour, and the point cloud data is used to determine the convex hull of the workpiece contour, and the convex hull includes a plurality of convex hull vertices; iteratively searching for a plurality of initial search directions to obtain a target search direction, and the convex hull vertices and the point cloud data are used to determine the initial search of the plurality of initial search directions; the target search direction and the point cloud data are used to determine the ideal straight line of the workpiece contour; calculating the straightness according to the point cloud data and the ideal straight line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of straightness measurement. Specifically, it relates to a straightness measurement method and device based on iterative search. Background Art

[0002] In 3D vision inspection and measurement projects, straightness can directly reflect the straight-line characteristics of the workpiece contour. Therefore, it is necessary to accurately measure the straightness of the workpiece to evaluate the flatness of the workpiece based on the straightness.

[0003] The commonly used straightness measurement method is as follows: Use a sensor to collect the point cloud data of the workpiece surface contour, then perform straight-line fitting on the point cloud data through the least squares method to obtain an ideal straight line; finally, calculate the straightness of the ideal straight line, and the straightness of the ideal straight line is used to represent the straightness of the workpiece.

[0004] However, the ideal straight line obtained by fitting through this method has a large difference compared with the true straight line of the workpiece contour. As a result, the straightness calculated based on this ideal straight line has a large difference compared with the straightness of the true straight line, which does not conform to the minimum tolerance principle and is also difficult to meet the requirements for measurement accuracy. Summary of the Invention

[0005] In order to solve the problem that the straightness calculated based on the ideal straight line obtained by the straightness measurement method has a large difference compared with the straightness of the true straight line, which does not conform to the minimum tolerance principle and is also difficult to meet the requirements for measurement accuracy, this application provides a straightness measurement method and device based on iterative search.

[0006] The embodiments of this application are implemented as follows:

[0007] The embodiments of this application provide a straightness measurement method based on iterative search. The method includes:

[0008] Scan the workpiece to obtain the point cloud data of the workpiece contour. The point cloud data is used to determine the convex hull of the workpiece contour, and the convex hull includes multiple convex hull vertices;

[0009] Iteratively search for multiple initial search directions to obtain a target search direction. The convex hull vertices and the point cloud data are used to determine the multiple initial search directions; the target search direction and the point cloud data are used to determine the ideal straight line of the workpiece contour;

[0010] Calculate the straightness according to the point cloud data and the ideal straight line.

[0011] In some embodiments, the step of iteratively searching for multiple initial search directions to obtain a target search direction further includes:

[0012] Perform a rough search on multiple initial search directions to obtain multiple candidate rough search directions as the target rough search directions;

[0013] Perform an accurate search on the target rough search direction to obtain the target search direction.

[0014] In some embodiments, performing a rough search on multiple initial search directions to obtain multiple candidate rough search directions as the target rough search directions further includes:

[0015] Project the convex hull vertices onto an arbitrary plane with each of the initial search directions as the normal, and calculate the first minimum enclosing circle corresponding to each of the initial search directions;

[0016] Set a first search step size, and determine a first direction vector group including multiple first vectors based on the first search step size, first search width, and first search length. The first vectors are used to represent candidate rough search directions. The diameter of the first minimum enclosing circle is used to determine the first search width, and the bounded length of the initial search direction is used to determine the first search length;

[0017] Project the convex hull vertices onto each of the candidate rough search directions and calculate the second minimum enclosing circle;

[0018] Select the candidate rough search direction corresponding to the second minimum enclosing circle with the smallest diameter as the target rough search direction.

[0019] In some embodiments, performing an accurate search on the target rough search direction to obtain the target search direction further includes:

[0020] Project the convex hull vertices onto an arbitrary plane with each of the target rough search directions as the normal, and calculate the third minimum enclosing circle corresponding to each of the target rough search results;

[0021] Set a second search step size, and determine a second direction vector group including multiple second vectors based on the second search step size, second search width, and second search length. The second vectors are used to represent candidate accurate search directions. The diameter of the third minimum enclosing circle is used to determine the second search width, and the bounded length of the target rough search direction is used to determine the second search length;

[0022] Project the convex hull vertices onto each of the candidate accurate search directions and calculate the fourth minimum enclosing circle;

[0023] Traverse the candidate exact search directions. When the diameters of the fourth smallest enclosing circles obtained from two consecutive searches are both smaller than the threshold, exit the search, and take the candidate exact search direction corresponding to the fourth smallest enclosing circle with the smallest diameter as the target search direction.

[0024] In some embodiments, the convex hull vertices and the point cloud data are used to determine multiple initial search directions for the ideal straight line, and further include:

[0025] Perform SVD decomposition on the point cloud data and the convex hull vertices respectively to obtain two orthogonal vector groups, and each orthogonal vector group includes multiple direction vectors;

[0026] Calculate the bounded length of the point cloud data on each direction vector;

[0027] Select multiple initial search directions from the multiple direction vectors, and the initial search directions are the direction vectors corresponding to the bounded length greater than the product of the longest bounded length and the threshold.

[0028] In some embodiments, the point cloud data is used to determine the convex hull of the workpiece contour, and further include:

[0029] According to the point cloud index, divide the point cloud data into several sub-point clouds by region;

[0030] Perform parallel computing on each sub-point cloud to obtain the sub-convex hull corresponding to each sub-point cloud;

[0031] Merge the vertices of the sub-convex hulls and calculate the convex hull corresponding to the point cloud data.

[0032] In some embodiments, the iterative search for multiple initial search directions to obtain the target search direction further includes:

[0033] Project the point cloud data onto a preset plane, and the preset plane is determined by a preset plane position point and a preset plane normal vector;

[0034] On the preset plane, perform iterative search on multiple initial search directions to obtain the target search direction.

[0035] In some embodiments, the target search direction and the point cloud data are used to determine the ideal straight line of the workpiece contour, and further include:

[0036] Perform a rotation transformation on the point cloud data according to the target search direction to obtain a rotation matrix;

[0037] Obtain the center coordinate point of the smallest enclosing circle corresponding to the target search direction, and the center coordinate point is represented by a three-dimensional point;

[0038] Perform an inverse rotation transformation on the three-dimensional points according to the rotation matrix to obtain the position points of the ideal straight line, and the position points and the target search direction can determine the ideal straight line.

[0039] In some embodiments, the method further includes:

[0040] Construct a functional relationship between the vector subscript values in the direction vector group and the diameter of the minimum circumscribed circle corresponding to the direction vector group;

[0041] Wherein, the functional relationship is D cir = f(i, j), the function is a single concave surface and has and only has one minimum point, f(i) and f(j) are respectively used to represent the row function and the column function, and the smaller the vector subscript value, the larger the corresponding vector eigenvalue;

[0042] Based on the row function, perform parallel search on each row;

[0043] Based on the column function, perform column search on the columns in each row;

[0044] Wherein, the column search includes:

[0045] Calculate the function values of each row respectively, the function values include the function values of the endpoints of each row and the function values of the midpoints of each row, and select the minimum function value from the function values of each row;

[0046] Take the point corresponding to the minimum function value as the starting point, start from the starting point, search for the points on both sides of the starting point along the direction of the column, and when the difference between the function value corresponding to the current search point and the function value corresponding to the previous search point is greater than 0, jump out of the search for this row.

[0047] Another embodiment of the present application provides a straightness measurement device based on iterative search, and the device includes:

[0048] An acquisition module, configured to scan a workpiece to acquire point cloud data of the workpiece contour, and the point cloud data is used to determine the convex hull of the workpiece contour, and the convex hull includes a plurality of convex hull vertices;

[0049] An iterative search module, configured to perform iterative search on a plurality of initial search directions to obtain a target search direction, the convex hull vertices and the point cloud data are used to determine the plurality of initial search directions, and the target search direction and the point cloud data are used to determine the ideal straight line of the workpiece contour;

[0050] A calculation module, configured to calculate the straightness according to the point cloud data and the ideal straight line.

[0051] Advantages of the present application: By determining the convex hull of the workpiece contour based on point cloud data and fitting an ideal straight line based on the convex hull, a large amount of redundant operations can be reduced. Further, multiple initial search directions are determined based on the convex hull vertices and the point cloud data, and the target search direction is obtained from the initial search directions using an iterative search method. The accuracy of the target search direction obtained through iterative search is high. By determining the ideal straight line based on the target search direction, the determined ideal straight line is closer to the true straight line, and further, the measured straightness is closer to the true value of the straightness. Description of the Drawings

[0052] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following briefly introduces the drawings required for use in the description of the embodiments or the prior art. Obviously, the following-described drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0053] Figure 1 Possible ideal straight lines of the measured elements shown in the embodiments of the present application;

[0054] Figure 2 Flowchart of a straightness measurement method based on iterative search shown in the embodiments of the present application;

[0055] Figure 3 Schematic diagram of the process of determining the convex hull of the workpiece contour shown in the embodiments of the present application;

[0056] Figure 4A Schematic diagram of two orthogonal vector groups obtained by SVD decomposition shown in the embodiments of the present application;

[0057] Figure 4B Schematic diagram of calculating the bounded length of the point cloud in the direction vector shown in the embodiments of the present application;

[0058] Figure 5 Schematic diagram of generating the first direction vector group shown in the embodiments of the present application;

[0059] Figure 6 Schematic diagram of the ideal straight line determined by the method of the present application shown in the embodiments of the present application;

[0060] Figure 7A Function relationship between vector subscripts and the diameter of the minimum circumscribed circle shown in the embodiments of the present application;

[0061] Figure 7B Schematic diagram of row search shown in the embodiments of the present application;

[0062] Figure 7C Schematic diagram of the bisection method for searching for extreme points shown in the embodiments of the present application;

[0063] Figure 8 Schematic diagram of the ideal straight line determined based on the target search direction within the constraint plane shown in the embodiments of the present application;

[0064] Figure 9 Block diagram of a straightness measurement device based on iterative search shown in the embodiments of the present application. Detailed implementation manners

[0065] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.

[0066] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and claims of the present application, the singular forms "a", "an", "the", "above-mentioned", "said", and "this" are also intended to include expressions such as "one or more", unless clearly indicated to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" means one, two or more than two. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0067] Referring to "one embodiment" or "some embodiments" described in this specification means that specific features, structures or characteristics described in combination with the embodiment are included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" and the like appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0068] Straightness, that is, the so-called flatness degree, represents the condition that the actual shape of the straight line element on the part maintains an ideal straight line. The straightness tolerance is the maximum allowable variation of the actual line with respect to the ideal straight line. The straightness tolerance is the maximum allowable variation of the actual line with respect to the ideal straight line.

[0069] In the detection and measurement projects of 3D vision, straightness can directly reflect the straight-line characteristics of the workpiece contour. Therefore, it is necessary to accurately measure the straightness of the workpiece. To ensure the accuracy requirements of the straightness measurement of the workpiece, the minimum zone principle is set.

[0070] The minimum zone principle means that for the straightness tolerance in a given plane, the distances from all points on the measured feature to its ideal straight line should be equal to or less than the given tolerance value. The direction of the ideal straight line is determined by the minimum condition, that is, two parallel straight lines enclose the measured line and the distance between them is the minimum. Figure 1 The possible ideal straight lines of the measured feature are shown.

[0071] In Figure 1 , the possible directions of the ideal straight line are A1 - B1, A2 - B2, A3 - B3, and the corresponding distances are h1, h2, h3. In Figure 1 , h1 < h2 < h3. Therefore, the ideal straight line should be selected in the direction A1 - B1 that meets the minimum condition and the corresponding distance h1, which must be less than or equal to the given tolerance value.

[0072] Currently, the existing straightness measurement methods and devices on the market mainly use sensors to collect the point cloud of the workpiece surface, and then obtain the ideal straight line through the method of least squares straight line fitting to calculate the straightness. Such methods have the following limitations: they do not conform to the minimum zone principle, the measurement result of straightness has a large difference from the true value, and it is difficult to meet the accuracy requirements; global fitting of the point cloud is required, resulting in a large amount of redundant operations, and the operation time increases when the data volume is huge. Therefore, this application provides a straightness measurement method and device based on iterative search.

[0073] A straightness measurement method based on iterative search in this application is implemented through the following steps:

[0074] Scan the workpiece to obtain the point cloud data of the workpiece contour. The point cloud data is used to determine the convex hull of the workpiece contour, and the convex hull includes multiple convex hull vertices;

[0075] Iteratively search for multiple initial search directions to obtain the target search direction. The convex hull vertices and the point cloud data are used to determine the initial search of multiple initial search directions; the target search direction and the point cloud data are used to determine the ideal straight line of the workpiece contour;

[0076] Calculate the straightness according to the point cloud data and the ideal straight line.

[0077] Figure 2 The flowchart of a straightness measurement method based on iterative search is shown. As Figure 2 shown, a straightness measurement method based on iterative search provided by this application is implemented through the following steps:

[0078] In step 100, the workpiece is scanned to obtain the point cloud data of the workpiece contour, and the convex hull of the workpiece contour is determined based on the point cloud data. The convex hull includes multiple convex hull vertices.

[0079] The convex hull is the smallest circumscribed convex polyhedron of the point cloud. Points other than the vertices are located inside the convex hull. The Qhull library can be used to implement this calculation process.

[0080] Figure 3 The schematic diagram of the process of determining the convex hull of the workpiece contour is shown. As Figure 3 shown, the convex hull of the workpiece contour is determined according to the point cloud data and is implemented through the following steps:

[0081] The point cloud data is segmented by region according to the point cloud index to obtain several sub-point clouds. The number of sub-point clouds is determined according to the number of computer cores, and the segmentation region is determined according to the point cloud index.

[0082] Parallel computing is performed on each sub-point cloud to obtain the corresponding sub-convex hull of each sub-point cloud. The calculation method in this process uses the convex hull operation method;

[0083] The vertices in the sub-convex hulls are merged or aggregated and then a convex hull operation is performed again to calculate the convex hull corresponding to the point cloud data. The convex hull includes multiple convex hull vertices.

[0084] The use of the convex hull can achieve the purpose of data reduction. Other points of the convex hull except the vertices are included in the convex polyhedron. Introducing the convex hull before fitting the ideal line in this application can reduce a large amount of redundant operations. At the same time, this application uses the method of parallel computing the convex hull by region segmentation, which can improve the convex hull operation speed and does not affect the operation result.

[0085] In some embodiments, in step 200, multiple initial search directions are determined based on the convex hull vertices and the point cloud data, and are implemented through the following steps:

[0086] The point cloud data and the convex hull vertices are respectively subjected to SVD decomposition to obtain two orthogonal vector groups, and each orthogonal vector group includes multiple direction vectors.

[0087] The direction of the ideal line (abbreviation: least squares line) obtained by least squares fitting based on the point cloud data or the convex hull generally does not differ much from the direction of the ideal line obtained in this application. Therefore, the two orthogonal vector groups contain direction vectors with the same direction as the least squares line. Based on this orthogonal vector group, rough screening can be performed to select direction vectors that are more accurate than the direction vectors of the least squares line.

[0088] Figure 4A The schematic diagram of the two orthogonal vector groups obtained by using SVD decomposition is shown. As Figure 4AAs shown, the point cloud data and the convex hull vertices are respectively decomposed by SVD to obtain two orthogonal vector groups, denoted as {v1, v2, v3, r1, r2, r3}. Each orthogonal vector group includes multiple direction vectors; the larger the eigenvalue of the direction vector, the smaller the subscript of the corresponding direction vector. Therefore, the eigenvalues of the direction vectors in {v1, v2, v3, r1, r2, r3} decrease in turn.

[0089] Among them, v1 and v2 can be the direction vectors of the ideal straight line (abbreviated as the least squares straight line) obtained by the least squares method. Iteratively searching for the direction vectors containing the least squares straight line, that is, iteratively searching based on the direction of the least squares straight line, can make the accuracy of the target search direction obtained better than that of the least squares straight line.

[0090] Figure 4B Shows the calculation of the bounded length of the point cloud on the direction vector, such as Figure 4B Exemplarily shows a schematic diagram of the bounded length Lv1 of the direction vector V1. Calculate the bounded length of the point cloud data on each direction vector; the bounded length of each corresponding direction vector is denoted as {L v1 , L v2 , L v3 , L r1 , L r2 , L r3}.

[0091] According to the determination rule, multiple initial search directions are selected from the multiple direction vectors of the vector group. The determination rule is that when the ratio of the bounded length of a certain direction vector to the longest bounded length is higher than the threshold, then this direction vector is determined as the initial search direction. Table 1 is an example of selecting the initial search direction according to the determination rule. In the table, η is the threshold, preferably 0.8.

[0092] Table 1 Example of selecting the initial search direction according to the determination rule

[0093]

[0094] In some embodiments, in step 300, multiple initial search directions are iteratively searched to obtain the target search direction. Among them, the iterative search process includes a rough search and an accurate search.

[0095] In step 310, a rough search is performed on multiple initial search directions to obtain multiple candidate rough search directions as the target rough search direction, which can be achieved through the following steps:

[0096] Project the convex hull vertices onto an arbitrary plane with each initial search direction as the normal, and calculate the first minimum enclosing circle corresponding to each initial search direction. The minimum enclosing circle just encloses the convex hull vertices projected onto the arbitrary plane, and obtain the center position and diameter of the minimum enclosing circle.

[0097] Determine the first search width according to the diameter of the first minimum enclosing circle, and determine the first search length according to the bounded length of the initial search direction; preset the first search step size.

[0098] In some embodiments, the diameter of the first minimum enclosing circle is equal to the first search width wid, the bounded length of the initial search direction is equal to the first search length len, and the first search step size is set to n, with a preferred value of 10.

[0099] Determine a first set of direction vectors containing a plurality of first vectors based on the first search step size, the first search width, and the first search length, where the first vectors are used to represent candidate rough search directions.

[0100] Figure 5 A schematic diagram showing the generation of the first set of direction vectors is shown, as Figure 5 shown, construct a square parallel to the X and Y axes with the first search width as the side length, and divide this square into n×n nodes with the first number of search steps n. The first search length len can be combined with the n×n nodes to obtain three-dimensional vectors, and this three-dimensional vector is the first set of direction vectors, denoted as:

[0101]

[0102] i,j = ±0,1,2,3...int(n / 2)

[0103] where i and j represent the subscripts of the nodes, and x, y, z represent the vector coordinates. The derived set of vectors is denoted as:

[0104] D = {d (i,j) | ±i,j = 0,1,2,3...int(n / 2)}.

[0105] Project the convex hull vertices in each candidate rough search direction and calculate the second minimum enclosing circle. The second minimum enclosing circle can just enclose the projection points of the convex hull vertices in the candidate rough search direction.

[0106] Select the candidate rough search direction corresponding to the second minimum enclosing circle with the smallest diameter as the target rough search direction.

[0107] In some embodiments, to ensure a wider search range for the rough search, the number of search steps and the search width are usually doubled.

[0108] Use the target rough search direction as the iterative initial value for the precise search, and continue the iterative search.

[0109] In step 320, perform a precise search on the target rough search direction to obtain the target search direction, which is achieved through the following steps:

[0110] Project the convex hull vertices onto an arbitrary plane with each target rough search direction as the normal, and calculate the third smallest enclosing circle corresponding to each target rough search result. The third smallest enclosing circle can just enclose the projection points of the convex hull vertices in the target rough search direction.

[0111] Set the second search step size, and determine the second search width according to the diameter of the third smallest enclosing circle, and determine the second search length according to the bounded length of the target rough search direction.

[0112] In some embodiments, the diameter of the third smallest enclosing circle is equal to the second search width, and the bounded length according to the target rough search direction is equal to the second search length.

[0113] Determine a second direction vector group containing multiple second vectors based on the second search step size, the second search width, and the second search length. The second vectors are used to represent the candidate precise search directions. The process of generating the second direction vector group can refer to the above process of generating the first direction vector group, which will not be elaborated here.

[0114] When searching for candidate precise search directions from the target rough search directions, to ensure higher accuracy, expand the second search step size by 1.5 times and set the second search step number to 100.

[0115] Project the convex hull vertices on each candidate precise search direction and calculate the fourth smallest enclosing circle. The fourth smallest enclosing circle can just enclose the projection points of the convex hull vertices in the candidate precise search direction.

[0116] Traverse the candidate precise search directions, recombine the previous search results into a new direction vector group, and the search width should be multiplied by the scaling factor 10- i , where i represents the number of times the current precise search is executed.

[0117] When the diameters of the fourth smallest enclosing circles obtained from two consecutive searches are both less than the threshold, exit the search, and take the candidate precise search direction corresponding to the fourth smallest enclosing circle with the smallest diameter as the target search direction. The threshold can be set to 10 -6 .

[0118] The target search direction determined through iterative search can be used as a limiting condition for the ideal straight line. Based on the target search direction and combined with the point cloud data, the ideal straight line of the workpiece contour can be finally determined.

[0119] In step 400, an ideal straight line of the workpiece contour is determined based on the target search direction and the point cloud data, which is achieved through the following steps:

[0120] The point cloud data is rotationally transformed according to the target search direction to obtain a rotation matrix. Specifically, the point cloud data is rotationally transformed to the Z-axis according to the target search direction to obtain the rotation matrix R.

[0121] The center coordinate point of the minimum circumscribed circle corresponding to the target search direction is obtained. The center coordinate point is represented by a three-dimensional point, which can be denoted as the three-dimensional point P(x, y, 0), where the x and y coordinates of the center remain unchanged and the z coordinate is set to 0.

[0122] The inverse rotation transformation is performed on the three-dimensional point according to the rotation matrix R to obtain the position point P×R of the ideal straight line -1 , and the position point and the target search direction can determine the ideal straight line.

[0123] In step 500, after the ideal straight line is determined, the straightness, maximum offset, and minimum offset of the ideal straight line can be calculated.

[0124] Figure 6 The schematic diagram of the ideal straight line determined by the method of the present application is shown. As Figure 6 shown, the maximum offset is the farthest distance from the points in the point cloud to the fitted straight line, the minimum offset is the closest distance from the points in the point cloud to the fitted straight line, and the straightness is twice the maximum offset. The straightness tolerance zone is cylindrical, and the radius of the cylinder is equal to the radius of the minimum circumscribed circle determined by the target search direction.

[0125] In some embodiments, since the iterative search itself is based on an exhaustive search idea, the computational amount of the iterative search is huge. Based on this, the present application obtains the numerical distribution law of the search results according to the function between the search results and the search direction, and uses the binary search strategy to find the optimal solution, which is specifically achieved through the following steps:

[0126] Construct the functional relationship between the vector subscript value in the direction vector group and the diameter of the minimum circumscribed circle corresponding to the direction vector group, Figure 7A The functional relationship between the vector subscript and the diameter of the minimum circumscribed circle is shown.

[0127] The functional relationship is D cir = f(i, j). As Figure 7A shown, the function is a single concave surface with one and only one minimum point. f(i) and f(j) are respectively used to represent the row function and the column function. The smaller the vector subscript value, the larger the corresponding vector eigenvalue;

[0128] Parallel search is performed on each row based on the row function. As Figure 7BThe figure shows a schematic diagram of row search.

[0129] Column search is performed on the columns in each row based on the column function.

[0130] Among them, the column search finds the extreme point according to the binary search method, as Figure 7C The figure shows a schematic diagram of the binary search method for finding the extreme point, which specifically includes the following steps:

[0131] Calculate the function values of each row respectively. The function values include the function values of the endpoints of each row and the function values of the midpoints of each row, and select the minimum function value from the function values of each row;

[0132] Take the point corresponding to the minimum function value as the starting point, start from the starting point, and search for the points on both sides of the starting point along the column direction. When the difference between the function value corresponding to the current search point and the function value corresponding to the previous search point is greater than 0, jump out of the search for this row and continue the search for the next column.

[0133] In this embodiment, the binary search strategy is used to find the minimum value point, that is, the optimal solution, which avoids a large number of invalid searches. At the same time, combined with parallel computing, the algorithm efficiency can be increased by 2 to 3 times.

[0134] In some embodiments, the straightness conforming to the minimum tolerance principle is divided into two types: unconstrained (fitting in space) and plane constraint. When unconstrained, there is no need to set constraint parameters, and the above method steps can be followed.

[0135] Figure 8 The figure shows a schematic diagram of the ideal straight line determined based on the target search direction in the constraint plane, as Figure 8 The shown tolerance zone is rectangular. The point cloud data is projected onto the constraint plane to form projection points. The ideal straight line is parallel and equidistant from the tolerance zone straight line. The maximum / minimum offset is located on both sides of the ideal straight line, with equal values and opposite signs. The straightness is equal to the maximum offset minus the minimum offset. On the premise of plane constraint, using the iterative search strategy, the target search direction of the ideal straight line is determined from multiple initial search directions, and it is realized through the following steps:

[0136] Project the point cloud data onto a preset plane, and the preset plane is determined by the preset plane position point and the preset plane normal vector;

[0137] On the preset plane, use the iterative search strategy to determine the target search direction of the ideal straight line from multiple initial search directions.

[0138] Another embodiment of the present application also discloses a straightness measurement device based on iterative search, Figure 9 The figure shows a block diagram of a straightness measurement device based on iterative search. As Figure 9As shown in the figure, the straightness device 900 includes an acquisition module 901, an iterative search module 902, and a calculation module 903.

[0139] Among them, the acquisition module is used to scan the workpiece to obtain the point cloud data of the workpiece contour. The point cloud data is used to determine the convex hull of the workpiece contour, and the convex hull includes multiple convex hull vertices.

[0140] The iterative search module is used to perform iterative search on multiple initial search directions to obtain the target search direction. The convex hull vertices and the point cloud data are used to determine the multiple initial search directions, and the target search direction and the point cloud data are used to determine the ideal straight line of the workpiece contour.

[0141] The calculation module is used to calculate the straightness according to the point cloud data and the ideal straight line.

[0142] The implementation process of the straightness measurement device based on iterative search is similar to that of the above-mentioned straightness measurement method based on iterative search, and will not be elaborated here.

[0143] In this application, the convex hull of the workpiece contour is determined based on the point cloud data, and the ideal straight line is fitted based on the convex hull, which can reduce a large amount of redundant operations; further, multiple initial search directions are determined through the convex hull vertices and the point cloud data, and the iterative search method is used to obtain the target search direction from the multiple initial search directions. The accuracy of the target search direction obtained through iterative search is high; the ideal straight line is determined based on the target search direction, so that the determined ideal straight line is closer to the real straight line, and further the measured straightness is closer to the true value of the straightness.

[0144] In addition, another embodiment of this application also discloses a computer program product containing instructions. When the computer program product runs on an electronic device, the electronic device can implement all or part of the steps in the straightness measurement method based on iterative search.

[0145] The steps of the methods or algorithms described in the embodiments of this application can be directly embedded in hardware, software units executed by a processor, or a combination of both. The software units can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be provided in an ASIC, and the ASIC can be provided in a UE. Optionally, the processor and the storage medium can also be provided in different components in the UE.

[0146] It should be understood that in various embodiments of the present application, the sequence numbers of the various processes do not imply the order of execution, and the order of execution of the various processes should be determined by their functions and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0147] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

[0148] For the same or similar parts among the various embodiments of this specification, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the description in the method embodiment part for the relevant parts.

[0149] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general-purpose hardware platform. Based on such an understanding, the technical solutions in the embodiments of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a storage medium such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of the present invention.

[0150] For the various embodiments in this specification, the same or similar parts can be referred to each other. In particular, for the embodiments of the straightness measurement device based on iterative search disclosed in this application, since it is basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.

[0151] The above-described embodiments of the present invention do not constitute a limitation on the protection scope of the present invention.

Claims

1. A straightness measurement method based on iterative search, characterized in that, The method includes: Scanning a workpiece to obtain point cloud data of the workpiece contour, the point cloud data being used to determine the convex hull of the workpiece contour, the convex hull including a plurality of convex hull vertices; Iteratively searching for a plurality of initial search directions to obtain a target search direction, the convex hull vertices and the point cloud data being used to determine the plurality of initial search directions of the initial search; the target search direction and the point cloud data being used to determine the ideal straight line of the workpiece contour; Calculating the straightness according to the point cloud data and the ideal straight line; The convex hull vertices and the point cloud data being used to determine a plurality of initial search directions of the ideal straight line, further including: Performing SVD decomposition on the point cloud data and the convex hull vertices respectively to obtain two orthogonal vector groups, each orthogonal vector group including a plurality of direction vectors; Calculating the bounded length of the point cloud data on each direction vector; Selecting a plurality of initial search directions from the plurality of direction vectors, the initial search directions being the direction vectors corresponding to the bounded length greater than the product of the longest bounded length and a threshold; The point cloud data being used to determine the convex hull of the workpiece contour, further including: Dividing the point cloud data into several sub-point clouds according to the point cloud index; Performing parallel computing on each sub-point cloud to obtain a sub-convex hull corresponding to each sub-point cloud; Merging the vertices of the sub-convex hulls and calculating to obtain the convex hull corresponding to the point cloud data.

2. The straightness measurement method based on iterative search according to claim 1, characterized in that, The iteratively searching for a plurality of initial search directions to obtain a target search direction, further including: Performing a rough search on a plurality of initial search directions to obtain a plurality of candidate rough search directions as target rough search directions; Performing an accurate search on the target rough search directions to obtain a target search direction.

3. The straightness measurement method based on iterative search according to claim 2, characterized in that, Performing a rough search on a plurality of initial search directions to obtain a plurality of candidate rough search directions as target rough search directions, further including: Projecting the convex hull vertices onto an arbitrary plane with each initial search direction as the normal, and calculating the first minimum enclosing circle corresponding to each initial search direction; Setting a first search step, and determining a first direction vector group including a plurality of first vectors based on the first search step, a first search width, and a first search length, the first vectors being used to represent the candidate rough search directions, the diameter of the first minimum enclosing circle being used to determine the first search width, and the bounded length of the initial search direction being used to determine the first search length; Projecting the convex hull vertices onto each candidate rough search direction and calculating the second minimum enclosing circle; Selecting the candidate rough search direction corresponding to the second minimum enclosing circle with the smallest diameter as the target rough search direction.

4. The straightness measurement method based on iterative search according to claim 3, characterized in that, Performing an accurate search on the target rough search directions to obtain a target search direction, further including: Projecting the convex hull vertices onto an arbitrary plane with each target rough search direction as the normal, and calculating the third minimum enclosing circle corresponding to each target rough search result; Set a second search step size, and determine a second direction vector group including a plurality of second vectors based on the second search step size, a second search width, and a second search length. The second vectors are used to represent candidate exact search directions. The diameter of the third minimum bounding circle is used to determine the second search width, and the bounded length of the target rough search direction is used to determine the second search length; Project the convex hull vertices in each of the candidate exact search directions, and calculate a fourth minimum bounding circle; Traverse the candidate exact search directions. When the diameters of the fourth minimum bounding circles obtained from two consecutive searches are both less than a threshold, exit the search, and take the candidate exact search direction corresponding to the fourth minimum bounding circle with the smallest diameter as the target search direction.

5. The straightness measurement method based on iterative search according to claim 1, characterized in that, The iterative search for a plurality of initial search directions to obtain a target search direction further includes: Project the point cloud data onto a preset plane, where the preset plane is determined by a preset plane position point and a preset plane normal vector; On the preset plane, perform iterative search on a plurality of initial search directions to obtain a target search direction.

6. The straightness measurement method based on iterative search according to claim 1, characterized in that, The target search direction and the point cloud data are used to determine an ideal straight line of the workpiece contour, which further includes: Perform a rotation transformation on the point cloud data according to the target search direction to obtain a rotation matrix; Obtain the center coordinate point of the minimum bounding circle corresponding to the target search direction, where the center coordinate point is represented by a three-dimensional point; Perform an inverse rotation transformation on the three-dimensional point according to the rotation matrix to obtain the position point of the ideal straight line. The position point and the target search direction can determine the ideal straight line.

7. The straightness measurement method based on iterative search according to claim 3 or 4, characterized in that, The method further includes: Construct a functional relationship between the vector subscript values in the direction vector group and the diameters of the minimum bounding circles corresponding to the direction vector group; wherein, the functional relationship is D cir = f(i, j), the function is a single concave surface and has only one minimum point, f(i) and f(j) are respectively used to represent the row function and the column function, and the smaller the vector subscript value, the larger the corresponding vector eigenvalue; Perform parallel search on each row based on the row function; Perform column search on the columns in each row based on the column function; Among them, the column search includes: Calculate the function values of each row respectively. The function values include the function values of the endpoints of each row and the function values of the midpoints of each row, and select the minimum function value from the function values of each row; Take the point corresponding to the minimum function value as the starting point, and start from the starting point to search for the points on both sides of the starting point along the direction of the column. When the difference between the function value corresponding to the current search point and the function value corresponding to the previous search point is greater than 0, jump out of the search for this row.

8. A straightness measurement device based on iterative search, the device is applied to the straightness measurement method based on iterative search according to any one of claims 1 to 7, characterized in that, The device includes: An acquisition module, configured to scan a workpiece to acquire point cloud data of the workpiece contour. The point cloud data is used to determine the convex hull of the workpiece contour, and the convex hull includes a plurality of convex hull vertices; An iterative search module, configured to perform iterative search on a plurality of initial search directions to obtain a target search direction. The convex hull vertices and the point cloud data are used to determine the plurality of initial search directions, and the target search direction and the point cloud data are used to determine an ideal straight line of the workpiece contour; A calculation module, configured to calculate the straightness according to the point cloud data and the ideal straight line.

Citation Information

Patent Citations

  • Grid association-based quadtree index point cloud sorting method

    CN106780748A

  • Train axle space straightness measuring method

    CN110473175A