CN-116576804-B - Convex hull-based chebyshev flatness measurement method and system
Abstract
The invention relates to the technical field of flatness measurement and discloses a chebyshev flatness measurement method and system based on convex hulls, comprising the steps of inputting a depth image, extracting point groups in an ROI (region of interest) area, and carrying out convex hull detection on the point groups to obtain convex hulls containing the point groups; judging whether the number of the convex hull surfaces is larger than 0, if so, constructing candidate planes according to the convex hulls, adopting a candidate plane screening algorithm to screen and obtain an optimal chebyshev plane, if not, adopting a least square method to perform plane fitting according to a point array to obtain the optimal chebyshev plane, calculating the absolute value of the distance from the point array to the optimal chebyshev plane, sorting in descending order according to the absolute value, removing noise points according to a set rule, and carrying out convex hull detection on the rest point arrays again until the optimal chebyshev plane is obtained, and obtaining the planeness. The calculated amount is simplified, and the chebyshev flatness can be rapidly and accurately obtained.
Inventors
- PAN WEI
- FU JIXIANG
- CAO LING
- LU SHENGLIN
Assignees
- 广东奥普特科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230523
Claims (10)
- 1. A convex hull-based chebyshev flatness measurement method, the method comprising: Inputting a depth image, extracting a point array in an ROI (region of interest) area, and performing convex hull detection on the point array to obtain a convex hull containing the point array; Judging whether the number of the convex hull surfaces is larger than 0; if yes, constructing a candidate plane according to the convex hull, and screening the candidate plane by adopting a candidate plane screening algorithm to obtain an optimal chebyshev plane; if not, performing plane fitting by adopting a least square method according to the point array to obtain an optimal chebyshev plane; Calculating the absolute value of the distance from the point array to the optimal chebyshev plane, sorting in descending order according to the absolute value, and eliminating noise points according to a set rule; And (3) detecting the convex hulls of the rest point groups again until an optimal Chebyshev plane is obtained, wherein if the optimal Chebyshev plane is obtained by adopting a candidate plane screening algorithm, the flatness is a value corresponding to the minimum value in the error maximum value array in the screening process, and if the optimal Chebyshev plane is obtained by adopting least square fitting, the directed distance from the rest point array to the optimal Chebyshev plane is calculated, and the flatness is the maximum value minus the minimum value.
- 2. The convex hull-based chebyshev flatness measurement method according to claim 1, wherein the step of inputting the depth image, extracting a point array in the ROI area, and performing convex hull detection on the point array to obtain a convex hull including the point array comprises: inputting a depth image and extracting a point group in the ROI area; And carrying out rapid convex hull detection on the point groups by adopting a rapid convex hull detection algorithm to obtain convex hulls containing the point groups.
- 3. The convex hull-based chebyshev flatness measurement method according to claim 1, wherein the steps of constructing candidate planes according to the convex hull, and screening the candidate planes by adopting a candidate plane screening algorithm to obtain an optimal chebyshev plane comprise: constructing candidate planes by using the convex hull surface and the convex hull edges; Traversing and calculating absolute values of distances from the convex hull vertexes to each candidate plane to obtain an error maximum value array; Taking a candidate plane corresponding to the minimum value in the error maximum value array as a target plane; and calculating the central point of the convex hull, and translating the target plane to the central point of the convex hull to obtain the optimal chebyshev plane.
- 4. The convex hull-based chebyshev flatness measurement method according to claim 1, wherein the step of calculating absolute values of distances from the point array to an optimal chebyshev plane, sorting in descending order according to the absolute values, and removing noise points according to a set rule comprises: Calculating the absolute value of the distance from the point array to the optimal chebyshev plane; and sorting in descending order according to the absolute value, and eliminating the first 5% noise points in the sorting.
- 5. A convex hull-based chebyshev flatness measurement system, the system comprising: the convex hull detection module is used for inputting the depth image, extracting a point array in the ROI area, and carrying out convex hull detection on the point array to obtain a convex hull containing the point array; The convex hull judging module is used for judging whether the number of the convex hull surfaces is larger than 0, if so, constructing candidate planes according to the convex hulls, and adopting a candidate plane screening algorithm to screen the candidate planes to obtain an optimal chebyshev plane; the noise point removing module is used for calculating the absolute value of the distance from the point array to the optimal chebyshev plane, sorting the points in descending order according to the absolute value, and removing the noise points according to a set rule; The flatness calculation module is used for carrying out convex hull detection on the rest point groups again until an optimal chebyshev plane is obtained, if the optimal chebyshev plane is obtained by adopting a candidate plane screening algorithm, the flatness is a value corresponding to the minimum value in the error maximum value array in the screening process, and if the optimal chebyshev plane is obtained by adopting a least square method fitting, the directed distance from the rest point arrays to the optimal chebyshev plane is calculated, and the flatness is the maximum value and the minimum value.
- 6. The convex hull-based chebyshev flatness measurement system of claim 5, wherein the convex hull detection module is specifically configured to: inputting a depth image and extracting a point group in the ROI area; And carrying out rapid convex hull detection on the point groups by adopting a rapid convex hull detection algorithm to obtain convex hulls containing the point groups.
- 7. The convex hull-based chebyshev flatness measurement system of claim 5, wherein the step of constructing candidate planes from the convex hulls by the convex hull judgment module and screening the candidate planes by a candidate plane screening algorithm to obtain an optimal chebyshev plane comprises: constructing candidate planes by using the convex hull surface and the convex hull edges; Traversing and calculating absolute values of distances from the convex hull vertexes to each candidate plane to obtain an error maximum value array; Taking a candidate plane corresponding to the minimum value in the error maximum value array as a target plane; and calculating the central point of the convex hull, and translating the target plane to the central point of the convex hull to obtain the optimal chebyshev plane.
- 8. The convex hull-based chebyshev flatness measurement system of claim 5, wherein the noise point rejection module is specifically configured to: Calculating the absolute value of the distance from the point array to the optimal chebyshev plane; and sorting in descending order according to the absolute value, and eliminating the first 5% noise points in the sorting.
- 9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the convex hull based chebyshev flatness measurement method according to any one of claims 1-4 when executing the computer program.
- 10. A storage medium containing computer executable instructions for execution by a computer processor to implement the convex hull-based chebyshev flatness measurement method of any one of claims 1-4.
Description
Convex hull-based chebyshev flatness measurement method and system Technical Field The invention relates to the technical field of flatness measurement, in particular to a chebyshev flatness measurement method and system based on convex hulls. Background In recent years, computer technologies such as computer vision, target detection, three-dimensional data scanning and the like are rapidly developed, and various application researches based on depth images and three-dimensional point cloud data are becoming research hotspots in the field of computer vision. Flatness is an important indicator for measuring the flatness and smoothness of 3D surfaces of objects, and is commonly used in measurement-type industrial applications. At present, the flatness error assessment method mainly comprises a minimum inclusion method, a maximum straight line method, a three-distance point method, a diagonal line method, a least square method, a chebyshev method and the like. The least square method and chebyshev method are the best fit, and the result obtained by the least square method and chebyshev method is the best fit. However, the least square method and the chebyshev method have the defect that the fitting plane of the least square method cannot simulate the real state of the surface contact when a plane is selected as the first reference plane. However, chebyshev's rule only considers the distance from the extreme point to the fitting plane, so that the non-extreme point which should not participate in the calculation will bring about a great amount of calculation. Meanwhile, due to the limitation of a sensor, a plurality of data such as outliers, noise points, environmental points, non-target area points and the like possibly exist in a measurement area, so that the real flatness result is greatly influenced. Accordingly, improvements in the art are needed. The above information is presented as background information only to aid in the understanding of the present disclosure and is not intended or admitted to be prior art relative to the present disclosure. Disclosure of Invention The invention provides a chebyshev flatness measuring method and system based on convex hulls, which are used for solving the defects in the prior art. In order to achieve the above object, the present invention provides the following technical solutions: in a first aspect, the present invention provides a convex hull-based chebyshev flatness measurement method, the method comprising: Inputting a depth image, extracting a point array in an RO I region, and performing convex hull detection on the point array to obtain a convex hull containing the point array; Judging whether the number of the convex hull surfaces is larger than 0; if yes, constructing a candidate plane according to the convex hull, and screening the candidate plane by adopting a candidate plane screening algorithm to obtain an optimal chebyshev plane; if not, performing plane fitting by adopting a least square method according to the point array to obtain an optimal chebyshev plane; Calculating the absolute value of the distance from the point array to the optimal chebyshev plane, sorting in descending order according to the absolute value, and eliminating noise points according to a set rule; And (3) detecting the convex hulls of the rest point groups again until an optimal Chebyshev plane is obtained, wherein if the optimal Chebyshev plane is obtained by adopting a candidate plane screening algorithm, the flatness is a value corresponding to the minimum value in the error maximum value array in the screening process, and if the optimal Chebyshev plane is obtained by adopting least square fitting, the directed distance from the rest point array to the optimal Chebyshev plane is calculated, and the flatness is the maximum value minus the minimum value. Further, in the chebyshev flatness measurement method based on convex hulls, the step of inputting a depth image, extracting a point array in an RO I region, and performing convex hull detection on the point array to obtain a convex hull including the point array includes: inputting a depth image, and extracting a point group in an RO I region; And carrying out rapid convex hull detection on the point groups by adopting a rapid convex hull detection algorithm to obtain convex hulls containing the point groups. Further, in the chebyshev flatness measurement method based on the convex hull, the step of constructing candidate planes according to the convex hull and adopting a candidate plane screening algorithm to screen the candidate planes to obtain the optimal chebyshev plane comprises the following steps: constructing candidate planes by using the convex hull surface and the convex hull edges; Traversing and calculating absolute values of distances from the convex hull vertexes to each candidate plane to obtain an error maximum value array; Taking a candidate plane corresponding to the minimum value in the error maximum valu