Workpiece surface flaw detection method and device

By collecting point cloud data and planar images of the steel plate surface, and fitting plane equations using neighboring points, defect areas can be judged and identified. This solves the problems of high detection accuracy and large computational load in existing technologies, and achieves efficient and accurate defect detection.

CN115980063BActive Publication Date: 2026-02-13CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211728869.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-02-13
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing technologies for detecting defects on steel plate surfaces suffer from low detection accuracy and high computational load. In particular, the accuracy is low when using image data alone, and the computational load is high when using point cloud data alone, making it difficult to meet real-time requirements.

Method used

The system collects surface point cloud data and planar images of the workpiece to be inspected. By selecting neighboring points and fitting the plane equation, the distance between the location point and the plane equation is calculated to determine whether the area is a smooth area or a potential defect area. The system then locates and identifies the defect distribution in the planar image.

Benefits of technology

It improves detection accuracy, reduces computational load, avoids complex point cloud data processing, improves detection efficiency, and ensures that no defective areas are missed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115980063B_ABST
    Figure CN115980063B_ABST
Patent Text Reader

Abstract

The application provides a workpiece surface flaw detection method and device, which comprises the following steps: collecting point cloud data and a plane image of the surface of a workpiece to be detected; selecting m adjacent points around a current detection position point in the point cloud data to form a point set, fitting a plane equation according to the coordinate values of the point set, and calculating the distance between the coordinate values of the current detection position point and the plane equation; when the distance is less than or equal to a preset threshold, determining that the region formed by the point set corresponding to the current detection position point is a smooth region; when the distance is greater than the preset threshold, intercepting the region corresponding to the point set in the plane image as a flaw potential region, with the coordinate values of the current detection position point as the center; and positioning and identifying the surface flaw condition of the flaw potential region. The workpiece surface flaw detection method and device provided by the application can solve the problems of low detection accuracy of image data alone and high calculation amount of point cloud data alone in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of workpiece surface flaw detection, in particular to a workpiece surface flaw detection method and device. BACKGROUND

[0002] The surface quality of a steel plate is one of the main indicators of steel quality. During the production of a steel plate, due to the influence of many technical factors such as raw materials, rolling process, system control, etc., cracks, scarring, holes, skin delamination, color spots, pitting and other defects often occur on the surface of the steel plate, which have different degrees of influence on the main characteristics of the steel plate such as wear resistance, fatigue resistance, corrosion resistance and electromagnetic properties.

[0003] In the production process, for a long time, the identification of defects on the surface of a steel plate has been completed by manual visual inspection. This method is labor-intensive and prone to missed detection and false detection. With the increase in production speed, visual inspection has become difficult to achieve the purpose of detection and has gradually evolved into a form of sampling inspection. In the process of intelligent manufacturing transformation of enterprises, detection methods based on machine vision are emerging.

[0004] In existing machine vision detection technology, for the surface flaw detection of a steel plate, there are two technical approaches: 2D machine vision and 3D machine vision. Among them, 2D machine vision collects images and detects flaws based on color information on the surface of the steel plate. However, due to the small color variation on the surface of the steel plate, the accuracy of flaw detection is low. The existing 3D machine vision detection technology involves a large amount of calculation of coordinate information, which requires high hardware resource investment for data processing and detection reasoning to meet the real-time requirements in the actual production process. SUMMARY

[0005] The present application aims to at least solve one of the technical problems existing in the prior art, and proposes a workpiece surface flaw detection method and device, which can solve the problems of low detection accuracy when using image data alone and high calculation amount when using point cloud data alone in the prior art.

[0006] To achieve the above-mentioned purpose, the present application provides a workpiece surface flaw detection method, comprising:

[0007] Collecting point cloud data and planar images of the surface of a workpiece to be detected;

[0008] Selecting m adjacent points around a position point to be detected in the point cloud data to form a point set, and fitting a plane equation according to the coordinate values of the point set, m being an integer greater than 3;

[0009] Calculating the distance between the coordinate value of the position point to be detected and the plane equation;

[0010] determining that the region formed by the point set corresponding to the current detected position point is a smooth region when the distance is less than or equal to a preset threshold value;

[0011] cutting, as a flaw potential region, a region corresponding to the point set formed by the position point from the planar image when the distance is greater than the preset threshold value;

[0012] locating and identifying a surface flaw condition of the flaw potential region to obtain a flaw distribution of the flaw potential region.

[0013] Optionally, the selecting m neighboring points around the current detected position point in the point cloud data to form a point set and fitting a plane equation according to coordinate values of the point set comprises:

[0014] selecting 3 neighboring points as initial points from the m neighboring points and substituting coordinate values of the 3 neighboring points into the plane equation to obtain a first plane function;

