Surface defect detection method, equipment and medium
By determining reference positioning points and fitting reference regions on complex curved surface structures, the problems of inaccurate boundary identification and depth measurement in existing defect detection technologies are solved, achieving efficient and accurate defect parameter identification and automated detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHINING 3D TECH CO LTD
- Filing Date
- 2025-11-24
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies suffer from poor boundary recognition accuracy, inaccurate depth measurement, and low automation when detecting surface defects in complex curved structures, making it difficult to achieve efficient and accurate defect parameter identification.
By acquiring the scanning model and reference positioning points of the workpiece to be inspected, the area to be inspected is determined. A subset of the scanned data is extracted and fitted with a defect-free reference area. The results are compared to determine the defect area and parameters. A spline surface fitting algorithm is used to reconstruct the local geometry and establish a local reference coordinate system for accurate inspection.
It improves the robustness and accuracy of defect detection, can accurately identify defect areas and their parameters in complex curved surface structures, and enhances detection efficiency and automation.
Smart Images

Figure CN121921246A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of defect detection technology, and in particular to a surface defect detection method, equipment and medium. Background Technology
[0002] In fields such as precision manufacturing, the integrity of a product's surface is directly related to its structural safety and performance. External impacts, friction, or other contact can easily cause local defects on the product surface, making the detection and evaluation of these defects crucial.
[0003] Currently, methods for detecting and evaluating surface defects include manual inspection, 3D scanning-based inspection, and finite element simulation-assisted analysis. However, these methods have significant limitations when applied to curved structures, such as poor boundary recognition accuracy and inaccurate depth measurement. Summary of the Invention
[0004] According to one aspect of the embodiments of this disclosure, a surface defect detection method is provided, comprising: Obtain the scanning model corresponding to the workpiece to be inspected and multiple reference positioning points on the scanning model; One or more regions to be detected are determined based on the plurality of reference positioning points; Extract one or more scan subsets related to the one or more regions to be detected from the scan model; Fit the one or more scan subsets to obtain one or more defect-free reference regions; and The one or more scan subsets are compared with the one or more reference regions to determine the defect regions in the one or more scan subsets and the defect parameters of the defect regions.
[0005] According to another aspect of the embodiments of this disclosure, an electronic device is also provided, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the above method.
[0006] According to another aspect of the present disclosure, a computer-readable storage medium is also provided, the storage medium storing a computer program for performing the above-described method.
[0007] The technical solution provided in this disclosure has the following advantages: This technical solution determines the area to be inspected based on reference positioning points, enabling defect detection in curved areas. By extracting a scan subset corresponding to the area to be inspected and then fitting it with a defect-free, ideal reference area, the reference area is concentrated only within the area to be inspected, resulting in high fitting efficiency and freedom from interference from other areas of the workpiece. Furthermore, since the reference area is based on the scan subset, it is an ideal model constructed from real scan data, objectively and accurately describing the ideal geometry of the local area to be inspected. Moreover, by comparing the scan subset with the reference area, defect areas and defect parameters can be more accurately determined, improving the robustness and accuracy of defect area and parameter detection. Attached Figure Description
[0008] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0009] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1A This is a schematic diagram of the structure of a scanning device according to an embodiment of this disclosure; Figure 1B This is a flowchart of a surface defect detection method according to an embodiment of the present disclosure; Figure 2A This is a schematic reference diagram of a workpiece to be inspected according to an embodiment of this disclosure; Figure 2B This is a schematic reference diagram of another workpiece to be inspected according to an embodiment of this disclosure; Figure 3 This is a flowchart of another surface defect detection method according to an embodiment of this disclosure; Figure 4 This is a schematic diagram of the surface defect detection device described in an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the structure of the electronic device described in an embodiment of this disclosure. Detailed Implementation
[0011] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0012] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0013] In fields such as precision manufacturing, product surfaces may suffer defects such as localized dents, cracks, and scratches due to external forces during manufacturing or use. Although these defects are small in area, they often require rigorous evaluation and repair because they can cause localized stress concentrations or changes in aerodynamic characteristics. Currently, technologies for the detection and evaluation of surface defects include manual inspection, 3D scanning-based inspection, and finite element simulation-assisted analysis.
[0014] Manual inspection refers to visually determining the location, depth, and area of defects using tools such as calipers, depth gauges, and soft templates. This method is inefficient, highly dependent on the operator's subjective experience, and results in poor reproducibility and strong subjectivity. When dealing with curved surfaces, such as complex curved surfaces or structures with hidden areas, measurement accuracy cannot be guaranteed, and measurement errors are prone to occur; moreover, it has poor repeatability and is difficult to meet the requirements of digital inspection and maintenance compliance.
[0015] 3D scanning-based detection refers to the non-contact digital acquisition of 3D point cloud data of component surfaces using 3D scanners such as laser 3D scanners and structured light scanners, and then using algorithms such as CAD model comparison or elevation difference analysis to identify defects based on the 3D point cloud data. This method has the following problems: (1) It is mostly based on elevation difference judgment with a fixed threshold, which is difficult to adapt to complex scenarios where the curved surface itself has large undulations, tilts or curvature changes. It is easy to lead to inaccurate extraction of defect area boundaries, or even misidentification of natural surface changes as defects, resulting in false detection or false detection. (2) On the actual component surface, defects are often located in complex free-form or hyperboloid regions; however, 3D scanning-based detection usually uses fixed neighborhood plane fitting or reference global model to calculate the depth of the depression. When there is local warping or noise, it is easily affected by local undulations or scanning errors, especially in areas with large curvature or free-form surfaces, where the calculation of defect depth is not accurate enough. (3) It can only output the three-dimensional coordinates of the extreme points of defects (such as the lowest point of the depression or the centroid) in the scanning coordinate system. It lacks the connection with the CAD model or the local geometry of the component and cannot map the defect location back to the component CAD model or local coordinate system. This results in a lack of standardized description of the defect location, making it difficult to locate in subsequent maintenance. (4) In the process of judging traditional defect parameters (such as area, volume, boundary contour, axis of symmetry, etc.), a lot of manual intervention or semi-automatic tools are still required, resulting in low detection efficiency, poor repeatability, and difficulty in deployment in online detection or intelligent terminal equipment. The degree of automation is low.
[0016] Finite element simulation-assisted analysis refers to the use of finite element models to simulate and assess the impact of defects on structural strength in demanding scenarios, after obtaining the geometric morphology of defects. This process is computationally resource-intensive, complex, and time-consuming. Therefore, this method is only suitable for later-stage evaluation and cannot meet the urgent needs of rapid defect identification and handling in production or maintenance settings.
[0017] Furthermore, in practical applications, inspection platforms vary widely, including portable scanners, industrial robots, and online vision systems, with significant differences in hardware resources and operating environments. Traditional defect detection algorithms are often computationally intensive and complex, making them unsuitable for deployment in embedded systems or field terminals. Therefore, it is also necessary to consider the lightweight and efficient implementation of defect detection methods to ensure their practicality and engineering feasibility.
[0018] It is evident that there is still a lack of universal and robust solutions for intelligent, standardized, and high-precision parameter detection of defects, especially in complex curved surface structures, where it is crucial to automatically and accurately identify defect parameters.
[0019] Based on this, embodiments of this disclosure provide a surface defect detection method, device, and medium. This disclosure is used for high-precision, automated identification and geometric parameter extraction of defects such as dents, cracks, and scratches on the surface of planar or curved components, thereby improving the accuracy and efficiency of structural defect assessment.
[0020] Figure 1 is a flowchart of a surface defect detection method provided in an embodiment of this disclosure. This method can be applied to situations such as precision manufacturing where surface defects need to be detected. The surface defect detection can be performed by a surface defect detection device, which can be implemented using software and / or hardware, specifically, for example, an electronic device or a server. The electronic device can include a scanning device, such as a scanning device with or without a display screen, and can also include a computing device connected to the scanning device, such as a tablet computer, desktop computer, laptop computer, or smartphone.
[0021] Figure 1AA schematic diagram of an exemplary scanning device 10 is shown. In the depicted embodiment, the scanning device 10 includes a frame structure 20 and an imaging module 30 located within the frame structure 20. The imaging modules 30 may be arranged side-by-side such that the fields of view of each imaging module at least partially overlap. In some embodiments, the imaging module 30 may include three cameras: a first camera 31, a second camera 32, and a third camera 34. The imaging module 30 may also include a light projector 33, which may include a light source, a collimating lens, and diffractive optical elements. The light source is configured to emit a light beam toward the lens. The light beam, collimated by the collimating lens, propagates to the diffractive optical elements, which replicate the focused light beam to form a speckle pattern or fringe pattern and project it toward the scanned object / area. The speckle image or fringe pattern is reflected back from the scanned object / area and acquired by the imaging module 30 for further processing by a processing chip (not shown) to obtain three-dimensional information of the scanned object / area. In other embodiments, the light projector 33 may be an image projector, such as a digital micromirror device, a liquid crystal display projector, or an organic electroluminescent display projector.
[0022] In some embodiments, the light projector 33 may include a single light source, such as a light source emitting infrared light, white light, blue light, or other visible monochromatic light. In other embodiments, the light projector 33 is configured to emit light with wavelengths between 405 nm and 1100 nm. In still other embodiments, the light projector 33 may include two or three identical light sources, such as two or three light sources emitting infrared light. Alternatively, the light projector 33 may include two or three different light sources, such as a first light source emitting infrared light and a second light source emitting white light, or a first light source emitting infrared light, a second light source emitting white light, and a third light source emitting blue light. The two or three identical light sources may be part of the same light projector 33 or may be implemented as separate units (e.g., in an additional light projector unit), and similarly, the two or three different light sources may be part of the same light projector 33 or may be implemented as separate units (e.g., in an additional light projector unit).
[0023] In some embodiments, the imaging module 30 may also include another light projector (not shown), such as a speckle pattern projector, a stripe pattern projector, or an image projector.
[0024] The first camera 31 and the third camera 34 are typically monochrome (e.g., black and white) cameras, and their types will depend on the type of light source(s) used in the light projector(s) 33. In some embodiments, the first camera 31 and the third camera 34 may be monochrome, visible spectrum, or near-infrared cameras, and the light projector 33 may be an infrared or near-infrared light projector. The first camera 31 and the third camera 34 may use any suitable shutter technology, including but not limited to rolling shutters, global shutters, mechanical shutters, and optical liquid crystal display (LCD) shutters. In some embodiments, the second camera 32 may be a color camera (also referred to as a texture camera). The texture camera may use any suitable shutter technology, including but not limited to rolling shutters, global shutters, mechanical shutters, and optical liquid crystal display (LCD) shutters. In some embodiments, the first camera 31, the second camera 32, and the third camera 34 may have similar configurations to improve matching confidence and speed. In other embodiments, the imaging module 30 may also include a fourth camera, such that the scanning device includes three monochrome cameras and one color camera. In a further embodiment, the imaging module can also use a single camera to capture reflected light and color textures, omitting a second (and third and / or fourth) camera.
[0025] like Figure 1A As shown, a first camera 31, a second camera 32, a light projector 33, and a third camera 34 can be arranged side-by-side on one surface of the frame structure 20, spaced apart from each other, and all facing directly forward of the surface. In some examples, the first camera 31 has a first field of view facing the front region of the surface, the second camera 32 has a second field of view facing the front region of the surface, the third camera 34 has a third field of view facing the front region of the surface, and the light projector 33 has a projected field of view facing the front region of the surface. In some examples, the first field of view and the projected field of view at least partially overlap, the second field of view and the projected field of view at least partially overlap, the third field of view and the projected field of view at least partially overlap, and the first field of view, the second field of view and the third field of view at least partially overlap.
[0026] A data connection (such as USB, serial communication connection) between the scanning device 10 and one or more computer processors (not shown) allows the transmission of data collected by the first camera 31, the second camera 32, and the third camera 34, enabling it to be processed to derive 3D measurements of the surface of the scanned object / object. The one or more computer processors may be implemented in a remote computing system (electronic device), or alternatively, may be part of the scanning device 10 itself.
[0027] For example, light projector 33 includes a single light projector unit, or it may have two or more light projector units. The light projector unit can be configured to project visible or invisible light, coherent or incoherent light. In some embodiments, the light projector unit may include one or more light sources consisting of lasers (e.g., vertical cavity surface emitter (VCSEL), edge emitter (EEL), solid-state lasers, semiconductor lasers, and / or one or more LEDs (or OLEDs)).
[0028] A light projector unit can be configured to project a structured light pattern consisting of multiple light sheets arranged side-by-side. When the light sheets are projected onto the surface of an object, they can appear as elongated light stripes. These elongated light stripes are non-intersecting and, in some embodiments, can be substantially parallel to each other, while in others they can intersect each other. In some embodiments, the light sheets can also appear as dense dots or spots, such as a collection of dots or spots of different sizes. In some embodiments, the light projector unit can be a programmable light projector unit capable of projecting more than one light pattern. For example, the light projector unit can be configured to project different structured line patterns. In some embodiments, the light projector unit can emit light with wavelengths between 405 nm and 1100 nm.
[0029] In some examples, using a first camera 31 and a third camera 34, two images of an object can be captured simultaneously. Image processing can be applied, for example, to computational methods implemented by one or more processors, or to computational methods implemented, for example, by electronic devices, to derive 3D measurements of the surface of the scanned object / object.
[0030] In some examples, the second camera 32 can capture the texture of the object while the first camera 31 and the second camera 34 are capturing images of the object, and the texture can be applied to a computational method, for example, implemented by one or more processors, or to a computational method, for example, implemented by an electronic device, to map onto a 3D measurement of the surface of the scanned object / object.
[0031] In some examples, using a membrane / film with bandpass filter functionality fixed to the lens of a camera (e.g., first camera 31, second camera 32, third camera 34) can match the wavelength of the projector units (multiple), which can help reduce light source interference from ambient light and other projector units.
[0032] In some examples, a calibration plate, such as a piece or a set of calibration plates whose true geometric distance values have been measured in advance using high-precision methods such as photogrammetry, is used to measure the intrinsic and extrinsic parameters of the first camera 31, the second camera 32, and the third camera 34. The measurement process typically involves a series of continuous image acquisitions using the scanning device 10 after adjusting the calibration plate to different positions, and the calculation of the spatial position and orientation of the first camera 31, the second camera 32, and the third camera 34 by identifying the positions of reference (marked) points / regions / lines in the calibration images, thereby completing the calibration of the intrinsic and extrinsic parameters of the first camera 31, the second camera 32, and the third camera 34.
[0033] Next, see as follows Figure 1B As shown, the surface defect detection method may include the following steps S102 to S110.
[0034] S102, Obtain the scanning model corresponding to the workpiece to be inspected and multiple reference positioning points on the scanning model.
[0035] In this embodiment, under a global coordinate system, the surface of the workpiece to be inspected can be scanned in three dimensions using a scanning device such as those described above, to obtain three-dimensional point cloud data of the workpiece surface. The three-dimensional point cloud is then reconstructed to generate a scanning model corresponding to the workpiece. In one example, the scanning model is established based on the global coordinate system and is a dataset representing the geometric shape of the workpiece surface.
[0036] Taking laser scanning as an example, a 3D acquisition device can emit laser lines or gratings onto the surface of the workpiece to be inspected. By capturing the reflected signals and based on principles such as triangulation, 3D point cloud data of the workpiece surface can be obtained. A scanning model is then constructed from this 3D point cloud data. In this embodiment, for workpieces with complex curved surface structures, multiple reference positioning points can be determined on the scanning model through marking, visual guidance, or preset templates. These multiple reference positioning points have the same shape and size. The scanning model also includes multiple auxiliary positioning points, which are located at different positions on the scanning model than the reference positioning points and have different shapes and / or sizes.
[0037] In one specific approach, before scanning, multiple positioning marks can be set on the inspection area of the workpiece to be inspected by means of marking, visual guidance, or preset templates. These positioning marks are specifically such as highly reflective marking points or markers with specific geometric features.
[0038] In some examples, the reference positioning point is a circular point of a specific size that can be captured by the scanning device. It can be attached to the surface of the workpiece to be inspected, for example, by adhesive bonding, thereby dividing the surface of the workpiece to be inspected into one or more inspection areas.
[0039] For example, see Figure 2A As shown, a schematic reference diagram of a workpiece to be inspected according to an embodiment of this application is presented. It can be seen that the surface of the workpiece to be inspected has multiple reference positioning points. The reference positioning points facilitate the location of the defective area to be inspected.
[0040] In another example, such as Figure 2B As shown, the connecting lines formed by these reference positioning points are roughly parallel or orthogonal. In other words, the reference positioning points that can be fitted into a connecting line do not need to be perfectly located on this connecting line, but can be allowed to have a certain error, which can reduce the difficulty of attaching reference positioning points.
[0041] Based on this, when performing a 3D scan on the surface of the workpiece to be inspected, the positioning marks on the workpiece will appear clearly in the scanned model, and can thus be identified as reference positioning points.
[0042] In another specific approach, on the scanned model obtained after scanning, the operator can manually click on a set of points as reference positioning points through the software interface, based on the positions derived from the CAD model, such as those defined manually or by the machine, or based on the geometric features of the original scanned model (such as boundaries, edges, the center of known holes, etc.).
[0043] The spatial distribution of reference positioning points allows for the definition of reference directions and region positions within the desired inspection area on the scanned model. This enables the determination of local inspection areas on curved surfaces, such as complex surfaces, by using multiple reference positioning points on the scanned model, avoiding full-model defect detection and improving defect detection efficiency.
[0044] In another embodiment, the scanning model may further include multiple auxiliary positioning points, which are located at different positions on the scanning model than multiple reference positioning points and have different shapes and / or sizes compared to the multiple reference positioning points.
[0045] Considering that for large or structurally complex workpieces, global reference positioning points may not be able to effectively constrain the features of certain local areas. For example, setting global reference positioning points in a very regular manner may lead to the loss of tracking during the scanning process; or, during the inspection process, some reference positioning points may not be identified due to unexpected situations such as dirt or occlusion, affecting the robustness of the inspection.
[0046] To address the above issues, this embodiment adds auxiliary positioning points. In addition to the main reference positioning points, these auxiliary positioning points are additional marker points set on the workpiece to be inspected. By providing more usable spatial control points, the reference positioning points and the auxiliary positioning points distributed in various locations can be used simultaneously for calculation and tracking during the generation of the scanning model and the determination of the area to be inspected. This ensures the robustness of the inspection process and enhances the accuracy and reliability of the entire inspection process.
[0047] S104, determine one or more areas to be detected based on multiple reference positioning points.
[0048] As an example, one or more regions to be detected are rectangular regions.
[0049] This embodiment may include: First, determining the region to be detected based on the spatial distribution parameters of the positioning points; wherein the spatial distribution parameters include at least: direction and position. Specifically, for example: fitting a baseline based on the positioning points, using the baseline to represent the reference direction of the region to be detected; determining the bounding box of the region to be detected based on the position of the positioning points; and determining the region to be detected based on the above reference direction and bounding box.
[0050] It is understandable that the area to be inspected may have defects such as dents, cracks and scratches, or it may not have defects. Therefore, subsequent steps are performed to accurately determine the defects in the area to be inspected.
[0051] S106, Extract one or more scan subsets related to one or more regions to be detected from the scan model.
[0052] This embodiment can extract all three-dimensional meshes or three-dimensional data points corresponding to one or more three-dimensional meshes related to one or more areas to be detected from the scanning model, thereby obtaining one or more scanning subsets.
[0053] S108, Fit one or more scan subsets to obtain one or more defect-free reference regions.
[0054] On the surface of actual components, various defects such as dents and cracks may be located in planar or curved surfaces (e.g., complex freeform or hyperboloidal surfaces). In order to construct a reliable reference plane / surface and accurately detect and determine the defect parameters of the defect area, this embodiment can fit one or more defect-free reference areas based on one or more scan subsets.
[0055] In one embodiment, after obtaining a scan subset (such as a local point cloud of a constructed surface), a spline surface fitting algorithm can be used to reconstruct the plane / surface of the scan subset to obtain a defect-free, ideal reference region.
[0056] By employing a spline surface fitting algorithm to reconstruct the plane / surface of the scanned subset, the plane / surface can be accurately described. During the fitting process, potential defect anomalies are automatically identified and eliminated, and only the three-dimensional data points of the surrounding intact surface are used for calculation, thereby generating a smooth, continuous reference area that can represent the geometry of the scanned subset in a defect-free and ideal state. The reference area can provide a reliable reference surface for subsequent detection of defect areas and determination of defect parameters.
[0057] This embodiment transforms the analysis benchmark from a global plane / surface to an ideal reference region that perfectly matches the local plane / surface geometry by fitting a reference region. This reference region is concentrated only on the area to be detected, resulting in high fitting efficiency and is unaffected by interference from other areas of the workpiece. The reference region uses a subset of scan data as the fitting basis, making it an ideal model constructed from real scan data, capable of objectively and accurately describing the ideal geometry of the local area to be detected. Specifically, the reference region adaptively bends synchronously with changes in the curvature of the workpiece, while simultaneously eliminating defects such as dents and cracks on the workpiece surface, exhibiting a defect-free, ideal geometry.
[0058] S110, compare one or more scan subsets with one or more reference regions to determine the defect regions and defect parameters of the defect regions in one or more scan subsets.
[0059] This article uses a curved surface as an example for illustration, but this does not affect the application of the methods / steps / processes described herein to a planar surface. The implementation process of this embodiment can be referred to the following steps.
[0060] Identify initial defect regions in one or more scan subsets.
[0061] Determine the first distance between the three-dimensional data points related to the initial defect area and the reference area, wherein the first distance includes the normal distance or the perpendicular distance.
[0062] Taking the normal distance as an example: For each 3D data point P within the initial defect region, find the nearest point P′ or normal projection point P′ of that 3D data point P in the reference region. Calculate the vector from the 3D data point P in the initial defect region to the data point P′ in the reference region. Determine the normal distance corresponding to the 3D data point P based on this vector.
[0063] It is understandable that the normal distance can be negative, indicating that the 3D data point P is located below the reference area and may be a defect point. Calculating the normal distance can accurately reflect the defect depth along the normal of the surface and is not affected by the local surface tilt.
[0064] Furthermore, when the local curvature of the reference region is very small, the difference in the height coordinates of the 3D data point P in the initial defect region and the data point P′ in the reference region can be used as the distance. That is, the relative vertical distance corresponding to the 3D data point P is obtained by subtracting the height coordinates of the data point P′ in the reference region from the height coordinates of the 3D data point P in the initial defect region.
[0065] It is understandable that the relative vertical distance can be negative. A negative value indicates that the 3D data point P is located below the reference area, which may be a defect point.
[0066] Defect points are determined from the three-dimensional data points related to the initial defect region based on the first distance.
[0067] An embodiment may include: traversing all three-dimensional data points within the initial defect area, comparing the first distance of the three-dimensional data points with a preset parameter threshold range (such as less than 1 mm or other suitable values); and, based on the comparison result, marking all three-dimensional data points whose first distance is within the parameter threshold range as defect points.
[0068] Defect areas are determined based on defect points.
[0069] In this embodiment, the method of determining the defect region based on the defect points may include: performing region clustering on the defect points to determine the connected defect regions.
[0070] In one example, a clustering algorithm based on three-dimensional spatial neighborhood can be used to search for neighboring points within a preset clustering radius around each defect point, and connect the interconnected points to form a connected point cloud cluster. The point cloud cluster is then identified as the connected defect region.
[0071] Meanwhile, clustering algorithms can effectively filter out isolated noise points and identify multiple adjacent but independent defect regions, ensuring the accuracy and robustness of defect region boundary delineation. For example, when a region to be detected has multiple close defects, it can obviously be processed all at once instead of processing each defect individually. Clustering of nearby defects can effectively improve processing efficiency.
[0072] Some possible defect analysis methods based on 3D point clouds rely on simple elevation thresholds, which are difficult to adapt to scenarios where the surface itself has large undulations, tilts, or curvature changes. This can easily lead to inaccurate defect boundary extraction or even misidentification of natural surface variations as defects. This embodiment of the application, by fitting a reference region, transforms the analysis benchmark from an absolute global surface into an ideal reference region that perfectly fits the local surface geometry. This reference region can dynamically adapt to the local geometry of the workpiece under inspection, accurately reflecting its geometry. Based on this, the first distance determined in this embodiment can be the distance of each 3D data point relative to this ideal reference region. This means that regardless of whether the surface of the workpiece under inspection is flat, tilted, curved, or wavy, the basis for judging the defect region in this embodiment can be: whether a depression has occurred inside the reference region. This can eliminate the interference of different surface shapes (e.g., curved surfaces, ripples) on the detection of defect regions, improving the accuracy of defect region detection.
[0073] Furthermore, in the embodiment described above that determines the defect region on the target scanning sub-model based on the first distance, since the defect region is determined based on defect points whose first distance is within the parameter threshold range, the defect region is the area on the surface represented by the scanning subset where the distance between the defect region and the ideal reference region deviates negatively. The reference region already includes the overall curvature of the defect region. Based on this, this embodiment can accurately capture local geometric anomalies relative to the desired surface without misjudging large-scale surface changes as defects. This ensures that even on free-form surfaces (such as parts of a workpiece's surface exhibiting curvature), accurate defect regions can be extracted, improving the robustness of defect region detection.
[0074] Before step S108, fitting one or more scan subsets to obtain one or more defect-free reference regions, the method provided in this embodiment may further include: Multiple baselines are fitted based on multiple reference positioning points, where baselines belonging to the same detection area are orthogonal to each other; a reference coordinate system for the detection area is constructed using the baseline of the detection area; and the scan subset corresponding to the detection area is transformed from the global coordinate system to the reference coordinate system.
[0075] like Figure 3 As shown, it illustrates another surface defect detection method provided in one embodiment of this application, including the following steps: S202, Obtain the scanning model corresponding to the workpiece to be inspected and multiple reference positioning points on the scanning model.
[0076] S204, determine one or more areas to be detected based on multiple reference positioning points.
[0077] S206, Extract one or more scan subsets related to one or more regions to be detected from the scan model.
[0078] S208, which fits multiple baselines based on multiple reference positioning points, wherein the baselines belonging to the same detection area are orthogonal to each other.
[0079] In practical implementation, a two-dimensional plane can be fitted based on multiple reference positioning points. Each reference positioning point is projected onto the two-dimensional plane; within the projected two-dimensional plane, at least two mutually perpendicular straight lines are fitted according to the spatial distribution of the reference positioning points to obtain an orthogonal baseline. This baseline can be used to represent the direction of the area to be detected. The spatial distribution of the reference positioning points is such that a portion of the reference positioning points are arranged along a first direction, and another portion of the reference positioning points are arranged along a second direction perpendicular to the first direction.
[0080] In this embodiment, multiple baselines fitted based on reference positioning points are used to represent the reference direction of the region to be detected. The baselines can also represent the boundaries of the region to be detected; for example, boundaries parallel to the baselines can be defined on the original scanning model, thereby providing geometric constraints on the boundaries for determining the region to be detected.
[0081] S210, construct a reference coordinate system for the area to be detected using a baseline of the area to be detected.
[0082] After obtaining an orthogonal baseline through fitting, a reference coordinate system aligned with the local geometric features of the workpiece can be established using this baseline as a reference. This transforms a complex global problem into a regular local problem, eliminating the influence of the workpiece's orientation or the curvature of the surface itself on the detection results.
[0083] Specifically, the coordinate system established when scanning the workpiece to be inspected is the global coordinate system. The origin and direction of the global coordinate system can usually be determined based on, for example, the world coordinate system.
[0084] S212, transform the scan subset corresponding to the area to be detected from the global coordinate system to the reference coordinate system.
[0085] In a global coordinate system, it is inconvenient to directly perform local geometric inspection on the scanned model. Therefore, this embodiment constructs a local reference coordinate system based on a baseline, which can be aligned with the geometric features of the workpiece to be inspected. Furthermore, since the reference coordinate system is calculated based on the baseline in the global coordinate system, a definite rigid body transformation relationship exists between the reference coordinate system and the global coordinate system. Through this rigid body transformation relationship, any three-dimensional data point on the scanned model can be transformed from the global coordinate system to the reference coordinate system, and vice versa.
[0086] Transforming 3D data points from the global coordinate system to the reference coordinate system is equivalent to aligning and straightening the curved surface, making the subsequent detection of defect areas and determination of defect parameters simpler, more direct, and more accurate.
[0087] Based on the above embodiments, similar to the scanning model, the scanning subset is also data in the global coordinate system. In this embodiment, after extracting one or more scanning subsets related to one or more regions to be detected from the scanning model, the scanning subset corresponding to the regions to be detected is transformed from the global coordinate system to the reference coordinate system. Specifically, according to the rigid body transformation relationship between the reference coordinate system and the global coordinate system, each 3D data point in the scanning subset is transformed from the global coordinate system to the reference coordinate system; after the coordinate system transformation, the scanning subset in the reference coordinate system is obtained.
[0088] It can be understood that the initial data generated by the scanning device when scanning the area to be detected is located in a pixel coordinate system. After transformation between the pixel coordinate system, image coordinate system, camera coordinate system and world coordinate system, the initial data is transformed from the pixel coordinate system to the global coordinate system represented by the world coordinate system, thus obtaining the scanning model or scanning subset in the global coordinate system.
[0089] It is understandable that the scan subsets involved in subsequent steps are all data in the reference coordinate system.
[0090] S214, Fit one or more scan subsets to obtain one or more defect-free reference regions.
[0091] S216, compare one or more scan subsets with one or more reference regions to determine the defect regions and defect parameters of the defect regions in one or more scan subsets.
[0092] In this embodiment, the defect parameters of the defect region include, but are not limited to, at least one of the following: the defect center, length and width, center reference distance, edge reference distance, area of the defect region, center distance, minimum edge distance, depth and average depth.
[0093] The following examples describe how each defect parameter is determined.
[0094] In this embodiment, the defect parameter includes the defect center of the defect region; correspondingly, the method further includes: The defect center is determined based on the geometric center of the defect region or the point of maximum deformation; the coordinates of the defect center are transformed from the reference coordinate system to the global coordinate system.
[0095] It is understood that the defect center, determined based on the geometric center or the point of maximum deformation of the defect region, represents the position of the defect region in a local reference coordinate system. To achieve a standardized expression of the defect location, this embodiment can transform the coordinates of the aforementioned defect center from the reference coordinate system to the global coordinate system. The defect center of the defect region in the global coordinate system can be used to locate and mark the defect region on the scanned model.
[0096] Some possible defect detection schemes can output the 3D coordinates of the defect center in the global coordinate system, but they cannot map the defect back to the constructed CAD model or a local reference coordinate system, making subsequent maintenance difficult. This application's embodiments, based on the rigid transformation relationship between the reference coordinate system and the global coordinate system, flexibly transform the coordinate system of the defect center in the defect area. Either the defect center can be determined in the reference coordinate system, and then its coordinates can be transformed from the reference coordinate system to the global coordinate system; or the defect center can be determined in the global coordinate system, and then its coordinates can be transformed from the global coordinate system to the reference coordinate system. Through these coordinate system transformations, the defect center in the defect area can be expressed in a standard structural manner, thereby supporting structural integrity traceability and maintenance guidance.
[0097] In this embodiment, the defect parameters further include at least one of the following: length and width of the defect region, center reference distance, edge reference distance, area of the defect region, center distance, and minimum edge distance. Correspondingly, the method further includes: The length and width of the defect region are calculated based on the baseline of the region to be inspected corresponding to the defect region.
[0098] Alternatively, calculate the minimum center reference distance between the defect center and the baseline; that is, determine the distance between the defect center of the defect area and the nearest baseline to obtain the center reference distance.
[0099] Alternatively, calculate the minimum edge reference distance between the 3D data point at the boundary of the defect area and the baseline; that is, determine the distance between the 3D data point at the boundary of the defect area and the nearest baseline to obtain the edge reference distance.
[0100] Alternatively, a three-dimensional surface segment can be generated based on the three-dimensional data points at the boundary of the defect region, and the area of the defect region can be calculated based on the three-dimensional surface segment; specifically, a three-dimensional surface segment can be generated based on the three-dimensional data points at the boundary of the defect region; the total area of the three-dimensional surface segment can be determined, and the total area of the three-dimensional surface segment can be used as the area of the defect region.
[0101] Alternatively, calculate the distance between the center of each defect region and the center of the corresponding non-defect region of the region to be inspected.
[0102] Alternatively, calculate the minimum edge distance between 3D data points at the boundary of every two defect regions.
[0103] In this embodiment, the defect parameters also include at least one of the depth of the defect region and the average depth; correspondingly, the method further includes: Iterate through the first distances of all 3D data points within the defect region, and determine the maximum first distance as the depth of the defect region; or The average distance of the first distance of each three-dimensional data point within the defect area is determined as the average depth of the defect area.
[0104] In the above embodiments, all detected defect parameters, such as area, length, width, defect center, and center distance, are determined under a local reference coordinate system. This means that the defect parameters no longer depend on the global coordinate system during scanning, but are instead bound to the geometric features of the workpiece itself. The defect parameters have stable and consistent meaning under the reference coordinate system, and do not change due to the workpiece's orientation during scanning. Therefore, the defect parameters have clear physical meaning and good repeatability, facilitating comparison with CAD models and guiding subsequent maintenance positioning. This improves the standardization and traceability of defect parameters in engineering applications. Regardless of how the workpiece is positioned, as long as the reference positioning point is consistent, the detection results of the defect area and defect parameters will be consistent.
[0105] The methods provided in this disclosure may also include: The display interface shows the scanned model, defect area, and defect parameters; the display method includes at least one of the following: color coding, annotation map, and 3D image.
[0106] In this embodiment, when displaying the scanned model, defect area, and defect parameters on the display interface, a specific example is that the defect area and defect parameters of the defect area are displayed on the scanned model in a preset display mode; wherein, the display mode is such as color coding, annotation map, and 3D image, etc.
[0107] Specifically, this embodiment can output all defect parameters in a structured format and display them on the scanned model using color coding, annotation diagrams, or 3D images, making it easier for inspectors to quickly locate and evaluate defects.
[0108] Taking color coding as an example, a color spectrum with varying shades can be used to map defect areas based on their depth, making the severity of the defects more intuitive and visible. Furthermore, an overlay annotation function can be added to generate a marker with a leader line at the center of each defect area, dynamically displaying key defect parameters such as depth and average depth.
[0109] This embodiment displays the scanned model, defect area, and defect parameters on the display interface, enabling inspectors to quickly and intuitively locate each defect on the scanned model of the workpiece to be inspected and complete accurate evaluation without interpreting the original data, thus greatly improving work efficiency.
[0110] Furthermore, the surface defect detection method provided in the above embodiments can be integrated into various 3D scanning equipment and evaluation software systems in inspection production lines in fields such as precision manufacturing. It boasts a high degree of automation, supports batch analysis, multi-model switching, and customized parameter output, significantly improving detection efficiency and reducing manual intervention costs. This surface defect detection method has low computational complexity and is suitable for deployment in edge computing devices, embedded systems, and industrial field terminals.
[0111] In summary, the surface defect detection method provided in this disclosure includes: acquiring a scanning model corresponding to the workpiece to be inspected and multiple reference positioning points on the scanning model; determining one or more regions to be inspected based on the multiple reference positioning points; extracting one or more scanning subsets related to the one or more regions to be inspected from the scanning model; fitting one or more scanning subsets to obtain one or more reference regions without defects; and comparing one or more scanning subsets with one or more reference regions to determine defect regions and defect parameters of the defect regions in the one or more scanning subsets.
[0112] This technical solution determines the area to be inspected based on reference positioning points, enabling defect detection in curved areas. By extracting a scan subset corresponding to the area to be inspected and then fitting it with a defect-free, ideal reference area, the reference area is concentrated only within the area to be inspected, resulting in high fitting efficiency and freedom from interference from other areas of the workpiece. Furthermore, since the reference area is based on the scan subset, it is an ideal model constructed from real scan data, objectively and accurately describing the ideal geometry of the local area to be inspected. Moreover, by comparing the scan subset with the reference area, defect areas and defect parameters can be more accurately determined, improving the robustness and accuracy of defect area and parameter detection.
[0113] Applying the above solutions to precision manufacturing, high-end manufacturing, or other suitable mechanical manufacturing, design, and processing fields can provide workpieces with high-precision, automated, traceable, and integrable intelligent analysis solutions for defect geometric parameters, thereby significantly improving the ability to control manufacturing quality and ensure product reliability, effectively enhancing the level of intelligent industrial inspection, and meeting the high-precision and high-efficiency requirements for structural defect assessment in precision manufacturing, high-end manufacturing, or other suitable mechanical manufacturing, design, and processing fields.
[0114] Figure 4This is a schematic diagram of a surface defect detection device provided in an embodiment of the present disclosure. This device is used to implement a surface defect detection method provided in the above embodiment. Figure 4 As shown, the surface defect detection device may include the following modules.
[0115] Data acquisition module 310 is used to acquire the scanning model corresponding to the workpiece to be inspected and multiple reference positioning points on the scanning model; The region determination module 320 is used to determine one or more regions to be detected based on the plurality of reference positioning points; Subset extraction module 330 is used to extract one or more scan subsets related to the one or more regions to be detected from the scan model; Region fitting module 340 is used to fit the one or more scan subsets to obtain one or more defect-free reference regions; and The defect detection module 350 is used to compare the one or more scan subsets with the one or more reference regions to determine the defect regions in the one or more scan subsets and the defect parameters of the defect regions.
[0116] The device provided in this embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0117] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Figure 5 As shown, the electronic device 400 includes one or more processors 401 and memory 402.
[0118] The processor 401 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.
[0119] The memory 402 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may execute the program instructions to implement the surface defect detection method of the embodiments of this disclosure described above and / or other desired functions. Various contents such as input signals, signal components, and noise components may also be stored in the computer-readable storage medium.
[0120] In one example, the electronic device 400 may also include an input device 403 and an output device 404, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0121] In addition, the input device 403 may also include, for example, a keyboard, a mouse, etc.
[0122] The output device 404 can output various information to the outside, including determined distance information, direction information, etc. The output device 404 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0123] Of course, for the sake of simplicity, Figure 5 Only some of the components of the electronic device 400 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 400 may include any other suitable components depending on the specific application.
[0124] Furthermore, this embodiment also provides a computer-readable storage medium storing a computer program for executing the above-described surface defect detection method.
[0125] The computer program product of the surface defect detection method, apparatus, electronic device and medium provided in this disclosure includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0126] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0127] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting surface defects, comprising: Obtain the scanning model corresponding to the workpiece to be inspected and multiple reference positioning points on the scanning model; One or more regions to be detected are determined based on the plurality of reference positioning points; Extract one or more scan subsets related to the one or more regions to be detected from the scan model; Fit the one or more scan subsets to obtain one or more defect-free reference regions; as well as The one or more scan subsets are compared with the one or more reference regions to determine the defect regions in the one or more scan subsets and the defect parameters of the defect regions.
2. The method according to claim 1, wherein, Before fitting the one or more scan subsets to obtain one or more defect-free reference regions, the method further includes: Multiple baselines are fitted based on the multiple reference positioning points, wherein the baselines belonging to the same detection area are orthogonal to each other. A reference coordinate system for the region to be detected is constructed using the baseline of the region to be detected. The scan subset corresponding to the region to be detected is transformed from the global coordinate system to the reference coordinate system.
3. The method according to claim 2, wherein, The defect parameters include the defect center of the defect region, and the method further includes: The defect center is determined based on the geometric center of the defect region or the location of maximum deformation. The coordinates of the defect center are transformed from the reference coordinate system to the global coordinate system.
4. The method according to claim 2, wherein, The defect parameters further include at least one of the following: length and width of the defect region, center reference distance, edge reference distance, area of the defect region, center distance, and minimum edge distance; the method further includes: Based on the baseline of the defect region corresponding to the area to be detected, calculate the length and width of the defect region; or Calculate the minimum center-to-center distance between the defect center and the baseline; or Calculate the minimum edge reference distance between the three-dimensional data point at the boundary of the defect region and the baseline; or A three-dimensional surface segment is generated based on the three-dimensional data points at the boundary of the defect region, and the area of the defect region is calculated based on the three-dimensional surface segment; or Calculate the distance between the defect centers of every two defect regions mapped to the center distance of the corresponding non-defect region in the area to be detected; or Calculate the minimum edge distance between the three-dimensional data points at the boundary of every two defect regions.
5. The method according to claim 1, wherein, Comparing the one or more scan subsets with the one or more reference regions to determine the defect regions within the one or more scan subsets includes: Identify the initial defect regions of the one or more scan subsets; Determine a first distance between the three-dimensional data points related to the initial defect region and the reference region, wherein the first distance includes normal distance or vertical distance; Defect points are determined from the three-dimensional data points related to the initial defect region based on the first distance; The defect region is determined based on the defect point.
6. The method according to claim 5, wherein, Determining the defect region based on the defect points includes: The defect points are clustered to determine the connected defect regions.
7. The method according to claim 5, wherein, The defect parameters further include at least one of the depth of the defect region and the average depth, and the method further includes: The first distance of each of the three-dimensional data points within the defect region is traversed, and the largest first distance is determined as the depth of the defect region; or The average value of the first distance of each of the three-dimensional data points within the defect area is determined as the average depth of the defect area.
8. The method according to claim 1, wherein, The one or more regions to be detected are rectangular regions.
9. The method according to claim 1, wherein, The plurality of reference positioning points have the same shape and size. The scanning model also includes a plurality of auxiliary positioning points. The plurality of auxiliary positioning points are located at different positions than the plurality of reference positioning points on the scanning model and have different shapes and / or sizes than the plurality of reference positioning points.
10. The method according to claim 1, further comprising: The scanning model, the defect area, and the defect parameters are displayed on the display interface; wherein the display method includes at least one of the following: color coding, annotation map, and three-dimensional image.
11. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-10.
12. A computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the method as described in any one of claims 1-10.