Workpiece surface defect detection and early warning method based on 3D vision
By using a 3D vision-based method for detecting surface defects in workpieces, and by processing and analyzing 3D point cloud data, the inefficiency and inaccuracy of traditional manual visual inspection are solved. This method enables efficient and accurate defect detection and early warning, thereby improving production efficiency and product quality.
Patent Information
- Application Number
- CN202410781254.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-06-18
AI Technical Summary
In the traditional polishing and grinding industry, the detection of surface defects in workpieces relies on manual visual inspection, which leads to low efficiency, inconsistent detection results, and susceptibility to human factors, making it difficult to meet the demand for efficient and accurate detection.
A 3D vision-based method for detecting and warning of surface defects in workpieces is adopted. Three-dimensional point cloud data is collected by a 3D scanning device, and noise reduction, filtering and enhancement processing are performed. Combined with Gaussian curvature, average curvature and density analysis, defect types are identified and warnings are issued.
It enables automated, rapid, and accurate detection of workpiece surface defects, reduces the impact of human factors, improves detection efficiency and product quality, and has intelligent early warning functions to ensure production safety.
Smart Images

Figure CN118644456B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent detection, in particular to a workpiece surface polishing and grinding defect detection and early warning method based on 3D vision. BACKGROUND
[0002] In the traditional polishing and grinding industry, the detection of workpiece surface defects usually relies on manual visual inspection. This method has significant limitations. First, manual inspection is inefficient and difficult to meet the rapid detection needs of large-scale production lines. Second, due to the limitations and subjectivity of manual vision, the detection results are often affected by human factors, leading to inconsistency and reliability problems in the detection results. In addition, long-time visual inspection work is also prone to cause fatigue and misjudgment of the operators, further reducing the detection quality.
[0003] With the rapid development of intelligent manufacturing technology, the level of industrial automation and intelligence is continuously improving, and the accuracy and efficiency of polishing and grinding workpiece surface defect detection are also increasingly demanding. Therefore, developing a system that can automatically, quickly and accurately detect polishing and grinding workpiece surface defects is of great significance for improving product quality, reducing production costs and ensuring production safety. SUMMARY
[0004] The purpose of the present application is to provide a workpiece surface defect detection and early warning method based on 3D vision, which can solve the problem of misjudgment and low detection quality caused by relying on manual inspection in the prior art.
[0005] The purpose of the present application is achieved by the following technical solutions:
[0006] The workpiece surface defect detection and early warning method based on 3D vision includes the following steps:
[0007] Step S1, using a 3D scanning device to scan the workpiece surface, collecting three-dimensional point cloud data of the workpiece surface and preprocessing, constructing a three-dimensional point cloud data set of the workpiece surface;
[0008] Step S2, by analyzing the three-dimensional point cloud data set, identifying the defect type of the workpiece surface and giving early warning according to the defect type;
[0009] Step S3, roughness detection is performed on the workpiece surface, and it is determined whether the workpiece is a qualified product.
[0010] Further, the preprocessing includes but is not limited to noise removal, filtering and enhancement.
[0011] Further, the noise removal uses a point cloud radius filtering algorithm, including the following steps:
[0012] Step S101, set the radius threshold r;
[0013] Step S102, reading a certain point cloud data;
[0014] Step S103, calculating the distance of the point cloud data from the neighborhood point;
[0015] Step S104, comparing the distance of the point cloud data from the neighborhood point with the set radius threshold r, if the distance of the neighborhood point > r, marking it as a noise point and deleting it, otherwise going to step S105;
[0016] Step S105, confirming whether all point cloud data are traversed, if not, going to step S102, otherwise going to step S106;
[0017] Step S106, saving the filtered point cloud data.
[0018] Further, the step S2 comprises:
[0019] Step S201, setting the threshold value of the Gaussian curvature as Ky and the threshold value of the average curvature as Hy;
[0020] Step S202, reading the preprocessed three-dimensional point cloud data, and selecting a neighborhood for each point of the three-dimensional point cloud data;
[0021] Step S203, fitting a local surface for the points in the same neighborhood by the least square method;
[0022] Step S204, calculating the Gaussian curvature K and the average curvature H of the three-dimensional point cloud data based on the fitted local surface;
[0023] Step S205, judging whether the Gaussian curvature K is greater than the threshold value Ky, if yes, issuing a defect type 1 warning, otherwise going to the next step;
[0024] Step S206, judging whether the average curvature H is greater than the threshold value Hy, if yes, issuing a defect type 2 warning, otherwise determining that the workpiece is qualified.
[0025] Further, the step S3 comprises:
[0026] Step S301, setting the density threshold value My and the secondary polishing threshold value Dy;
[0027] Step S302, performing point cloud segmentation on the preprocessed three-dimensional point cloud data set, dividing it into several segmentation regions, and calculating the density Mn of each segmentation region;
[0028] Step S303, traversing all the segmentation region densities Mn and comparing them with the density threshold value My respectively, if Mn > My, marking the corresponding segmentation region as a rough region;
[0029] Step S304, the number of rough domains D is acquired and compared with the secondary polishing threshold Dy, if D>Dy, the workpiece is determined as unqualified product, otherwise, it is determined as qualified product.
[0030] Further, the step S302 comprises:
[0031] Step S3021, setting the distance threshold Ly;
[0032] Step S3022, randomly selecting a point in the center region of the polished workpiece as a seed point, the density Mn of the seed point is initially set as 0, and n is the seed point number;
[0033] Step S3023, based on the set distance threshold Ly, searching for the adjacent points in the neighborhood of the seed point, and measuring the distance L between the adjacent points and the seed point;
[0034] Step S3024, if the distance L is less than the distance threshold Ly, the density Mn of the seed point is increased by 1, the adjacent point and the seed point are classified into the same class and marked with the same segmentation region; otherwise, other adjacent points in the neighborhood of the seed point are selected, and the step S3023 is returned to, until all adjacent points in the neighborhood of the seed point are traversed, and the step S3025 is returned to;
[0035] Step S3025, taking the points outside the marked segmentation region as new seed points, and returning to step S3022 until all seed points in the center region of the polished workpiece are traversed.
[0036] Further, the enhanced preprocessing process comprises:
[0037] Calculating the gray value histogram;
[0038] Calculating the cumulative gray histogram;
[0039] Merging the cumulative gray histogram to the nearest gray value;
[0040] Calculating the new histogram.
[0041] The workpiece surface defect detection and early warning method based on 3D vision of the application utilizes the 3D vision sensor to collect the three-dimensional data of the workpiece surface in real time, realizes the automatic detection and early warning of the workpiece surface defects. Compared with the traditional manual visual inspection method, the system has higher detection efficiency and accuracy, can significantly reduce the influence of human factors on the detection results, and improve the product quality and production efficiency. At the same time, the application also has an intelligent early warning function, can timely issue early warning information when detecting potential defects, helps the operator to process in time, and ensures the production safety. BRIEF DESCRIPTION OF DRAWINGS
[0042] Figure 1A flowchart for constructing a three-dimensional point cloud dataset of a workpiece surface of the present application;
[0043] Figure 2 A flowchart for point cloud data radius filtering of the present application;
[0044] Figure 3 A flowchart for identifying defect types of a workpiece surface and giving early warnings for defect types of the present application;
[0045] Figure 4 A flowchart for roughness detection of a workpiece surface of the present application;
[0046] Figure 5 A flowchart for point cloud segmentation of the present application. DETAILED DESCRIPTION
[0047] The embodiments of the present disclosure will be described in detail below with reference to the drawings.
[0048] The embodiments of the present disclosure will be described in detail below with reference to the drawings.
[0049] The 3D vision-based workpiece surface defect detection and early warning method of the present application comprises the following steps:
[0050] Step S1, a 3D scanning device is used to scan the surface of the workpiece, collect three-dimensional point cloud data of the surface of the workpiece and pre-process, and construct a three-dimensional point cloud dataset of the surface of the workpiece.
[0051] Further, the pre-processing includes but is not limited to noise removal, filtering and enhancement.
[0052] The noise removal algorithm adopts a point cloud radius filtering algorithm, which is a commonly used point cloud data processing method, used to remove outliers and noise, and improve the quality and accuracy of the point cloud data.
[0053] The principle of point cloud radius filtering is based on the neighborhood information of each point in the point cloud. For a given point cloud data, the relationship between points can be evaluated by calculating the distance of the neighborhood points around each point. If the distance of the neighborhood points of a point exceeds the set threshold, the point may be an outlier or a noise point and can be filtered out.
[0054] The steps of point cloud data radius filtering are shown in Figure 2 and specifically include the following steps:
[0055] Step S101, set a radius threshold r.
[0056] According to the specific requirements of polishing different workpieces, a suitable radius threshold is set. This radius threshold determines the range of the field that needs to be checked around each point.
[0057] Step S102, read a certain point cloud data.
[0058] Read the point cloud data of the polished workpiece surface collected by the 3D visual scanning device.
[0059] Step S103, calculate the distance of the neighborhood points of the point.
[0060] Step S104, compare the distance of the neighborhood points of the point with the set radius threshold r. If the distance of the neighborhood points of the point > r, mark it as a noise point and delete it, otherwise go to step S105.
[0061] Step S105, confirm whether all point cloud data has been traversed. If not, go to step S102, otherwise go to step S106.
[0062] Step S106, save the filtered point cloud data.
[0063] The specific range of the above-mentioned setting of the radius threshold will vary depending on the characteristics of the point cloud data, the application scenario and the required filtering effect. The setting of the radius threshold should not be considered as a limitation on the scope of protection of the present application. Some common considerations and recommended threshold ranges are as follows:
[0064] Point cloud density: The higher the point cloud density, the more points there will be in the neighborhood of each point. Therefore, in high-density point clouds, a larger radius threshold may need to be set to avoid mistakenly deleting normal points. Conversely, in low-density point clouds, a smaller radius threshold can be set.
[0065] Noise level: If the point cloud data contains a large number of noise or outlier points, a smaller radius threshold may need to be set to more strictly eliminate these points. Conversely, if the noise level is low, a larger radius threshold can be considered.
[0066] Surface curvature: If the point cloud data represents complex surfaces or sharp edges, it may be necessary to adjust the radius threshold more finely to preserve these features. In flat areas, a larger threshold can be used; while in sharp edges or high curvature areas, a smaller threshold may be needed.
[0067] Application scenarios: Different application scenarios have different requirements for point cloud data. For example, in medical devices, dental models or jewelry polishing related three-dimensional modeling, more attention may be paid to preserving the details and features of the original data.
[0068] Based on the above considerations, the following are some suggested radius threshold ranges:
[0069] For low-density point clouds (such as those obtained by laser radar scanning), the radius threshold may be set between 0.1 meters and 1 meter.
[0070] For high-density point clouds (such as those obtained by high-resolution cameras), the radius threshold may be set between a few centimeters and a few tens of centimeters.
[0071] If strict noise or outlier removal is required, the radius threshold can be set smaller; if more original data details need to be preserved, the radius threshold can be set larger.
[0072] Among them, the enhanced preprocessing operation is based on the histogram equalization algorithm.
[0073] Image contrast enhancement methods can be divided into two categories: direct contrast enhancement methods and indirect contrast enhancement methods. Histogram stretching and histogram equalization are common indirect contrast enhancement methods. Histogram stretching is to adjust the histogram using contrast stretching to expand the difference between foreground and background gray levels. This method can be achieved through linear and nonlinear methods. Histogram equalization is to adjust the gray value using the cumulative function to achieve contrast enhancement.
[0074] Histogram equalization processing principle: The original image gray image is uniformly distributed in the entire gray space from a certain gray interval, which realizes the nonlinear stretching of the image and redistributes the image pixel value.
[0075] The process of enhancing preprocessing based on the histogram equalization algorithm includes the following steps:
[0076] Step 1: Calculate the gray value histogram.
[0077] Original gray value histogram calculation method:
[0078] Formula (1)
[0079] Where r kn represents the number of pixels with gray value k, and n represents the number of all pixels (for example, n = 10 x 10 = 100) for normalization. k n represents the number of pixels with gray value k, and n represents the number of all pixels (for example, n = 10 x 10 = 100) for normalization.
[0080] Step 2: Calculate the cumulative gray histogram.
[0081] The cumulative gray histogram is to find the distribution function F(r) of the probability density function p(r). r k r k
[0082] Equation (2)
[0083] Step 3: Let s k merge to the nearest gray value.
[0084]
[0085] Step 4: Calculate the new histogram.
[0086] Equation (3)
[0087] Step S2, by analyzing the three-dimensional point cloud data set, identifying the defect type of the workpiece surface and giving early warning according to the defect type.
[0088] Further, the processing process of step S2 is as shown in Figure 3 , including the following steps:
[0089] Step S201, set the threshold value of Gaussian curvature Ky, and set the threshold value of average curvature Hy.
[0090] The setting rules of Gaussian curvature threshold Ky and average curvature threshold Hy
[0091] In defect detection, when using Gaussian curvature and average curvature as features, the setting of threshold value is a key step, which directly affects the accuracy and efficiency of detection. However, the setting of threshold value does not have a fixed value, because it depends on many factors such as specific application scenarios, data characteristics, defect types and expected detection sensitivity.
[0092] In this embodiment, the Gaussian curvature threshold Ky follows the following setting principle: first, view the Gaussian curvature distribution of normal surfaces and defect areas in the point cloud data. According to the observed distribution, a Gaussian curvature threshold range is preliminarily set. For example, if the Gaussian curvature of the normal surface is concentrated in a certain interval, and the Gaussian curvature of the defect area deviates significantly from this interval, the boundary value of this interval can be used as the threshold. The actual data is detected using the preliminarily set threshold, and the results are observed. According to the detection results, the threshold is adjusted until a satisfactory detection effect is achieved.
[0093] In this embodiment, the average curvature threshold Hy follows the following setting principle: first, view the average curvature distribution of normal surfaces and defect areas in the point cloud data. According to the observed distribution, a average curvature threshold range is preliminarily set. For example, if the Gaussian curvature of the normal surface is concentrated in a certain interval, and the average curvature of the defect area deviates significantly from this interval, the boundary value of this interval can be used as the threshold. The actual data is detected using the preliminarily set threshold, and the results are observed. According to the detection results, the threshold is adjusted until a satisfactory detection effect is achieved.
[0094] The Gaussian curvature threshold Ky and the average curvature threshold Hy in this application can be set according to other conditions, and the specific setting method should not be regarded as a limitation on the protection scope of this application. In addition, the iterative optimization principle is followed, that is, by continuously collecting data, analyzing results, adjusting threshold and model parameters, the accuracy and efficiency of detection can be gradually improved.
[0095] Step S202, read the preprocessed three-dimensional point cloud data, and select a neighborhood for each three-dimensional point cloud data point, called point cloud neighborhood.
[0096] The rule for selecting the neighborhood is that the points within the radius threshold r are the neighborhood of this point.
[0097] Step S203, fit a local surface to the points in the same neighborhood by least squares method.
[0098] In the point cloud fitting problem, the least squares method is often used to fit the surface to the point cloud. The quadratic surface is a commonly used fitting model, and its general form is:
[0099] Equation (4)
[0100] Suppose there are n data points (x i , y i , z i), x, y, z are the three-dimensional coordinate values of the i-th data point, where i = 1, 2, …, n. The goal is to find a set of coefficients a, b, c, d, e, f, called fitting parameters, such that the quadratic surface determined by these fitting parameters has the smallest sum of squared errors with the data points.
[0101] The sum of squared errors S can be expressed as:
[0102] Equation (5)
[0103] To find a, b, c, d, e, f that minimizes S, we need to take the partial derivatives of S with respect to a, b, c, d, e, f and set them to zero. This will give us a system of linear equations, which can be solved to find the values of a, b, c, d, e, f.
[0104] The specific steps are as follows:
[0105] Step 1: Take the partial derivative of S with respect to a and set it to zero:
[0106] Equation (6)
[0107] This will give us an equation in terms of a that includes b, c, d, e, f, and the data points (x i , y i , z i ).
[0108] Step 2: Similarly, take the partial derivatives of S with respect to b, c, d, e, f and set them to zero to get five more equations.
[0109] Step 3: Combine these six equations into a system of linear equations and solve the system to find the values of a, b, c, d, e, f.
[0110] Step S204, based on the fitted local surface, calculate the Gaussian curvature K and the mean curvature H of the three-dimensional point cloud data.
[0111] Curvature is a measure of the degree of bending of a curve. Mean curvature is an "extrinsic" measure of curvature in differential geometry, which describes the curvature of a surface embedded in the surrounding space (such as a two-dimensional surface embedded in three-dimensional Euclidean space). Gaussian curvature is a quantity that describes the concave-convex properties of a surface, and when this quantity changes greatly, it indicates that the surface has a low degree of smoothness.
[0112] Any point in the point cloud data set exists on a certain surface , the curvature of the point n can be represented by the curvature of the local surface fitted by the point n and its neighborhood points. By least square fitting, a quadric surface can be used to represent the local region, and the mean curvature H and the Gaussian curvature K at each point can be calculated, with the following formulas:
[0113] Formula (7)
[0114] In formula (7):
[0115] L = r xx n; M = r xy n; N = r yy n; E = r x r x ; F = E = r x r y ; G = E = r y r y ; r x , r y , r xx , r yy , r xy are partial derivatives of the surface, E, F, G are called the first fundamental invariants of the surface, and L, M, N are called the second fundamental invariants of the surface.
[0116] Step S205, determine whether the Gaussian curvature K is greater than the threshold Ky, if yes, issue a defect type 1 warning, otherwise proceed to the next step.
[0117] Step S206, determine whether the mean curvature H is greater than the threshold Hy, if yes, issue a defect type 2 warning, otherwise determine that the workpiece is qualified.
[0118] Step S3, roughness detection is performed on the workpiece surface, and it is determined whether the workpiece is a qualified product.
[0119] The defect detection of step S2 mainly focuses on whether the workpiece has problems that do not meet expectations, while the roughness detection focuses on the microscopic geometric error of the workpiece surface. It can be said that the defect detection is to investigate the macroscopic larger problem, and the roughness detection is the microscopic smooth problem.
[0120] The present application uses density analysis method to perform roughness detection of the polished workpiece. On a smooth surface, the density of points is usually uniform; while in a rough area (such as a protrusion or unevenness), the density of points may change. The specific process is as shown in Figure 4 , including the following steps:
[0121] Step S301, set a density threshold My and a secondary polishing threshold Dy.
[0122] The secondary polishing threshold is set according to the polishing object's requirement for polishing accuracy, experience value, product quality requirement, and cost willingness, etc. The more the polishing times, the higher the cost and quality will be. Generally, it is set to about 3 times. If it exceeds 3 times, the comprehensive cost and marginal cost will increase linearly.
[0123] The density threshold is set as follows. First, analyze the density distribution of the normal workpiece area. Through statistical and visualization tools (such as histogram, box plot, scatter plot, etc.), understand the density range and distribution characteristics of the normal area. Then, based on the results of data analysis, preliminarily set a density threshold range. This range should be able to cover the density variation of the normal area, while being able to distinguish the abnormal area (i.e. the potential rough area). Then use the preliminarily set threshold to detect the actual workpiece, and observe the detection results. According to the experimental results, adjust the threshold range until the rough area can be accurately identified and the false positive rate is reduced.
[0124] The density threshold is set as follows. First, analyze the density distribution of the normal workpiece area. Through statistical and visualization tools (such as histogram, box plot, scatter plot, etc.), understand the density range and distribution characteristics of the normal area. Then, based on the results of data analysis, preliminarily set a density threshold range. This range should be able to cover the density variation of the normal area, while being able to distinguish the abnormal area (i.e. the potential rough area). Then use the preliminarily set threshold to detect the actual workpiece, and observe the detection results. According to the experimental results, adjust the threshold range until the rough area can be accurately identified and the false positive rate is reduced.
[0125] Reasonable principle: The threshold setting should be based on actual data and process requirements to ensure the reasonableness and effectiveness of the threshold.
[0126] Sensitivity principle: The threshold should have a certain sensitivity to timely discover and identify small defects.
[0127] Stability principle: The threshold should have a certain stability and not be greatly affected by measurement equipment, environmental conditions, etc.
[0128] Adjustable principle: The threshold should have a certain adjustability to be flexibly adjusted according to actual application scenarios.
[0129] Step S302, the preprocessed three-dimensional point cloud data set is segmented into point cloud, and the density Mn of each segmentation area is calculated, n≥0.
[0130] According to the characteristics of space, geometry and texture, the point cloud data set is divided, so that the point cloud in the same division has similar characteristics. The purpose of point cloud segmentation is to block, so as to facilitate individual processing.
[0131] Euclidean clustering algorithm is an algorithm for dividing point cloud data into different clusters (clusters). It is a commonly used method in point cloud segmentation, aiming to divide points with close distances into the same cluster, thereby identifying different objects or structures. This algorithm is mainly suitable for point cloud data containing small noise and having certain distance difference.
[0132] Before this process, the point cloud data has been denoised and filtered many times, and is now basically pure high-quality data, so it is very suitable for the Euclidean clustering algorithm. The point cloud segmentation process is as shown in Figure 5 , and includes the following steps:
[0133] Step S3021, set a distance threshold Ly.
[0134] According to the inconsistent quality requirements of the polished workpiece, the distance threshold Ly is usually selected to be 1 / 10, 1 / 100, 1 / 1000, or smaller of the area of the polished workpiece plane.
[0135] Step S3022, randomly select a point in the center area of the polished workpiece that is not on the edge as a seed point, and set the initial value of the density Mn of the seed point to 0, where n is the seed point number, n≥0, i.e., the first seed point is numbered 0, the second seed point is numbered 1, and so on.
[0136] Step S3023, based on the set distance threshold Ly, search for neighboring points in the neighborhood of the seed point, and measure the distance L between the neighboring points and the seed point.
[0137] Step S3024, if the distance L is less than the distance threshold Ly, the density of the seed point is increased by 1, and the neighboring point and the seed point are classified into the same class and marked with the same segmentation area (for example, the first segmentation area is marked as segmentation area 1, the second segmentation area is marked as segmentation area 2, and so on); otherwise, select other neighboring points in the neighborhood of the seed point, and go to step S3023 until all neighboring points in the neighborhood of the seed point are traversed, and go to step S3025.
[0138] Step S3025, take the points outside the marked segmentation area as new seed points, and go to step S3022 until all seed points in the center area of the polished workpiece are traversed.
[0139] The density of each segmentation area is quantified by analyzing the distribution of points in the point cloud data. It can help us understand the distribution of points in the point cloud data, so as to judge the roughness according to the density.
[0140] The application adopts a radius-based density calculation, and the algorithm idea is as follows:
[0141] Set a fixed radius value, i.e., the distance threshold Ly.
[0142] For each seed point, draw a sphere with the seed point as the center and the distance threshold Ly as the radius.
[0143] Count the number of points in the sphere, which is the number of neighboring points of the point.
[0144] The number of adjacent points reflects the density of the seed point.
[0145] Step S303, all of the segmentation region densities Mn are traversed and compared with the density threshold My respectively, if Mn>My, the corresponding segmentation region is marked as a rough region.
[0146] Step S304, the number of rough regions D is obtained and compared with the secondary polishing threshold Dy, if D>Dy, the workpiece is determined as unqualified; otherwise, the workpiece is determined as qualified.
[0147] The above merely illustrates the embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principle of the present application without creative labor shall be included in the protection scope of the present application.
Claims
1. A 3D vision-based workpiece surface defect detection and early warning method, characterized in that, The method comprises the following steps: Step S1, scanning the surface of the workpiece by using a 3D scanning device, collecting three-dimensional point cloud data of the surface of the workpiece in real time and pre-processing, the pre-processing comprising but not limited to removing noise, filtering and enhancing, the removing noise adopting a point cloud radius filtering algorithm, the enhancing adopting enhancement based on cumulative merging of a gray value histogram, and constructing a three-dimensional point cloud data set of the surface of the workpiece; Step S2, identifying the defect type of the surface of the workpiece by analyzing the three-dimensional point cloud data set and giving a pre-warning for the defect type; comprising: Step S201, setting a threshold value Ky of Gaussian curvature and a threshold value Hy of average curvature; Step S202, reading the pre-processed three-dimensional point cloud data, and selecting a neighborhood for each point of the three-dimensional point cloud data; Step S203, fitting a local surface for the points in the same neighborhood by using a least square method; Step S204, calculating the Gaussian curvature K and the average curvature H of the three-dimensional point cloud data based on the fitted local surface; Step S205, judging whether the Gaussian curvature K is greater than the threshold value Ky, if yes, giving a pre-warning of defect type 1, otherwise, proceeding to the next step; Step S206, judging whether the average curvature H is greater than the threshold value Hy, if yes, giving a pre-warning of defect type 2, otherwise, judging that the workpiece is qualified; Step S3, detecting the roughness of the surface of the workpiece and judging whether the workpiece is a qualified product; comprising: Step S301, setting a density threshold value My and a secondary polishing threshold value Dy; Step S302, segmenting the pre-processed three-dimensional point cloud data set into a plurality of segmentation regions, and calculating the density Mn of each segmentation region; Step S303, traversing all the segmentation region densities Mn and comparing them with the density threshold value My respectively, if Mn>My, marking the corresponding segmentation region as a rough region; Step S304, obtaining the number D of the rough regions and comparing it with the secondary polishing threshold value Dy, if D>Dy, judging that the workpiece is an unqualified product; otherwise, judging that the workpiece is a qualified product.
2. The 3D vision based workpiece surface defect detection and warning method according to claim 1, characterized in that, The removing noise comprises the following steps: Step S101, setting a radius threshold value r; Step S102, reading a point cloud data; Step S103, calculating the distance of the point cloud data from the neighborhood points; Step S104, comparing the distance of the point cloud data from the neighborhood points with the set radius threshold value r, if the distance of the neighborhood points >r, marking the neighborhood points as noise points and deleting them, otherwise, proceeding to step S105; Step S105, confirming whether all the point cloud data are traversed, if not, proceeding to step S102, otherwise, proceeding to step S106; Step S106, saving the filtered point cloud data.
3. The 3D vision based workpiece surface defect detection and warning method according to claim 1, wherein, The step S302 comprises: Step S3021, setting a distance threshold value Ly; Step S3022, randomly selecting a point in the central region of the polished workpiece as a seed point, the density Mn of the seed point being initially set as 0, n being the seed point number; Step S3023, searching for neighboring points in the neighborhood of the seed point based on the set distance threshold value Ly, and measuring the distance L between the neighboring points and the seed point; Step S3024, if the distance L < distance threshold Ly, the density Mn of the seed point is added by 1, the adjacent point is classified into the same class as the seed point and is marked with the same segmentation region; otherwise, other adjacent points in the neighborhood of the seed point are selected, and the process returns to step S3023 until all adjacent points in the neighborhood of the seed point are traversed, and the process returns to step S3025; Step S3025, points outside the marked segmentation region are taken as new seed points, and the process returns to step S3022 until all seed points in the center region of the polishing workpiece are traversed.
4. The 3D vision based workpiece surface defect detection and warning method according to claim 1, characterized in that, The enhanced preprocessing process comprises: calculating a gray value histogram; calculating a cumulative gray histogram; merging the cumulative gray histogram to the nearest gray value; calculating a new histogram.
Citation Information
Patent Citations
Metal surface fine defect detection method based on vision
CN109523541A
Large equipment surface defect positioning and measuring method based on image and point cloud combination
CN117952904A