[0015] substituting coordinate values of the remaining neighboring points except the 3 initial points into the first plane function to obtain a number of neighboring points falling into the first plane function and a sum of distances between coordinate values of the neighboring points not falling into the first plane function and the first plane function;

[0016] determining whether all the m neighboring points fall into the first plane function, if yes, taking the first plane function as the plane equation, if no, determining whether all the neighboring points have been selected, if yes, selecting a plane function with the most neighboring points and the smallest sum of distances as the plane equation, if not, returning to the step of selecting 3 initial points from the m neighboring points to select another 3 neighboring points as initial points.

[0017] Optionally, the selecting m neighboring points around the current detected position point in the point cloud data to form a point set and fitting a plane equation according to coordinate values of the point set comprises:

[0018] selecting 3 neighboring points as initial points from the m neighboring points and substituting coordinate values of the 3 neighboring points into the corresponding plane equation to obtain a first plane function;

[0019] substituting coordinate values of the remaining neighboring points except the 3 initial points into the first plane function to obtain a number of neighboring points falling into the first plane function and a sum of distances between coordinate values of the neighboring points not falling into the first plane function and the first plane function;

[0020] Selecting 3 neighboring points from the m neighboring points except the 3 initial points as reference points, substituting into the plane equation, and calculating a second plane function;

[0021] Calculating the number of neighboring points falling into the second plane function and the sum of distances between the neighboring points not falling into the second plane function and the second plane function;

[0022] Judging whether all the m neighboring points fall into the second plane function, if yes, taking the second plane function as the plane equation; if no, judging whether all the neighboring points are selected, if yes, selecting the plane function with the most neighboring points and the smallest sum of distances as the plane equation; if not, returning to execute the step of selecting 3 initial points from the m neighboring points, and selecting another 3 neighboring points as initial points.

[0023] Optionally, the positioning and identification of the surface flaw condition of the flaw potential area to obtain the flaw distribution of the flaw potential area comprises:

[0024] Enhancing the contrast between the flaw potential area and the surrounding area thereof;

[0025] Positioning and identifying the surface flaw condition of the enhanced flaw potential area to obtain the flaw distribution of the flaw potential area.

[0026] Optionally, the four corner coordinate values of the boundary of the flaw potential area in the plane image are min(x i ×△x), max(x i ×△x), min(y i ×△y) and max(y i ×△y), wherein i = 1, 2, …, m; x i and y i are the coordinate values of the ith neighboring point on the x-axis and y-axis respectively, the x-axis is parallel to the conveying direction of the surface of the workpiece to be detected; the y-axis is perpendicular to the surface of the workpiece to be detected; △x and △y are the resolution coefficients of x i and y i mapped into the plane image respectively.

[0027] As another technical solution, the application further provides a workpiece surface flaw detection device, comprising:

[0028] A collection module for collecting point cloud data and a plane image of the surface of a workpiece to be detected;

[0029] a fitting module configured to select m neighboring points around a current detected position point in the point cloud data to form a point set, and fit a plane equation according to coordinate values of the point set, where m is an integer greater than 3;

[0030] a calculating module configured to calculate a distance between the coordinate values of the current detected position point and the plane equation;

[0031] a judging module configured to determine that the region formed by the point set corresponding to the current detected position point is a smooth region when the distance is less than or equal to a preset threshold, and intercept a region corresponding to the point set formed by the current detected position point as a flaw potential region in the planar image when the distance is greater than the preset threshold;

[0032] a recognizing module configured to position and recognize surface flaw conditions of the flaw potential region to obtain flaw distribution of the flaw potential region.

[0033] Optionally, the fitting module comprises:

[0034] a first calculating unit configured to select three neighboring points from the m neighboring points as initial points, and substitute the initial points into the corresponding plane equation to obtain a first plane function;

[0035] a second calculating unit configured to substitute the remaining neighboring points except the three initial points from the m neighboring points into the first plane function to obtain a number of neighboring points falling into the first plane function, and a sum of distances between coordinate values of neighboring points not falling into the first plane function and the first plane function;

[0036] a judging unit configured to judge whether all the m neighboring points fall into the first plane function, if yes, the first plane function is taken as the plane equation; if no, it is judged whether all the neighboring points have been selected, if yes, a plane function with the largest number of neighboring points and the smallest sum of distances is selected as the plane equation; if not, the step of selecting three initial points from the m neighboring points is returned to select another three initial points.

[0037] Optionally, the fitting module comprises:

[0038] a first calculating unit configured to select three neighboring points from the m neighboring points as initial points, and substitute the initial points into the corresponding plane equation to obtain a first plane function;

