Metal material surface defect detection method, device and equipment and storage medium
By acquiring the spatial alignment and clustering analysis of standard 3D point cloud templates and measured point cloud data, the problems of low accuracy and poor adaptability of surface defect detection of metal materials in the existing technology are solved, and high-precision and automated defect identification and detection are realized.
Patent Information
- Application Number
- CN202511622593.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-01-16
AI Technical Summary
Existing methods for detecting surface defects in metallic materials suffer from low accuracy and poor adaptability due to point cloud offset, reliance on manual settings and fixed thresholds. These methods struggle to cope with normal tolerance fluctuations between different molds or production batches, easily leading to false alarms or missed detections.
By acquiring a standard 3D point cloud template and measured point cloud data of the target metallic material, the measured data is preprocessed and spatially aligned with the standard template to generate geometric difference residuals. Combined with threshold screening and cluster analysis, high-precision and automated detection of surface defects is achieved.
It effectively eliminates overall offset caused by installation deviation or production line vibration, improves detection stability, increases the detection rate of minute deformations, reduces false alarm rate, adapts to multi-variety and variable batch production scenarios, and significantly improves detection efficiency and intelligence level.
Smart Images

Figure CN121353256A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of surface quality testing technology for metallic materials, and in particular to a method, apparatus, equipment, and storage medium for detecting surface defects in metallic materials. Background Technology
[0002] Currently, common methods for detecting surface defects in metal materials in industrial settings are primarily based on 3D vision technology. Typical solutions include the fixed threshold method and the manually defined ROI comparison method. The fixed threshold method sets upper and lower limits for depth deviation (e.g., ±0.2mm) and classifies areas exceeding these limits as defects, widely used in online inspection of products such as aluminum profiles. Another method involves operators manually selecting a reference area (ROI) and using the local mean as a benchmark for real-time comparison, combined with Gaussian smoothing and other filtering techniques to improve stability. These technologies are commonly found in structured light and laser triangulation systems and are used in inspection equipment from manufacturers such as Keyence, SICK, and Cognex.
[0003] However, existing methods have significant limitations: First, fixed thresholds lack dynamic adaptability and are difficult to cope with normal tolerance fluctuations between different molds or production batches, which can easily lead to false alarms or missed detections; second, ROI depends on manual setting, which is highly subjective and difficult to cover complex cross-sectional structures or defect areas with variable locations; third, no geometric reference model of "ideal profile" has been established, and based only on local statistical comparisons, it is impossible to identify small but continuous deformation trends; finally, when the pose of the overall point cloud changes under interference such as production line vibration and traction offset, there will be offset, which will increase the risk of misjudgment. Summary of the Invention
[0004] In view of this, the embodiments of this application provide a method, apparatus, device and storage medium for detecting defects on the surface of metal materials, which can effectively solve the problems of low defect recognition accuracy and poor adaptability caused by point cloud offset, reliance on manual setting and fixed threshold in the prior art.
[0005] In a first aspect, embodiments of this application provide a method for detecting surface defects in metallic materials, including: Obtain a standard 3D point cloud template and measured point cloud data of the target metallic material surface; The measured point cloud data is preprocessed to obtain preprocessed measured point cloud data; Based on the registration algorithm, the preprocessed measured point cloud data is spatially aligned with the standard 3D point cloud template to obtain the registration result. Based on the registration results, residual data is generated to characterize the geometric differences of the metal surface, and candidate defect regions are identified from the residual data; Cluster analysis is performed on the candidate defect regions to obtain defect information on the surface of the metal material.
[0006] In some embodiments, acquiring the standard three-dimensional point cloud template and measured point cloud data of the target metal material surface includes: Multiple qualified sample point clouds are extracted from the historical production records of the target metal material surface, and the coordinates of the qualified sample point clouds are aligned and the mean is calculated to obtain a standard three-dimensional point cloud template. The collection area range is determined based on the standard three-dimensional point cloud template. Within the acquisition area, a three-dimensional scanning device is used to acquire point cloud data of the surface of the metal material to be inspected, thereby obtaining measured point cloud data.
[0007] In some embodiments, the preprocessing of the measured point cloud data to obtain preprocessed measured point cloud data includes: Anomaly removal processing is performed on the measured point cloud data to obtain denoised point cloud data; The denoised point cloud data is downsampled based on a voxel partitioning algorithm to obtain preprocessed measured point cloud data.
[0008] In some embodiments, the step of spatially aligning the preprocessed measured point cloud data with the standard 3D point cloud template based on a registration algorithm to obtain a registration result includes: The preprocessed measured point cloud is compared with the standard 3D point cloud template by iterative nearest point matching to obtain spatial transformation parameters. The standard 3D point cloud template is subjected to coordinate transformation based on the spatial transformation parameters to generate a registration result.
[0009] In some embodiments, generating residual data characterizing geometric differences on the metal surface based on the registration result, and identifying candidate defect regions from the residual data, includes: Based on the registration results, the spatial distance between the preprocessed measured point cloud data and the nearest neighbor point in the standard three-dimensional point cloud template is calculated to obtain the residual point cloud data. The residual point cloud data is subjected to threshold filtering to extract the point set with deviations exceeding a preset threshold as candidate defect regions.
[0010] In some embodiments, performing cluster analysis on the candidate defect regions to obtain defect information on the surface of the metallic material includes: Based on the density clustering algorithm, the point set in the candidate defect region is divided into clusters to obtain multiple defect point clusters; Size and location parameters are extracted from the multiple defect clusters to determine the defect information on the surface of the metal material.
[0011] In some embodiments, the method further includes: Based on the defect type, location parameters, and size parameters in the defect information, a defect report containing a defect description is generated.
[0012] Secondly, embodiments of this application provide a device for detecting surface defects in metallic materials, comprising: The data acquisition module is used to acquire standard three-dimensional point cloud templates and measured point cloud data of the target metal material surface; The data processing module is used to preprocess the measured point cloud data to obtain preprocessed measured point cloud data. The alignment module is used to perform spatial alignment processing between the preprocessed measured point cloud data and the standard 3D point cloud template based on the registration algorithm to obtain the registration result. The identification module is used to generate residual data to characterize the geometric differences of the metal surface based on the registration result, and to identify candidate defect regions from the residual data; The clustering analysis module is used to perform clustering analysis on the candidate defect regions to obtain defect information on the surface of the metal material.
[0013] Thirdly, embodiments of this application provide a terminal device, the terminal device including a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the metal material surface defect detection method of the first aspect described above.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium, wherein when the computer program is executed on a processor, it implements the metal material surface defect detection method of the first aspect described above.
[0015] The embodiments of this application have the following beneficial effects: By acquiring a standard three-dimensional point cloud template and measured point cloud data of the target metal material, the measured data is preprocessed and then spatially aligned with the standard template based on a registration algorithm to generate residual data characterizing geometric differences, identifying candidate defect regions, and determining the final defect information through cluster analysis. The method of this application effectively eliminates overall offset caused by installation deviations or production line vibrations by introducing precise registration between the standard three-dimensional point cloud template and the measured point cloud, thus improving detection stability; residual analysis can quantitatively identify minute deformations, improving the detection rate of latent defects such as grooves and spalling; combined with density cluster analysis, it can distinguish between real defects and isolated noise points, reducing false alarm rates, adapting to multi-variety and variable-batch production scenarios, and significantly improving detection efficiency and intelligence. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart of a method for detecting surface defects in metallic materials according to an embodiment of this application is shown; Figure 2 Another flowchart of the method for detecting surface defects of metallic materials according to an embodiment of this application is shown; Figure 3 This illustrates yet another flowchart of a method for detecting surface defects in metallic materials according to an embodiment of this application; Figure 4 A schematic diagram of a structure in a method for detecting surface defects in metallic materials according to an embodiment of this application is shown. Detailed Implementation
[0018] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0019] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0020] In the following text, the terms "comprising," "having," and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more combinations thereof. Furthermore, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0021] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0022] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0023] Considering the problems of low defect identification accuracy and poor adaptability in existing technologies due to point cloud offset, reliance on manual settings and fixed thresholds, this application proposes a method for detecting surface defects in metallic materials. This method acquires a standard 3D point cloud template and measured point cloud data of the target metallic material. After preprocessing the measured data, it spatially aligns it with the standard template to generate geometric difference residuals. Combined with threshold filtering and cluster analysis, this achieves high-precision, automated detection of surface defects.
[0024] The following describes the method for detecting surface defects in this metallic material using specific examples.
[0025] Figure 1 A flowchart of a method for detecting surface defects in metallic materials according to an embodiment of this application is shown. Exemplarily, this method for detecting surface defects in metallic materials includes the following steps: Step S100: Obtain the standard three-dimensional point cloud template and measured point cloud data of the target metal material surface.
[0026] The standard 3D point cloud template refers to a spatial reference data model used to describe the ideal geometric shape of the target metallic material, while the measured point cloud data refers to the set of spatial coordinates of the current workpiece surface collected by a 3D scanning device during the production process. This step establishes a standard point cloud reference in the system and simultaneously collects real-time point cloud data of the corresponding workpiece, providing an input basis for subsequent spatial registration and surface difference calculation.
[0027] In an optional embodiment, step S100 includes the following sub-steps: S101: Extract multiple qualified sample point clouds from the historical production records of the target metal material surface, perform coordinate alignment and mean calculation on the qualified sample point clouds to obtain a standard three-dimensional point cloud template, and determine the collection area range based on the standard three-dimensional point cloud template.
[0028] Among them, qualified sample point cloud refers to the three-dimensional scanning result of the surface of a historical workpiece that has been judged to meet the specifications through quality inspection, and coordinate alignment refers to performing rigid registration on multiple sample point clouds so that different samples coincide under the same spatial reference.
[0029] As an example, N consecutive qualified samples (e.g., N=50) are selected from historical records, and a rigid registration algorithm is used to align the sample point clouds. Then, the coordinates of corresponding points of all samples are averaged to obtain an average point cloud model with ideal geometric shape. The generated standard 3D point cloud template can be further subjected to statistical outlier removal (SOR) filtering to eliminate noise points, and it is stored in the database as a mold number; for example, for mold number MOLD-2025A, a standard point cloud template with a resolution of 0.1 mm and containing approximately 500,000 points can be generated.
[0030] For example, when inspecting different types of metal profiles, the standard template data of the corresponding mold can be automatically loaded from the template database, and the boundary information of the template can be used to determine the collection area range for subsequent scanning.
[0031] S102, within the acquisition area, a three-dimensional scanning device is used to acquire point cloud data of the surface of the metal material to be inspected, and the measured point cloud data is obtained.
[0032] The 3D scanning device can be a structured light scanner, a laser triangulation instrument, or a line laser sensor, which can acquire the spatial coordinates of the metal surface at millimeter-level resolution.
[0033] As an example, in production line implementation, when metal materials pass through a designated inspection station, a line laser scanner can scan along the profile axis to collect raw point cloud P. The scanning results are then imported into the processing system via a real-time data interface. The system performs timestamp marking and batch number registration on the collected point cloud data, completing the acquisition of measured point cloud data.
[0034] In other implementations, if the production line adopts a multi-station synchronous scanning structure, multiple 3D scanning devices can collect data from different cross sections in parallel, and the system performs stitching processing on the point clouds of each cross section to obtain a complete measured point cloud dataset.
[0035] Step S200: Preprocess the measured point cloud data to obtain preprocessed measured point cloud data.
[0036] The measured point cloud data refers to the original point set of the metal material surface acquired through a 3D scanning device, which includes noise, flypoints, and redundant data. Preprocessing refers to the process of performing denoising and downsampling operations on the original point cloud, with the aim of improving the subsequent registration accuracy and reducing the computational load. The preprocessed measured point cloud data is a high-quality point cloud obtained after outlier removal and spatial downsampling, possessing higher geometric fidelity and computational efficiency. The purpose of this step is to eliminate random interference introduced during the acquisition process, reduce the amount of invalid data, and provide a stable and lightweight foundation for subsequent spatial alignment.
[0037] In an optional embodiment, step S200 includes the following sub-steps: S201, perform outlier removal processing on the measured point cloud data to obtain denoised point cloud data.
[0038] The outlier removal process, specifically the Statistical Outlier Removal (SOR) operation, is used to remove outliers and fly-by points from the measured point cloud data to obtain a stable neighborhood structure. In practice, a local nearest neighbor set is established for each point, local statistics are calculated, and outliers that do not meet the statistical threshold are filtered out. The resulting denoised point cloud data serves as input for subsequent downsampling. For example, when a workpiece is subjected to traction vibration or there is occasional glare on-site, isolated high-deviation points in the original point cloud are removed through this outlier removal process, ensuring that the remaining point set maintains a spatial distribution consistent with the actual surface.
[0039] S202, based on the voxel partitioning algorithm, downsamples the denoised point cloud data to obtain the preprocessed measured point cloud data.
[0040] The voxel partitioning algorithm is a voxel grid-based downsampling method. It reduces data volume by dividing the space into fixed-scale voxel units and replacing the original points within each voxel with representative points. For example, a three-dimensional voxel grid is constructed for the denoised point cloud data, and representative points are calculated for each voxel to form a sparse but uniform point set, resulting in preprocessed measured point cloud data. For instance, when the template resolution is set to 0.1 mm, voxel downsampling ensures that the measured point cloud and the template maintain the same point density scale, thus preserving the same spatial granularity in subsequent processing steps.
[0041] In other implementations, the scale of the voxel grid can be configured according to the point cloud density of different molds or process batches to adapt to different point cloud scales and hardware throughput capabilities. In a production line structure with multi-station parallel acquisition, the denoised point clouds output by each station can be downsampled by voxels and then stitched together to obtain preprocessed measured point cloud data.
[0042] Step S300: Based on the registration algorithm, the preprocessed measured point cloud data is spatially aligned with the standard 3D point cloud template to obtain the registration result.
[0043] The registration algorithm refers to a mathematical method used to solve for the optimal spatial transformation relationship between two point clouds. Spatial alignment processing refers to the process of making the pre-processed measured point cloud and the standard 3D point cloud template geometrically coincide as much as possible through rotation and translation operations. The registration result refers to the standard template point cloud after alignment, whose spatial orientation is consistent with the current measured workpiece, and can be used as a reference benchmark for subsequent residual analysis. The purpose of this step is to eliminate the overall pose deviation caused by production line vibration, traction offset, or installation errors, ensure that subsequent defect identification is not affected by non-defect deformation, and improve the stability and accuracy of detection.
[0044] In one alternative embodiment, such as Figure 2 As shown, step S300 includes the following sub-steps: S301, the preprocessed measured point cloud is iteratively matched with the standard 3D point cloud template to obtain the spatial transformation parameters.
[0045] The iterative nearest neighbor matching process employs a rigid registration algorithm based on the least squares criterion, calculating the optimal rigid transformation parameters for the two point cloud sets through multiple iterations. Exemplarily, the preprocessed measured point cloud is used as the target set, and a standard 3D point cloud template is used as the reference set. In each iteration, the nearest neighbor in the target point cloud is found for each point in the template point set. The mean square error (RMS) of the two point sets is calculated, and the rotation matrix R and translation vector t are updated accordingly until a preset convergence condition is met. The convergence condition may include a maximum of no more than 50 iterations and a mean square error (RMS) less than [value missing]. Once the iteration process is complete, the output rotation matrix and translation vector constitute the spatial transformation parameters.
[0046] For example, when registering point clouds on the surface of aluminum profiles, if the initial deviation between the two sets of point clouds is large, the algorithm can quickly reduce the mean square error in the first few iterations and converge to the threshold range after 30 to 40 iterations, ensuring that the geometric alignment accuracy between the template and the measured data meets the detection requirements.
[0047] S302, based on the spatial transformation parameters, performs coordinate transformation on the standard 3D point cloud template to generate the registration result.
[0048] Wherein, the spatial transformation parameters refer to the rotation matrix (R) and translation vector (t) obtained during the iterative nearest-point matching process, used to describe the rigid pose adjustment relationship of the standard 3D point cloud template relative to the measured point cloud. Exemplarily, in a specific implementation, according to the formula: For standard 3D point cloud templates ( Perform coordinate transformation operations on each point in the coordinate system to obtain the registration result in the current measured coordinate system. After generating the registration result, the registration quality is checked, and the mean square error (RMS) between the preprocessed measured point cloud and the registered template is calculated. When the RMS value is greater than 1mm, it is determined that the workpiece has obvious deformation or misalignment, and an abnormal prompt signal is output.
[0049] For example, in the scenario of aluminum profile surface inspection, when the overall measured point cloud acquired in a certain acquisition has a lateral offset of 2mm, the rotation matrix and displacement vector obtained through iterative registration calculation can automatically correct the template posture, so that the registered template and the measured point cloud are aligned in the global coordinate system. The final calculated RMS error is approximately It meets the accuracy threshold requirements.
[0050] In other implementations, the registered template and the measured point cloud can be overlaid on a 3D visualization interface for inspection personnel to verify. In continuous production cycle scenarios, the registration parameters (R) and (t) of the previous cycle can be used as the initial input for the registration of the next cycle, thereby reducing the number of iterations and improving real-time processing efficiency.
[0051] Step S400: Generate residual data to characterize the geometric differences of the metal surface based on the registration results, and identify candidate defect regions from the residual data.
[0052] The registration result refers to a standard 3D point cloud template that has been spatially aligned, with its pose consistent with the current measured workpiece. Residual data refers to the set of local geometric deviations between the measured point cloud and the registered template, used to quantify the degree of surface deformation. Candidate defect regions refer to a set of points preliminarily identified as potentially defective, which have not yet undergone clustering verification. The purpose of this step is to compare the spatially aligned point cloud point by point, extracting abnormal regions that exceed the normal fluctuation range, serving as the input basis for subsequent defect confirmation, and achieving the crucial transformation from "overall alignment" to "local difference localization."
[0053] In one alternative embodiment, such as Figure 3 As shown, step S400 includes the following sub-steps: S401, based on the registration results, calculates the spatial distance between the preprocessed measured point cloud data and the nearest neighbor points in the standard 3D point cloud template to obtain residual point cloud data.
[0054] Among them, the nearest neighbor point refers to the spatial point in the standard 3D point cloud template represented by the registration result that has the smallest Euclidean distance to a certain point in the measured point cloud. The matching relationship is achieved through KDTree accelerated search; the spatial distance refers to the 3D Euclidean distance between the measured point and its corresponding nearest neighbor point, reflecting the local height or contour deviation; the residual point cloud data is an enhanced point cloud structure with the measured point cloud as the spatial carrier and the corresponding distance value of each point added, used for visualization and subsequent analysis.
[0055] In practice, any point in the preprocessed measured point cloud... Search for its nearest neighbor in the registered template point cloud. Calculate the Euclidean distance , with all Forming the residual set The residual set is then used to generate a residual heatmap for visual inspection. For example, in the aluminum profile inspection scenario, for a template with a resolution of 0.1 mm and the corresponding measured point cloud of the time step, nearest neighbor search and distance calculation are performed point by point to form a residual scalar field that corresponds one-to-one with the measured point, which is used for subsequent threshold filtering processing.
[0056] S402, perform threshold filtering on the residual point cloud data, and extract the point set with deviation exceeding the preset threshold as candidate defect areas.
[0057] Among them, threshold screening refers to the operation of extracting points in the residual point cloud data whose deviation value is greater than a preset threshold to form a subset; the preset threshold refers to the maximum allowable geometric deviation set according to the mold type, material characteristics or process requirements, in millimeters; the candidate defect area is the set of high deviation points retained after screening, representing the possible defect location, but the influence of isolated noise or measurement error has not yet been excluded.
[0058] As an example, the threshold The initial setting is 0.15mm, and the corresponding threshold configuration is loaded from the template database according to the mold type; a point-by-point comparison is performed on the residual set (D) to extract those that meet the requirements. The points are grouped into a set (A), which is then used as candidate defect regions and output for subsequent cluster analysis. For example, when the mold number is MOLD-2025A and the process tolerance is stable at the sub-millimeter level, the system uses... The screening process is performed to obtain high residual point bands that are continuously distributed along the profile axis, which are then used as candidate defect areas.
[0059] In other implementations, the preset threshold can be configured to different values at the system level according to the process tolerance of different molds or batches; in scenarios with multi-station parallel acquisition, the residual sets corresponding to each station can be subjected to threshold filtering and then the candidate point sets can be merged to form a unified candidate defect area.
[0060] Step S500: Perform cluster analysis on the candidate defect regions to obtain defect information on the surface of the metal material.
[0061] Here, candidate defect regions refer to the set of high-bias points retained after threshold screening, which may contain real defects and isolated noise; cluster analysis refers to the process of dividing spatially densely distributed points into independent clusters to distinguish between continuous defects and discrete interference; defect information refers to the set of defect objects confirmed by clustering, including readable attributes such as their type, location, and size. Demonstratively, based on candidate defect regions, the clustering identification and parameterized description of defects are completed by analyzing spatial point density and neighborhood relationships, providing a foundation for the final defect output.
[0062] In an optional embodiment, step S500 includes the following sub-steps: S501 uses a density clustering algorithm to divide the point set in the candidate defect region into clusters, resulting in multiple defect point clusters.
[0063] Density clustering algorithm refers to an unsupervised clustering method based on the local density characteristics of point clouds, which can identify point clusters of arbitrary shapes and automatically eliminate sparse noise; defect point cluster refers to a set of one or more spatially connected points extracted by the clustering algorithm, representing a potential real defect entity.
[0064] In practice, the system performs a neighborhood search on all points in the candidate defect region and sets the neighborhood radius. And each contains no less than the minimum number of points. High-density areas are marked as core clusters; points within a certain range of the core clusters are classified as boundary points, and isolated points are identified as noise points and ignored. Each core cluster output by the algorithm is treated as an independent defect point cluster. For example, when multiple surface protrusions or scratches exist during the inspection of aluminum profile surfaces, the high-density areas formed by each protrusion are independently divided into different defect point clusters, thereby achieving regional identification of defects.
[0065] S502 extracts size and location parameters from multiple defect clusters to determine the defect information on the surface of the metal material.
[0066] Among them, dimensional parameters refer to characteristic quantities used to describe the geometric morphology of defects, including maximum deviation value, average deviation value, area, and continuous length along the profile axis; positional parameters refer to coordinate indices reflecting the specific location of the defect in three-dimensional coordinate space. Exemplarily, in a specific implementation, the system calculates the maximum deviation value for each defect cluster. Average deviation The projected area (S) and continuous length along the axial direction (L) are used to determine the defect type based on preset rules: when the condition meets the following criteria... When the condition is met, the defect is marked as a groove; when the condition is met, the defect is marked as a groove. When the defect is identified as "bone formation", the parameters corresponding to each defect cluster are recorded as structured data to form complete defect information.
[0067] For example, in the test results, if the length of a cluster of high deviation points continuously distributed along the longitudinal direction of the profile reaches 15mm, it is classified as a "grooving" type defect according to the above judgment conditions, and its position coordinates and size indicators are output in the result file.
[0068] In other implementations, additional geometric parameters such as aspect ratio and orientation angle of the defect cluster can be calculated to adapt to the defect identification accuracy requirements of different process lines. When the detection system is connected to the manufacturing execution system (MES), the generated defect information can be associated with the corresponding production cycle number and stored for traceability analysis.
[0069] In an optional embodiment, the method for detecting surface defects in metallic materials further includes the following steps: Based on the defect type, location parameters, and size parameters in the defect information, a defect report containing a defect description is generated.
[0070] Among these, defect information refers to the set of surface defects of metal materials confirmed by cluster analysis, including the type, location, and size attributes of each defect; defect type refers to the defect category classified according to geometric features, such as grooves, burrs, pits, scratches, etc.; location parameters refer to the spatial coordinates or cycle number of the defect on the workpiece; size parameters refer to quantitative indicators such as the length, depth deviation, and projected area of the defect; and defect report refers to the technical document or data record generated after the above information is structured and integrated, used for quality traceability, process feedback, or on-site alarms. The purpose of this step is to transform the raw data output by the algorithm into highly readable and easily manageable inspection results, supporting subsequent quality analysis and system integration.
[0071] As an example, in an aluminum profile production line, after the industrial control computer receives the defect information entry output by the S502, it calls the report generation module. Based on the built-in template, it maps "defect type = groove" to the Chinese description "groove". It combines "length = 124.6mm", "depth = 0.27mm", and "location = top center" into a complete semantic sentence, and adds contextual information such as the inspection timestamp "2024-10-28 14:23:15", mold number "MJ-2024-087", and production batch "PC-6063T5-20251028". Finally, it generates a complete defect description text. This text is embedded in a JSON format report, with fields including: defect_desc: used to describe the specific content of the defect (e.g., "2mm scratch exists on the surface of the part"); position: used to record the location of the defect (e.g., "top left corner of the part"); severity_level: used to indicate the severity of the defect (e.g., "minor", "moderate", "severe"). Timestamp: Used to record the time when a defect was discovered or reported (e.g., "2024-05-2014:30:00"). The total size is approximately 2.1KB, uploaded to the enterprise quality management platform via HTTP interface.
[0072] For example, when multiple profiles produced by the same mold are continuously detected to have groove defects in similar locations, the generated defect reports will be automatically aggregated, triggering a "trend defect warning" and prompting the process department to check the mold wear. In other implementations, the defect reports may also include thumbnail point cloud images or 2D heat maps to visually display the defect distribution on the HMI interface; or be archived locally in PDF format to meet ISO quality system audit requirements.
[0073] Figure 4 A schematic diagram of a surface defect detection device for metallic materials according to an embodiment of this application is shown. Exemplarily, the device 100 includes: Data acquisition module 110 is used to acquire standard three-dimensional point cloud templates and measured point cloud data of the target metal material surface; Data processing module 120 is used to preprocess the measured point cloud data to obtain preprocessed measured point cloud data; Alignment module 130 is used to perform spatial alignment processing between the preprocessed measured point cloud data and the standard three-dimensional point cloud template based on the registration algorithm to obtain the registration result; The identification module 140 is used to generate residual data characterizing the geometric differences of the metal surface based on the registration result, and to identify candidate defect regions from the residual data; Cluster analysis module 150 is used to perform cluster analysis on the candidate defect regions to obtain defect information on the surface of the metal material.
[0074] It is understood that the apparatus of this embodiment corresponds to the method of the above embodiments, and the options in the above embodiments are also applicable to this embodiment, so they will not be described again here.
[0075] This application also provides a terminal device, exemplary of which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to enable the terminal device to perform the functions of the various modules in the above-described method or apparatus.
[0076] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0077] The memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory is used to store computer programs, and the processor can execute the computer programs accordingly after receiving execution instructions.
[0078] This application also provides a computer-readable storage medium for storing the computer program used in the aforementioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0079] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0080] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0081] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0082] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for detecting a defect on a surface of a metal material, characterized by, The method comprises: obtaining a standard three-dimensional point cloud template and measured point cloud data of a target metal material surface; preprocessing the measured point cloud data to obtain preprocessed measured point cloud data; spatially aligning the preprocessed measured point cloud data with the standard three-dimensional point cloud template based on a registration algorithm to obtain a registration result; generating residual data representing geometric differences of the metal surface according to the registration result, and identifying a candidate defect region from the residual data; performing clustering analysis on the candidate defect region to obtain defect information of the metal material surface.
2. The method of claim 1, wherein The method comprises: extracting a plurality of qualified sample point clouds from historical production records of the target metal material surface, and performing coordinate alignment and mean value calculation on the qualified sample point clouds to obtain a standard three-dimensional point cloud template, and determining a collection area range based on the standard three-dimensional point cloud template; using a three-dimensional scanning device to collect point cloud data of the current metal material surface to be detected within the collection area range to obtain measured point cloud data.
3. The method of claim 1, wherein The method comprises: performing outlier rejection processing on the measured point cloud data to obtain denoised point cloud data; performing downsampling processing on the denoised point cloud data based on a voxel division algorithm to obtain preprocessed measured point cloud data.
4. The method of claim 1, wherein The method comprises: performing iterative nearest point matching processing on the preprocessed measured point cloud and the standard three-dimensional point cloud template to obtain spatial transformation parameters; performing coordinate transformation on the standard three-dimensional point cloud template according to the spatial transformation parameters to generate a registration result.
5. The method of claim 1, wherein The method comprises: based on the registration result, calculating the spatial distance between the nearest neighbor points in the preprocessed measured point cloud data and the standard three-dimensional point cloud template to obtain residual point cloud data; performing threshold filtering on the residual point cloud data to extract a point set with a deviation exceeding a preset threshold as a candidate defect region.
6. The method of claim 1, wherein The method comprises: based on a density clustering algorithm, performing cluster division on the point set in the candidate defect region to obtain a plurality of defect point clusters; extracting size parameters and position parameters from the plurality of defect point clusters to determine defect information of the metal material surface.
7. The method of claim 1, wherein The method further comprises: based on the defect type, position parameter and size parameter in the defect information, generating a defect report containing defect description.
8. A metal material surface defect detection device characterized by comprising: It comprises: a data acquisition module for obtaining a standard three-dimensional point cloud template and measured point cloud data of a target metal material surface; a data processing module for preprocessing the measured point cloud data to obtain preprocessed measured point cloud data; An alignment module is configured to perform spatial alignment between the preprocessed measured point cloud data and the standard three-dimensional point cloud template based on a registration algorithm, and obtain a registration result; An identification module is configured to generate residual data for representing geometric differences of the metal surface according to the registration result, and identify candidate defect regions from the residual data; A clustering analysis module is configured to perform clustering analysis on the candidate defect regions, and obtain defect information of the metal material surface.
9. A terminal device, comprising: The terminal device comprises a processor and a memory, the memory stores a computer program, and the processor is configured to execute the computer program to implement the metal material surface defect detection method in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer program is stored in the memory and executed on the processor to implement the metal material surface defect detection method in any one of claims 1-7.
Citation Information
Cited By
Curved surface workpiece defect measurement method based on point cloud registration
CN121746397A
A method for measuring defects of a curved workpiece based on point cloud registration
CN121746397B