[0039] a second calculation unit configured to substitute the remaining adjacent points except the three initial points in the m adjacent points into the first plane function, to obtain a number of adjacent points falling into the first plane function and a sum of distances between the coordinate values of the adjacent points not falling into the first plane function and the first plane function;

[0040] a third calculation unit configured to select three adjacent points except the three initial points in the m adjacent points as reference points, to substitute the reference points into the plane equation, and to obtain a second plane function;

[0041] a fourth calculation unit configured to obtain a number of adjacent points falling into the second plane function and a sum of distances between the coordinate values of the adjacent points not falling into the second plane function and the second plane function;

[0042] a judging unit configured to judge whether all the m adjacent points fall into the second plane function, if yes, the second plane function is taken as the plane equation; if no, it is judged whether all the adjacent points are selected, if yes, the plane function with the largest number of adjacent points and the smallest sum of distances is selected as the plane equation; if not, the step of selecting three initial points from the m adjacent points is returned to select another three adjacent points as initial points.

[0043] Optionally, the identification module comprises:

[0044] an enhancement unit configured to enhance the contrast between the flaw potential area and the surrounding area thereof;

[0045] an identification unit configured to position and identify the surface flaw condition of the enhanced flaw potential area to obtain the flaw distribution of the flaw potential area.

[0046] Optionally, the four corner coordinate values of the boundary of the flaw potential area in the plane image are min(x i ×△x), max(x i ×△x), min(y i ×△y) and max(y i ×△y), wherein i = 1, 2, …, m; x i and y i are the coordinate values of the ith adjacent point on the x-axis and the y-axis respectively, the x-axis is parallel to the conveying direction of the surface of the workpiece to be detected; the y-axis is perpendicular to the surface of the workpiece to be detected; △x and △y are the resolution coefficients of x i and y i mapped into the plane image respectively.

[0047] The present application has the following advantages:

[0048] In the technical scheme of the workpiece surface flaw detection method and device provided by the embodiment of the present application, the point cloud data and the planar image of the surface of the workpiece to be detected are collected, m adjacent points around the current detected position point in the point cloud data are selected to form a point set, a plane equation is fitted according to the coordinate values of the point set, the distance between the coordinate values of the current detected position point and the plane equation is calculated, and the distance is compared with a preset threshold value to determine whether the region formed by the point set corresponding to the current detected position point is a smooth region or a flaw potential region, so that the flaw potential region can be quickly calibrated by using the point cloud data, it is ensured that there is no omission of the flaw region, and the detection accuracy can be improved compared with the prior art in which only image data is used. At the same time, the surface flaw condition of the flaw potential region in the planar image is positioned and recognized to obtain the flaw distribution of the flaw potential region, the calculation amount can be reduced, and compared with the prior art in which only point cloud data is used, complex point cloud data processing can be avoided, so that the detection efficiency can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0049] Figure 1 The flowchart of the workpiece surface flaw detection method provided by the embodiment of the present application is shown in the figure.

[0050] Figure 2 The flowchart of step S2 of the workpiece surface flaw detection method provided by the embodiment of the present application is shown in the figure.

[0051] Figure 3 Another flowchart of step S2 of the workpiece surface flaw detection method provided by the embodiment of the present application is shown in the figure.

[0052] Figure 4 The flowchart of step S6 of the workpiece surface flaw detection method provided by the embodiment of the present application is shown in the figure.

[0053] Figure 5 The principle diagram of the workpiece surface flaw detection device provided by the embodiment of the present application is shown in the figure.

[0054] Figure 6 The principle diagram of the simulation module used in the embodiment of the present application is shown in the figure.

[0055] Figure 7 Another principle diagram of the simulation module used in the embodiment of the present application is shown in the figure.

[0056] Figure 8 The principle diagram of the recognition module used in the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0057] In order to make the objects, technical solutions and advantages of the present application clearer, the following further describes the present application with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application and not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0058] The shapes and sizes of the components in the drawings do not reflect true proportions and are only intended to facilitate the understanding of the content of the embodiments of the present application.

[0059] Unless otherwise defined, technical terms or scientific terms used in the present disclosure shall have the ordinary meaning understood by one of ordinary skill in the art to which the present disclosure pertains. The terms "first", "second", and similar terms used in the present disclosure do not denote any order, quantity, or importance, but are used to distinguish different components. Similarly, the terms "one", "a", or "the" and similar terms do not denote a quantity restriction, but mean that at least one exists. The terms "include", "comprise", and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connect" or "connected" and similar terms do not limit to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "upper", "lower", "left", "right", and the like are only used to represent relative positional relationships, and when the absolute positions of the described objects change, the relative positional relationships may also change accordingly.

[0060] The embodiments of the present disclosure are not limited to the embodiments shown in the drawings, but include modifications of configurations formed based on manufacturing processes. Therefore, the regions illustrated in the drawings have a schematic property, and the shapes of the regions shown in the drawings exemplify specific shapes of the regions of the elements, but are not intended to be restrictive.

[0061] Referring to Figure 1 The workpiece surface flaw detection method provided by the embodiments of the present application comprises:

[0062] S1, collecting point cloud data and a plane image of the surface of a workpiece to be detected;

[0063] The point cloud data is points(x, y, z), wherein the x value is a coordinate value corresponding to different positions of the surface of the workpiece to be detected in the conveying direction; the y value is a coordinate value corresponding to different positions on the longitudinal section (i.e., the section in the direction perpendicular to the surface of the workpiece to be detected) of the workpiece to be detected; and the z value is an elevation value (the distance of a point to an absolute base surface along the vertical direction) corresponding to different positions of the surface of the workpiece to be detected in the conveying direction.

[0064] The planar image is a two-dimensional image of the surface of the workpiece to be detected.

[0065] The workpiece to be detected is, for example, a steel plate or other workpiece whose surface needs to be detected for surface defects.

[0066] S2, m neighboring points around a currently detected position point in the point cloud data are selected to form a point set, and a planar equation is fitted according to coordinate values of the point set, m being an integer greater than 3;

[0067] The currently detected position point is an arbitrary point selected from all position coordinate points in the point cloud data. After defect detection on the position point is completed, another position point is reselected until all position coordinate points in the point cloud data are detected for defects.

[0068] The neighboring points refer to position points whose coordinates are adjacent to the coordinate of the currently detected position point. Taking m=8 as an example, the currently detected position point is located at the center of a square region, 4 of the 8 neighboring points are located at four corners of the square region, and the other 4 are located at midpoints of four sides of the square region. Of course, in actual application, m can also be equal to 4 or other quantities, and the embodiments of the present application do not have special limitations thereon.

[0069] The planar equation is Ax+By+Cz+D=0, wherein x, y, and z are coordinate values of each position point in the point cloud data, and A, B, and C are variables. According to the coordinate values of the point set, the values of A, B, and C can be calculated and obtained (D can be eliminated in the calculation process), and finally a planar function about x, y, and z is obtained.

[0070] S3, a distance between the coordinate value of the currently detected position point and the planar equation is calculated;

[0071] The distance can be obtained by substituting the coordinate value of the currently detected position point into the planar equation Ax+By+Cz+D=0. Specifically, the distance satisfies the following relationship:

[0072]

[0073] Wherein △d is the distance between the coordinate value of the currently detected position point and the planar equation; x0, y0, and z0 are the coordinate value of the currently detected position point.

[0074] S4, when the distance △d is less than or equal to a preset threshold thres, it is determined that a region formed by the point set corresponding to the currently detected position point is a smooth region.

[0075] S5, when the distance △d is greater than the preset threshold thres, a region in the planar image centered at the coordinate value of the currently detected position point and corresponding to the point set is intercepted as a defect potential region.

[0076] With the collected point cloud data, the coordinate values of the above-mentioned potential defect region in the above-mentioned planar image can be obtained, that is, the calibration of the potential defect region is quickly completed, and it is ensured that the defect region will not be missed, and the detection accuracy can be improved compared with the prior art which uses image data alone.

[0077] Taking m = 8 as an example, the above-mentioned potential defect region is a region defined by the boundary of 8 adjacent points. Specifically, the current detected position point is located at the center of the square region, 4 of the 8 adjacent points are located at the four corners of the square region, and the remaining 4 points are located at the midpoints of the four sides of the square region.

[0078] Optionally, considering the resolution of the planar image, the coordinate values of the above-mentioned current detected position point and the 8 adjacent points are multiplied by a resolution coefficient. For example, the x value of the above-mentioned current detected position point is multiplied by △x, and the y value is multiplied by △y.

[0079] In some optional embodiments, considering the resolution of the planar image, the four corner coordinate values of the boundary of the above-mentioned potential defect region in the planar image are respectively: min(x i ×△x), max(x i ×△x), min(y i ×△y) and max(y i ×△y), wherein i = 1, 2, …, m; x i and y i are the coordinate values of the ith adjacent point on the x axis and the y axis, respectively, the x axis is parallel to the conveying direction of the surface of the workpiece to be detected; the y axis is perpendicular to the surface of the workpiece to be detected; △x and △y are the resolution coefficients of x i and y i mapped into the planar image, respectively.

[0080] S6, positioning and identifying the surface defect condition of the potential defect region to obtain the defect distribution of the potential defect region.

[0081] The workpiece surface flaw detection method provided by the embodiment of the present application can quickly complete the calibration of the flaw potential area by using the point cloud data, and can ensure that the flaw area will not be missed, and can improve the detection accuracy compared with the prior art of using image data alone. At the same time, the surface flaw condition of the flaw potential area in the plane image is positioned and recognized to obtain the flaw distribution of the flaw potential area, which can reduce the amount of calculation, and compared with the prior art of using point cloud data alone, the complicated point cloud data processing can be avoided, and thus the detection efficiency can be improved.

[0082] In some optional embodiments, referring to Figure 2 The step S2 specifically includes:

[0083] S21, select 3 adjacent points from the m adjacent points as initial points, and substitute the coordinate values of the 3 adjacent points into the plane equation to obtain a first plane function by calculation;

[0084] Substituting the coordinate values of the 3 adjacent points into the plane equation can obtain the following equation group:

[0085]

[0086] Solving the equation group can obtain the plane function about x, y and z, i.e. the first plane function.

[0087] S22, substitute the coordinate values of the remaining adjacent points except the 3 initial points in the m adjacent points into the first plane function to obtain the number of adjacent points falling into the first plane function and the sum of distances between the coordinate values of the adjacent points not falling into the first plane function and the first plane function in the m adjacent points by calculation;

[0088] The distance between the coordinate values of the adjacent points not falling into the first plane function and the first plane function can be obtained by substituting the coordinate values of the adjacent points not falling into the first plane function into the plane equation Ax+By+Cz+D=0, and specifically, the distance satisfies the following relationship:

[0089]

[0090] Wherein, △d iis the distance between the coordinate value of the adjacent point not falling into the first plane function and the plane equation; x i ,y i ,z i is the coordinate value of the adjacent point not falling into the first plane function.

[0091] S23, judge whether all the m adjacent points fall into the first plane function, if yes, execute step S24; if not, execute step S25;

[0092] S24, take the first plane function as the plane equation;

[0093] S25, judge whether all the adjacent points have been selected, if yes, execute step S26; if not, return to step S21 and select another three adjacent points as initial points.

[0094] S26, select the plane function with the largest number of adjacent points and the smallest sum of distances as the plane equation.

[0095] That is, the steps S21 to S26 are executed in a loop, and when the next step S21 is executed, another three adjacent points are selected as initial points to obtain a new first plane function calculated by substituting the newly selected three adjacent points into the plane equation. After the steps S21 to S26 are executed in a loop for multiple times, multiple first plane functions can be obtained, each corresponding to a number of adjacent points and a sum of distances. The plane function with the largest number of adjacent points and the smallest sum of distances is selected from the first plane functions as the plane equation. Of course, if the m adjacent points all fall into the first plane function, the first plane function is directly taken as the plane equation without further looping.

[0096] In other optional embodiments, referring to Figure 3 , the step S2 specifically includes:

[0097] S21', select three adjacent points from the m adjacent points as initial points, and substitute the coordinate values of the three adjacent points into the corresponding plane equation to calculate a first plane function;

[0098] S22', substitute the coordinate values of the remaining adjacent points except the three initial points in the m adjacent points into the first plane function to calculate the number of adjacent points falling into the first plane function in the m adjacent points, and the sum of distances between the coordinate values of the adjacent points not falling into the first plane function and the first plane function;

[0099] S23', selecting 3 neighboring points other than the 3 initial points from the m neighboring points as reference points, substituting into the plane equation, and calculating a second plane function;

[0100] S24', calculating the number of neighboring points falling into the second plane function and the sum of distances between the neighboring points not falling into the second plane function and the second plane function;

[0101] S25', judging whether all the m neighboring points fall into the second plane function, if yes, executing step S26'; if no, executing step S27';

[0102] S26', taking the second plane function as the plane equation;

[0103] S27', judging whether all the neighboring points are selected, if yes, executing step S28'; if no, returning to execute step S21' to select another 3 neighboring points as initial points;

[0104] S28', selecting the plane function with the largest number of neighboring points and the smallest sum of distances as the plane equation.

[0105] That is, the steps S21' to S28' are executed in a loop, and when the next step S21' is executed, another 3 neighboring points are selected as initial points to obtain a new first plane function calculated by substituting the 3 newly selected neighboring points into the plane equation. After the steps S21' to S25' are executed in a loop for multiple times, multiple second plane functions can be obtained, each corresponding to a number of neighboring points and a sum of distances. The plane function with the largest number of neighboring points and the smallest sum of distances is selected from the second plane functions as the plane equation. Of course, if all the m neighboring points fall into the second plane function, the second plane function is directly taken as the plane equation without further iteration.

[0106] Compared with the steps S21 to S26, the steps S21' to S28' can calculate the optimal neighboring area plane function through exhaustive iteration, i.e., the plane function can most closely fit the current plane, thereby reducing the error of the defect area caused by introducing an incorrect / inappropriate plane. This advantage is more obvious when the number of neighboring points m is larger within a certain threshold range.

[0107] In some optional embodiments, referring to Figure 4 The step S6 specifically includes:

[0108] S61, enhancing the contrast between the defect potential area and its surrounding area;

[0109] For example, the contrast between the flaw potential region and its surrounding region can be enhanced by using a histogram enhancement process. The histogram enhancement process is a well-known technique in the art and will not be described here.

[0110] S62, positioning and identifying the surface flaw condition of the enhanced flaw potential region to obtain the flaw distribution of the flaw potential region.

[0111] In some optional embodiments, the flaw potential region can be analyzed based on a neural network model to obtain the surface flaw distribution of the workpiece to be detected.

[0112] As another technical solution, please refer to Figure 5 The embodiment of the present application provides a workpiece surface flaw detection device, comprising:

[0113] The acquisition module 1 is configured to acquire point cloud data and a plane image of the surface of the workpiece to be detected.

[0114] The fitting module 2 is configured to select m neighboring points around a position point to be detected in the point cloud data to form a point set, and fit a plane equation according to the coordinate values of the point set, where m is an integer greater than 3.

[0115] The calculation module 3 is configured to calculate the distance between the coordinate values of the position point to be detected and the plane equation.

[0116] The judgment module 4 is configured to determine that the region formed by the point set corresponding to the position point to be detected is a smooth region when the distance is less than or equal to a preset threshold, and intercept the region corresponding to the point set in the plane image as a flaw potential region when the distance is greater than the preset threshold.

[0117] The identification module 5 is configured to position and identify the surface flaw condition of the flaw potential region to obtain the flaw distribution of the flaw potential region.

[0118] In some optional embodiments, please refer to Figure 6 The fitting module 2 comprises:

[0119] The first calculation unit 21 is configured to select three neighboring points as initial points from the m neighboring points, and substitute the initial points into the corresponding plane equation to obtain a first plane function.

[0120] The second calculation unit 22 is configured to substitute the remaining neighboring points except the three initial points in the m neighboring points into the first plane function, to obtain the number of neighboring points in the m neighboring points falling into the first plane function, and the sum of the distances between the coordinate values of the neighboring points not falling into the first plane function and the first plane function.

[0121] The judging unit 23 is configured to judge whether all the m adjacent points fall into the first plane function, if yes, the first plane function is taken as the plane equation; if no, it is judged whether all the adjacent points are selected, if yes, the plane function with the largest number of adjacent points and the smallest sum of distances is taken as the plane equation; if no, the step of selecting 3 initial points from the m adjacent points is executed again, and other 3 adjacent points are selected as the initial points.

[0122] In some optional embodiments, referring to Figure 7 , the fitting module 2 comprises:

[0123] The first calculating unit 21 is configured to select 3 adjacent points from the m adjacent points as the initial points, and substitute the initial points into the corresponding plane equation to obtain the first plane function.

[0124] The second calculating unit 22 is configured to substitute the remaining adjacent points except the 3 initial points into the first plane function to obtain the number of adjacent points falling into the first plane function and the sum of distances between the coordinate values of the adjacent points not falling into the first plane function and the first plane function.

[0125] The third calculating unit 23 is configured to select 3 adjacent points except the 3 initial points from the m adjacent points as the reference points, substitute the reference points into the plane equation to obtain the second plane function.

[0126] The fourth calculating unit 24 is configured to obtain the number of adjacent points falling into the second plane function and the sum of distances between the coordinate values of the adjacent points not falling into the second plane function and the second plane function.

[0127] The judging unit 25 is configured to judge whether all the m adjacent points fall into the second plane function, if yes, the second plane function is taken as the plane equation; if no, it is judged whether all the adjacent points are selected, if yes, the plane function with the largest number of adjacent points and the smallest sum of distances is taken as the plane equation; if no, the step of selecting 3 initial points from the m adjacent points is executed again, and other 3 adjacent points are selected as the initial points.

[0128] In some optional embodiments, referring to Figure 8 , the identifying module 5 comprises:

[0129] The enhancing unit 51 is configured to enhance the contrast between the flaw potential area and the surrounding area thereof.

[0130] The identifying unit 52 is configured to locate and identify the surface flaw condition of the enhanced flaw potential area to obtain the flaw distribution of the flaw potential area.

[0131] In some optional embodiments, the four corner coordinate values of the boundary of the flaw potential region in the planar image are min(x i ×△x), max(x i ×△x), min(y i ×△y), and max(y i ×△y), where i = 1, 2, …, m; x i and y i are the coordinate values of the ith neighboring point in the x-axis and y-axis, respectively, the x-axis is parallel to the conveying direction of the surface of the workpiece to be detected, the y-axis is perpendicular to the surface of the workpiece to be detected, and △x and △y are the resolution coefficients of x i and y i when mapped into the planar image.

[0132] In summary, in the technical solutions of the workpiece surface flaw detection method and device provided by the embodiments of the present application, the point cloud data and the planar image of the surface of the workpiece to be detected are collected, m neighboring points around the current detection position point in the point cloud data are selected to form a point set, a plane equation is fitted according to the coordinate values of the point set, the distance between the coordinate values of the current detection position point and the plane equation is calculated, and the distance is compared with a preset threshold value to determine whether the region formed by the point set corresponding to the current detection position point is a smooth region or a flaw potential region, so that the flaw potential region can be quickly calibrated using the point cloud data, the flaw region is ensured not to be missed, and the detection accuracy can be improved compared with the prior art in which image data is used alone. Meanwhile, the surface flaw condition of the flaw potential region in the planar image is positioned and recognized to obtain the flaw distribution of the flaw potential region, the calculation amount can be reduced, the complicated point cloud data processing can be avoided compared with the prior art in which point cloud data is used alone, and the detection efficiency can be improved.

[0133] It can be understood that the above embodiments are only exemplary embodiments adopted to illustrate the principles of the present application, and the present application is not limited thereto. Various modifications and improvements can be made by those of ordinary skill in the art without departing from the spirit and essence of the present application, and these modifications and improvements are also considered to be within the protection scope of the present application.

Claims

1. A method for detecting surface defects in a workpiece, characterized in that, include: Collect point cloud data and planar images of the surface of the workpiece to be inspected; A point set is formed by selecting m neighboring points around the currently detected location point in the point cloud data, and a plane equation is fitted based on the coordinate values ​​of the point set, where m is an integer greater than 3. Calculate the distance between the coordinates of the currently detected location point and the plane equation; When the distance is less than or equal to a preset threshold, the region formed by the set of points corresponding to the currently detected location point is determined to be a smooth region; When the distance is greater than the preset threshold, the area formed by the coordinates of the currently detected location point and the corresponding point set in the planar image is extracted as the potential defect area. The surface defects in the potential defect area are located and identified to obtain the defect distribution in the potential defect area; Wherein, the four corner coordinates of the boundary of the potential defect region in the planar image are respectively: min(x i ×△x), max(x) i ×△x), min(y) i ×△y) and max(y i ×△y), where i=1,2,...,m; x i and y i Let be the coordinates of the i-th neighboring point on the x-axis and y-axis, respectively. The x-axis is parallel to the conveying direction of the surface of the workpiece to be inspected; the y-axis is perpendicular to the surface of the workpiece to be inspected; Δx and Δy are the coordinates of x and y, respectively. i and y i Resolution coefficients mapped onto the planar image.

2. The method for detecting surface defects in a workpiece according to claim 1, characterized in that, The step of selecting m neighboring points around the currently detected location point in the point cloud data to form a point set, and fitting a plane equation based on the coordinate values ​​of the point set, includes: Select 3 neighboring points from the m neighboring points as initial points, and substitute the coordinate values ​​of the 3 neighboring points into the plane equation to calculate the first plane function; Substitute the coordinates of the remaining neighboring points (excluding the three initial points) among the m neighboring points into the first plane function to calculate the number of neighboring points that fall into the first plane function and the sum of the distances between the coordinates of the neighboring points that do not fall into the first plane function and the first plane function. Determine whether all m neighboring points fall within the first plane function. If so, use the first plane function as the plane equation. If not, determine whether all neighboring points have been selected. If all have been selected, select the plane function with the most neighboring points and the smallest sum of distances as the plane equation. If not all have been selected, return to the step of selecting 3 initial points from the m neighboring points and reselect another 3 neighboring points as initial points.

3. The method for detecting surface defects in a workpiece according to claim 1, characterized in that, The step of selecting m neighboring points around the currently detected location point in the point cloud data to form a point set, and fitting a plane equation based on the coordinate values ​​of the point set, includes: Select 3 neighboring points from the m neighboring points as initial points, and substitute the coordinate values ​​of the 3 neighboring points into the corresponding plane equation to calculate the first plane function; Substitute the coordinates of the remaining neighboring points (excluding the three initial points) among the m neighboring points into the first plane function to calculate the number of neighboring points that fall into the first plane function and the sum of the distances between the coordinates of the neighboring points that do not fall into the first plane function and the first plane function. Select three neighboring points from the m neighboring points, excluding the three initial points, as reference points, substitute them into the plane equation, and calculate to obtain the second plane function; The number of neighboring points among the m neighboring points that fall into the second plane function is calculated, and the sum of the distances between the coordinates of the neighboring points that do not fall into the second plane function and the second plane function is calculated. Determine whether all m neighboring points fall within the second plane function. If so, use the second plane function as the plane equation. If not, determine whether all neighboring points have been selected. If all neighboring points have been selected, select the plane function with the most neighboring points and the smallest sum of distances as the plane equation. If not all neighboring points have been selected, return to the step of selecting 3 initial points from the m neighboring points and reselect another 3 neighboring points as initial points.

4. The method for detecting surface defects of a workpiece according to any one of claims 1-3, characterized in that, The step of locating and identifying surface defects in the potential defect area to obtain the defect distribution in the potential defect area includes: Enhance the contrast between the potential defect area and its surrounding area; The surface defects in the enhanced potential defect area are located and identified to obtain the defect distribution in the potential defect area.

5. A workpiece surface defect detection device, characterized in that, include: The acquisition module is used to acquire point cloud data and planar images of the surface of the workpiece to be inspected; The fitting module is used to select m neighboring points around the currently detected location point in the point cloud data to form a point set, and to fit a plane equation based on the coordinate values ​​of the point set, where m is an integer greater than 3. The calculation module is used to calculate the distance between the coordinates of the currently detected location point and the plane equation; The judgment module is used to determine that when the distance is less than or equal to a preset threshold, the region formed by the set of points corresponding to the currently detected location point is a smooth region; when the distance is greater than the preset threshold, it extracts the region in the planar image centered on the coordinates of the currently detected location point and corresponding to the set of points as a potential defect region; the four corner coordinates of the boundary of the potential defect region in the planar image are respectively: min(x i ×△x), max(x) i ×△x), min(y) i ×△y) and max(y i ×△y), where i=1,2,...,m; x i and y i Let be the coordinates of the i-th neighboring point on the x-axis and y-axis, respectively. The x-axis is parallel to the conveying direction of the surface of the workpiece to be inspected; the y-axis is perpendicular to the surface of the workpiece to be inspected; Δx and Δy are the coordinates of x and y, respectively. i and y i Resolution coefficients mapped onto the planar image; The identification module is used to locate and identify the surface defects in the potential defect area to obtain the defect distribution in the potential defect area.

6. The workpiece surface defect detection device according to claim 5, characterized in that, The fitting module includes: The first calculation unit is used to select 3 neighboring points from the m neighboring points as initial points, and substitute them into the corresponding plane equation to calculate the first plane function; The second calculation unit is used to substitute the remaining neighboring points (excluding the three initial points) among the m neighboring points into the first plane function, and calculate the number of neighboring points that fall into the first plane function, and the sum of the coordinate values ​​of the neighboring points that do not fall into the first plane function and the distance between them and the first plane function. The judgment unit is used to determine whether all m neighboring points fall into the first plane function. If so, the first plane function is used as the plane equation. If not, it determines whether all neighboring points have been selected. If all have been selected, the plane function with the most neighboring points and the smallest sum of distances is selected as the plane equation. If not all have been selected, the unit returns to the step of selecting 3 initial points from the m neighboring points and selects another 3 neighboring points as initial points.

7. The workpiece surface defect detection device according to claim 5, characterized in that, The fitting module includes: The first calculation unit is used to select 3 neighboring points from the m neighboring points as initial points, and substitute them into the corresponding plane equation to calculate the first plane function; The second calculation unit is used to substitute the remaining neighboring points (excluding the three initial points) among the m neighboring points into the first plane function, and calculate the number of neighboring points that fall into the first plane function, and the sum of the coordinate values ​​of the neighboring points that do not fall into the first plane function and the distance between them and the first plane function. The third calculation unit is used to select three neighboring points from the m neighboring points, excluding the three initial points, as reference points, and substitute them into the plane equation to calculate the second plane function; The fourth calculation unit is used to calculate the number of neighboring points among the m neighboring points that fall into the second plane function, and the sum of the distances between the coordinates of the neighboring points that do not fall into the second plane function and the second plane function; The judgment unit is used to determine whether all m neighboring points fall into the second plane function. If so, the second plane function is used as the plane equation. If not, it determines whether all neighboring points are selected. If all are selected, the plane function with the most neighboring points and the smallest sum of distances is selected as the plane equation. If not all are selected, the unit returns to the step of selecting 3 initial points from the m neighboring points and selects another 3 neighboring points as initial points.

8. The workpiece surface defect detection device according to any one of claims 5-7, characterized in that, The identification module includes: An enhancement unit is used to enhance the contrast between the potential defect area and its surrounding area. The identification unit is used to locate and identify the surface defects in the enhanced defect potential area to obtain the defect distribution in the defect potential area.

Citation Information

Patent Citations

  • Method for detecting defects of suspension string of contact network

    CN109813722A

  • Defect detection algorithm based on line scanning spectrum confocal camera

    CN115222730A