A metal additive die defect detection method and system based on wavelet function

By using an image processing method based on wavelet functions, the problem of high-precision defect identification and classification of metal additive manufacturing molds under uneven lighting conditions was solved, realizing efficient and automated inspection of metal additive manufacturing and supporting quality control for industrial mass production.

CN121259004BActive Publication Date: 2026-04-07QUANZHOU YUNJIAN MEASUREMENT CONTROL & SENSING TECH INNOVATION RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies lack efficient automated defect detection methods in metal additive manufacturing, especially in scenarios with uneven lighting, making it difficult to achieve high-precision defect identification and classification. This results in mass production quality control failing to meet the requirements of consistency and efficiency.

Method used

An image processing method based on wavelet functions is adopted, including image acquisition, preprocessing, decomposition, feature analysis and reporting. The image is decomposed into three levels using the DB4 wavelet function. Combined with an adaptive threshold model and morphological operations, defect regions are identified and classified, and the results are reported to the MES system in real time.

Benefits of technology

It achieves high-precision defect identification and classification in uneven lighting scenarios, improves the standardization and efficiency of inspection, and supports the industrial mass production quality control of metal additive molds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121259004B_ABST
    Figure CN121259004B_ABST
Patent Text Reader

Abstract

The application provides a metal additive mold defect detection method and system based on a wavelet function, and relates to the field of graphic attribute analysis. The method comprises the following steps: firstly, acquiring a multi-dimensional surface image of a metal additive mold from a MES system through a network interface; secondly, performing normalization processing on a metal additive mold image with uneven illumination by adopting a homomorphic filtering algorithm, so as to realize non-uniform illumination correction and texture enhancement; thirdly, performing 3-layer decomposition on the processed image by using a DB4 wavelet function, and calculating the energy proportion of each frequency band; fourthly, carrying out metal additive mold defect analysis based on abnormal metal surface image features by constructing an adaptive threshold model and morphological operation, so as to realize automatic detection of the metal additive mold and generate a detection report; and finally, calling a REST interface to automatically report the metal additive manufacturing defect detection result to the MES system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graphic attribute analysis, specifically to a method and system for detecting defects in metal additive molds based on wavelet functions. It is suitable for high-precision defect identification in non-uniform optical environments and enables data interaction with a manufacturing execution system (MES). Background Technology

[0002] As metal additive manufacturing technology has completed its industrial upgrade from rapid prototyping to mass production, the quality inspection system in current mass production scenarios still largely relies on traditional manual methods. This inspection mode, which depends on the subjective judgment of operators, cannot meet the requirements of consistent inspection standards, efficient inspection, and process traceability for mass production. This problem has become a major technical bottleneck restricting the industry's large-scale development.

[0003] In recent years, the introduction of machine vision has enabled the perfect automation of defect detection, and has also provided an important development direction for the automated detection of surface defects in metal additive manufacturing parts. By acquiring surface image data of metal workpieces using high-resolution industrial cameras, and employing image processing algorithms to automatically locate and extract features of defect areas, the standardization and efficiency of the inspection process are significantly improved. The core of this invention lies in developing image processing algorithms adapted to the complex surface features of metal printed parts, particularly addressing the challenge of high-precision identification and classification of defects in metal additive molds under non-uniform optical conditions. This is of crucial significance for achieving quality control in the industrial mass production of metal additive molds. Summary of the Invention

[0004] This invention provides a method and system for defect detection in metal additive manufacturing dies based on wavelet functions, effectively solving the technical problem of defect identification in metal additive manufacturing dies under non-uniform optical conditions. Furthermore, through the technical solution described below, it achieves quality control in the industrial mass production process of metal additive manufacturing dies, specifically including:

[0005] According to a first aspect of the present invention, a method for detecting defects in metal additive manufacturing dies based on wavelet functions is provided, comprising the steps of:

[0006] Image acquisition: The surface image of the metal additive mold is acquired from the MES system via the REST interface. The image is captured by a high-resolution industrial camera with a resolution of ≥1000dpi and an acquisition angle of 0° to 360°.

[0007] Image preprocessing: Homomorphic filtering algorithm is used to process the surface image of the metal additive manufacturing mold acquired by the MES system. First, an additive model is established for the original image. After Fourier transform to the frequency domain, a Gaussian high-pass filter is used to attenuate the illumination component and enhance the reflection component. The key parameters of the filter are configured according to the material of the metal additive manufacturing mold: the image parameters for stainless steel mold are γH=1.7, γL=0.8, D0=0.4, c=0.3; the image parameters for aluminum mold are γH=1.5, γL=0.6, D0=0.4, c=0.5. Finally, after inverse transformation and post-processing, the illumination correction and texture enhancement of the surface image of the metal additive manufacturing mold are completed.

[0008] Image decomposition: The DB4 wavelet function is used to perform three-level wavelet decomposition on the preprocessed enhanced image to extract the low-frequency approximation component A3 and the high-frequency detail components D1, D2, and D3 multi-channel sub-bands; by calculating the energy value of each sub-band and its proportion of the total energy, the energy feature set of the image at different scales is obtained.

[0009] Image Feature Analysis: Based on wavelet energy proportion data from over 1000 similar normal metal additive manufacturing mold samples, a statistical baseline for the energy proportion of each sub-band is established, obtaining the mean μ and standard deviation σ. The parameter k value is dynamically selected according to the material type of the metal additive manufacturing mold: k=1.8 for steel and k=2.2 for aluminum. Pixel regions with energy proportions outside the [μ-kσ, μ+kσ] interval are identified as abnormal, generating a preliminary defect marking map. Morphological closing operations are then used to optimize the abnormal region markings, improving the continuity and completeness of the detection results. The closing operation uses elliptical structural elements, with radii set according to frequency bands: high-frequency sub-band HH radius 3, mid-frequency sub-band LH / HL radius 5, and low-frequency sub-band LL radius 7. Simultaneously, defect type, morphological description, and processing specification feature parameters are extracted from the MES system defect library. Combined with the image detection analysis results, a standardized defect detection report is generated.

[0010] Reporting test results: Call the test data reporting interface of the MES system to report the test data to the MES system.

[0011] According to a second aspect of the present invention, a wavelet function-based defect detection system for metal additive manufacturing dies is provided, comprising:

[0012] The image data acquisition module is used to acquire surface image data of metal additive molds captured by a high-resolution industrial camera in the MES system. Based on the REST interface protocol, a real-time communication network between this system and the MES system is constructed. The input parameters, output parameters and dynamic token information of the interface are clearly defined to realize the automated acquisition of multi-dimensional surface images of the metal additive mold. The images are acquired by a high-resolution industrial camera with an image resolution ≥1000dpi and an acquisition angle of 0° to 360°.

[0013] The image preprocessing module uses a homomorphic filtering algorithm to process the surface image of the metal additive manufacturing mold acquired by the MES system. First, an additive model is established on the original image. After Fourier transform to the frequency domain, a Gaussian high-pass filter is used to attenuate the illumination component and enhance the reflection component. Key filter parameters are configured according to the material of the metal additive manufacturing mold: for stainless steel molds, the parameters are γH=1.7, γL=0.8, D0=0.4, c=0.3; for aluminum molds, the parameters are γH=1.5, γL=0.6, D0=0.4, c=0.5. Finally, through inverse transform and post-processing, illumination correction and texture enhancement of the surface image of the metal additive manufacturing mold are completed.

[0014] The image analysis module is used for feature extraction and defect analysis of preprocessed image data. Specifically, it performs a three-level decomposition of the preprocessed image using the DB4 wavelet function and calculates the energy value and energy proportion of each frequency band. Then, it analyzes the image by constructing an adaptive threshold model. The core theory is to collect wavelet energy distribution data from over 1000 normal metal additive manufacturing mold samples, calculate the mean μ and standard deviation σ to construct the adaptive threshold model, and then analyze the energy characteristics of each frequency band based on the adaptive threshold model. Pixels with energy proportions exceeding the range [μ-kσ, μ+kσ] are considered suspicious regions, and morphological closing operations are performed on these suspicious regions to eliminate false defects. This morphological closing operation uses elliptical structuring elements, and the radius is set differently according to the sub-frequency band type: high-frequency sub-band HH radius is 3, mid-frequency sub-band LH / HL radius is 5, and low-frequency sub-band LL radius is 7. Finally, by extracting feature parameters from the MES system's defect library and combining them with the image analysis results, a standardized defect detection report is generated.

[0015] The data reporting module is used to integrate with the MES system to report the inspection results to the MES system in real time. By calling the system's inspection report template, it automatically generates a report file with graphic and textual information about the defect area and its cause. By calling the MES's REST interface, it realizes the reporting of inspection result data, achieving system integration and data linkage.

[0016] The technical solution provided by this invention has the following beneficial effects:

[0017] This method, based on the three-level decomposition of image data preprocessed by homomorphic filtering algorithm using wavelet function (DB4) to calculate the energy characteristics of each frequency band, further analyzes the defect image by combining a global adaptive threshold standard deviation method and morphological operations, achieving accurate identification of the target region. This method exhibits good noise resistance for metal additive manufacturing dies in non-uniform optical environments, providing a relatively effective data processing solution for the automatic detection of surface defects in metal additive manufacturing dies under such conditions. Attached Figure Description

[0018] Appendix Figure 1 This is the main flowchart of the system of the present invention.

[0019] Appendix Figure 2 This is a system model diagram of the present invention.

[0020] Appendix Figure 3 This is a flowchart of the method in Embodiment 1 of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Figure 2 An exemplary schematic diagram of a wavelet function-based defect detection system for metal additive manufacturing dies according to an embodiment of the present invention is shown, the system comprising:

[0023] The image data acquisition module is used to acquire surface image data of metal additive molds captured by a high-resolution industrial camera in the MES system. Based on the REST interface protocol, a real-time communication network between this system and the MES system is constructed. The input parameters, output parameters and dynamic token information of the interface are clearly defined to realize the automated acquisition of multi-dimensional surface images of the metal additive mold. The images are acquired by a high-resolution industrial camera with an image resolution ≥1000dpi and an acquisition angle of 0° to 360°.

[0024] The image preprocessing module is used to normalize the image data of metal additive manufacturing molds, separate the illuminance component (low frequency) and reflection component (high frequency) of the image through homomorphic filtering algorithm, and correct non-uniform lighting and enhance texture.

[0025] The image analysis module is used to extract features and analyze defects in preprocessed image data. The image decomposition involves performing a three-level decomposition of the preprocessed image using the DB4 wavelet function and calculating the energy value and energy proportion of each frequency band. Then, an adaptive threshold model is constructed to analyze the image. The core theory is to collect the wavelet energy distribution of normal metal additive manufacturing mold samples, calculate the mean μ and standard deviation σ to construct the adaptive threshold model, and then analyze the energy characteristics of each frequency band based on the adaptive threshold model. Pixels with energy proportions exceeding the range [μ-kσ, μ+kσ] are considered suspicious areas, and morphological operations are performed on these suspicious areas to eliminate false defects. Finally, by extracting feature parameters from the MES system's defect library and combining them with the image analysis results, a standardized defect detection report is generated.

[0026] The data reporting module is used to integrate with the MES system to report the inspection results to the MES system in real time. By calling the system's inspection report template, it automatically generates a report file with graphic and textual information about the defect area and its cause. By calling the MES's REST interface, it realizes the reporting of inspection result data, achieving system integration and data linkage.

[0027] According to an example of the present invention, the wavelet-based metal additive mold defect detection system can acquire image information of the metal additive mold in the MES system through the image data acquisition module. After the image is normalized by the image preprocessing module, the image is decomposed into three layers by the B4 wavelet function through the image analysis module. The feature information of each frequency band is analyzed by the wavelet energy ratio feature + adaptive threshold model to complete the identification and location of defects in the metal additive mold. Finally, the detection result data is reported through the data reporting module to realize system integration and data linkage.

[0028] According to a first embodiment of the present invention, in the image data acquisition module, a real-time communication link with the MES system is established using the REST interface protocol to achieve automated acquisition of multi-dimensional surface images of the metal additive manufacturing mold. The process is as follows: first, a dynamic access token is requested and obtained from the MES system to complete identity authentication; then, the image acquisition interface of the MES system is called, and the interface outputs multi-dimensional surface image data of the mold. This image is acquired by a high-resolution industrial camera with an image resolution ≥1000 dpi and an acquisition angle from 0° to 360°.

[0029] According to a first embodiment of the present invention, the input image is logarithmically transformed, then Fourier transformed to the frequency domain, high and low frequency components are separated by a Gaussian filter, and then the corrected image is obtained by inverse transformation and exponential restoration.

[0030] According to a first embodiment of the present invention, the original image acquired in the MES system is modeled as the product of the illumination component and the reflection component, expressed as:

[0031]

[0032] Where f(x, y) represents the original image; i(x, y) represents the illuminance component; and r(x, y) represents the reflectance component.

[0033] Then, a logarithmic transformation is performed to separate the illumination and reflection components of the image, converting the original multiplication of the illumination and reflection components in the spatial domain into an addition in the logarithmic domain, as shown in the following formula:

[0034] ;

[0035] This allows the two components to be processed separately in the frequency domain using filters. The illumination component mainly corresponds to the low-frequency information of the image, while the reflection component mainly corresponds to the high-frequency detail information of the image.

[0036] According to a first embodiment of the present invention, a two-dimensional fast Fourier transform is performed on the logarithmically transformed image to convert the image from the spatial domain to the frequency domain, transforming it into a complex matrix containing the amplitude and phase information of the image at different frequencies, as shown in the following formula:

[0037] ;

[0038] Where I(u,v) and R(u,v) correspond to the illuminance component and the reflectance component, respectively;

[0039] Then, the spectrum is rearranged using a spectral centering formula, moving the low-frequency components that were originally located in the corners to the center of the image, while the high-frequency components are distributed around the perimeter. This rearrangement makes subsequent filter design more intuitive and convenient, especially for homomorphic filtering applications that require distinguishing between low-frequency illumination components and high-frequency reflection components.

[0040] According to a first embodiment of the present invention, a Gaussian high-pass filter is used. After processing It can effectively suppress low-frequency illumination components in an image while preserving high-frequency reflection components that reflect image details, thus achieving the core function of homomorphic filtering: the formula is as follows:

[0041] ;

[0042] Wherein, γH and γL are the high and low frequency gains, respectively, c is the sharpening coefficient, and D0 is the cutoff frequency. In practice, we set the parameters according to the material type as follows: for stainless steel molds, the image parameters are γH=1.7, γL=0.8, D0=0.4, and c=0.3; for aluminum molds, the image parameters are γH=1.5, γL=0.6, D0=0.4, and c=0.5.

[0043] According to a first embodiment of the present invention, the corrected image is obtained through inverse transform and exponential restoration. First, the filtered result is de-centered to restore the original spectral arrangement, as shown in the following formula:

[0044] ;

[0045] Where H(u,v) represents the transfer function of the Gaussian high-pass filter, and Z(u,v) represents the image frequency domain after Fourier transform; then, a two-dimensional inverse Fourier transform is performed to convert the processed frequency domain data back to the spatial domain; finally, exponential restoration is achieved according to the formula, as follows:

[0046] ;

[0047] Finally, linear grayscale restoration is performed on the reconstructed image to output the corrected image, using the following formula:

[0048] ;

[0049] Where s(x,y) refers to the grayscale value of the preprocessed image pixels; e s(x,y) This means that the difference in low grayscale values ​​is amplified by exponential operation, and then 1 is subtracted to make g(x,y)=0 when s(x,y)=0, so as to ensure the reasonableness of the grayscale range. Finally, the image g(x,y) retains the material reflection characteristics and the lighting is more uniform.

[0050] According to a first embodiment of the present invention, in the image data analysis module, the preprocessed image is decomposed into three levels using the DB4 wavelet function (Daubechies-4 wavelet), and the energy value and energy proportion of each frequency band are calculated. The processing flow is as follows:

[0051] First, input the corrected image g(x,y), define A0(x,y) = g(x,y), and perform iterative decomposition using the DB4 wavelet function, as shown in the following formula:

[0052] ;

[0053] ;

[0054] ;

[0055] ;

[0056] Among them, A i (m,n): Low-frequency approximation coefficients at the i-th scale, corresponding to the L frequency band, representing the overall contour information of the image at the current scale; D i (m,n) Horizontal / Vertical / Diagonal: High-frequency detail coefficients at the i-th scale, corresponding to edge / texture information in the horizontal, vertical, and diagonal directions, respectively; A i-1 (x,y): The coefficient matrix at scale i-1. When the initial scale i=0, A0(x,y) is the pixel value of the original image; h(•): Low-pass filter, corresponding to the wavelet's "scaling function", used to preserve low-frequency information; g(•): High-pass filter, corresponding to the wavelet's "wavelet function", used to extract high-frequency information; (In practice, the specific coefficients of DB4 need to be substituted: , , , , x-2m, y-2n: Reflects a 2x downsampling, with the scale halved after wavelet decomposition; m, n are the coordinates of the current scale. After 3 layers of decomposition, the approximation coefficients A1, D3, D2, D1 of each frequency band are obtained, specifically represented as [LL3, (HL3, LH3, HH3), (HL2, LH2, HH2), (HL1, LH1, HH1)]; where: cA3: the low-frequency approximation component of the 3rd layer (size is the original). Figure 1 / 8×1 / 8);

[0057] (HL3, LH3, HH3): High-frequency detail components of layer 3 (horizontal / vertical / diagonal direction);

[0058] (HL2, LH2, HH2): High-frequency detail components of layer 2 (size is original) Figure 1 / 4×1 / 4);

[0059] (HL1, LH1, HH1): Layer 1 high-frequency detail components (size is original) Figure 1 / 2×1 / 2);

[0060] Then, the energy of the 10 sub-bands (LL3, HL3, LH3, HH3, HL2, LH2, HH2, HL1, LH1, HH1) is quantized by the sum of the squares of the approximation coefficients of each band, as shown in the following formula:

[0061] ;

[0062] Where C(m,n) are the coefficient matrix elements corresponding to this frequency band;

[0063] The energy of each frequency band was calculated and aggregated as follows: low frequency (LL3) + third layer high frequency (HL3+LH3+HH3) + second layer high frequency (HL2+LH2+HH2) + first layer high frequency (HL1+LH1+HH1), represented as: E A3 E D3 E D2 E D1 ;

[0064] Then, add the energies of the 10 frequency bands together to obtain the total energy of all frequency bands, as shown in the following formula:

[0065] ;

[0066] Finally, the energy of each frequency band is converted into a percentage of the total energy, as shown in the following formula:

[0067] ;

[0068] This leads to the energy distribution ratio.

[0069] According to a first embodiment of the present invention, in the image data analysis module, an adaptive threshold model is constructed to analyze the image, thereby completing the defect detection of the metal additive manufacturing mold.

[0070] According to a first embodiment of the present invention, in the image data analysis module, an adaptive threshold model is constructed, and wavelet energy distribution characteristics of more than 1,000 normal metal additive manufacturing mold samples of the same type are obtained through a data platform. By calculating the mean and standard deviation of the normal samples, a statistical baseline for the energy of each frequency band is established, and the formula is as follows:

[0071] Mean μ: ;

[0072] Where: C ij The wavelet coefficients at position (i, j) in the subband are represented by M×N, which represents the subband size and is halved with each subsequent decomposition layer.

[0073] Standard deviation: ;

[0074] Where μ is the mean of the sub-band;

[0075] Finally, the adaptive threshold model was constructed, and its mathematical expression is as follows: (The value of k is dynamically adjusted according to the material type: 1.8 for steel and 2.2 for aluminum).

[0076] According to the first embodiment of the present invention, in the image data analysis module, the image energy features are analyzed by constructing an adaptive threshold model. The energy feature data of each frequency band are input, and the energy values ​​of each frequency band are compared layer by layer to see if they exceed the normal range [μ-kσ, μ+kσ]. When an anomaly is detected, a binary image is generated (the pixel value of the abnormal area is set to 255, and the normal area is 0) to complete the marking of the abnormal area.

[0077] According to a first embodiment of the present invention, in the image data analysis module, the abnormal regions are further optimized through morphological operations. An elliptical structuring element is created as a convolution kernel, where the radius is dynamically adjusted according to the frequency band type (radius 3 for the high-frequency subband HH, radius 5 for the mid-frequency subband LH / HL, and radius 7 for the low-frequency subband LL). A closing operation is then performed on the binary anomaly-marked image.

[0078] The formula is as follows:

[0079] Morphological operations are basic operations in image processing, and their formulas are as follows:

[0080] ;

[0081] Where: A is the input binary image; B is the structuring element; This indicates a dilation operation; Indicates an etching operation;

[0082] The mathematical formula for expansion is as follows:

[0083] ;

[0084] Where B^ is the symmetric set of the structuring element B about the origin, i.e., B = {-b|b∈ B}; (B^)_Z refers to the set after the symmetric set is translated to position z; If the translated symmetric structuring element (B^)_Z has an overlapping non-empty intersection with the target set A, then z belongs to the dilation result;

[0085] The mathematical formula for corrosion is as follows: ;

[0086] Where B_Z: refers to the set of structuring element B translated to coordinate z, which is the coordinates of all pixels covered by the template; If the translated structuring element B_Z must be completely contained within the target set A, then z belongs to the erosion result;

[0087] This process connects adjacent abnormal areas and fills small voids, improving the continuity and completeness of the detection results and ultimately completing the entire detection process. Finally, by extracting feature parameters from the MES system's defect library, including defect type, morphological description, and processing specifications, and combining them with the detection image analysis results, a standardized defect detection report is generated. The report template includes the following core fields: defect area image, spatial coordinate location, defect type classification, geometric dimension measurement, defect feature description, and recommended processing method.

[0088] According to a first embodiment of the present invention, the data reporting module in the image data analysis module is used to integrate with the MES system to realize the real-time reporting of test results to the MES system. Its processing flow is as follows: After the test is completed, the system's test report template is automatically invoked and a graphic report file is generated. The test result data is then reported through the REST interface of the MES system, completing system integration and data linkage. Through the REST interface of the MES system, real-time data synchronization between the test data and the QMS (Quality Management System) is achieved, perfecting the closed-loop quality traceability throughout the product's entire lifecycle.

[0089] According to the first example of the present invention, in the adaptive threshold model, considering that different materials have different noise characteristics and energy distributions during the manufacturing process, in the test process of steel and aluminum, commonly used materials for metal additive products, it was found that different judgment criteria can be used to ensure the identification rate of defects in products made of different materials. Therefore, the present invention introduces an adaptive k-value, so that the same detection algorithm can adapt to the detection needs of different materials without retraining the model. Only the k-value parameter needs to be adjusted, which improves the versatility and practicality of the system.

[0090] Figure 3 A flowchart of a wavelet function-based defect detection method for metal additive manufacturing dies according to an embodiment of the present invention is shown as an example, the method comprising:

[0091] Step S101: Obtain multi-dimensional surface images of the metal additive mold from the MES system via a network interface;

[0092] Step S102: The homomorphic filtering algorithm is used to normalize the image of the metal additive mold with uneven illumination, so as to realize non-uniform illumination correction and texture enhancement.

[0093] Step S103: Use the DB4 wavelet function to perform a 3-level decomposition on the processed image and calculate the energy proportion of each frequency band;

[0094] Step S104, Data Feature Analysis Process 1: Establish the statistical baseline of normal samples and construct an adaptive threshold model;

[0095] Step S105, Data Feature Analysis Process Two: Use an adaptive threshold model (k value dynamically adjusted according to material type) to determine whether the energy of each frequency band of the test image is abnormal, and generate a binary anomaly marker map;

[0096] Step S106, Data Feature Analysis Process Three: Morphological operations are used to optimize the marking of abnormal areas to improve the continuity and completeness of the detection results; finally, by extracting feature parameters (including defect type, morphological description and processing specifications) from the MES system defect library and combining them with the detection image analysis results, a standardized defect detection report is generated.

[0097] Step S107: Call the REST interface to report the detection data to the MES system.

[0098] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are merely examples and do not limit the present invention. The objectives of the present invention have been fully and effectively achieved. The functions and structural principles of the present invention have been demonstrated and explained in the embodiments, and any variations or modifications may be made to the implementation of the present invention without departing from the stated principles.

Claims

1. A method for detecting defects in metal additive manufacturing dies based on wavelet functions, characterized in that, The method is applicable to metal additive manufacturing molds with complex surface features in non-uniform optical environments, and constructs an automated defect detection solution deeply integrated with the MES system, including: Image acquisition: The surface image of the metal additive mold is acquired from the MES system via the REST interface. The image is captured by a high-resolution industrial camera with an image resolution of ≥1000dpi and an acquisition angle of 0° to 360°. Image preprocessing: Homomorphic filtering algorithm is used to process the surface image of the metal additive manufacturing mold acquired by the MES system. First, an additive model is established for the original image. After Fourier transform to the frequency domain, a Gaussian high-pass filter is used to attenuate the illumination component and enhance the reflection component. The key parameters of the filter are configured according to the material of the metal additive manufacturing mold: the image parameters for stainless steel mold are γH=1.7, γL=0.8, D0=0.4, c=0.3; the image parameters for aluminum mold are γH=1.5, γL=0.6, D0=0.4, c=0.

5. Finally, after inverse transformation and post-processing, the illumination correction and texture enhancement of the surface image of the metal additive manufacturing mold are completed. Image decomposition: The DB4 wavelet function is used to perform three-level wavelet decomposition on the preprocessed enhanced image to extract the low-frequency approximation component A3 and the high-frequency detail components D1, D2, and D3 multi-channel sub-bands; by calculating the energy value of each sub-band and its proportion of the total energy, the energy feature set of the image at different scales is obtained. Image Feature Analysis: Based on wavelet energy proportion data from over 1000 similar normal metal additive manufacturing mold samples, a statistical baseline for the energy proportion of each sub-band is established, obtaining the mean μ and standard deviation σ. The parameter k value is dynamically selected according to the material type of the metal additive manufacturing mold: k=1.8 for steel and k=2.2 for aluminum. Pixel regions with energy proportions outside the [μ-kσ, μ+kσ] interval are identified as abnormal, generating a preliminary defect marking map. Morphological closing operations are then used to optimize the abnormal region markings, improving the continuity and completeness of the detection results. The closing operation uses elliptical structural elements, with radii set according to frequency bands: high-frequency sub-band HH radius 3, mid-frequency sub-band LH / HL radius 5, and low-frequency sub-band LL radius 7. Simultaneously, defect type, morphological description, and processing specification feature parameters are extracted from the MES system defect library. Combined with the image detection analysis results, a standardized defect detection report is generated. Reporting test results: Call the test data reporting interface of the MES system to report the test data to the MES system.

2. The method for detecting defects in metal additive manufacturing dies based on wavelet functions according to claim 1, characterized in that, Image acquisition: The MES system provides a network interface for acquiring images of the surface of metal additive molds. We use this interface to acquire images of the surface of metal additive molds from the MES system, which are captured by a high-resolution industrial camera. The image resolution is ≥1000dpi and the acquisition angle is 0° to 360°.

3. The method for detecting defects in metal additive manufacturing dies based on wavelet functions according to claim 1, characterized in that, Image preprocessing involves normalizing the surface image of the metal additive manufacturing mold obtained from the MES system using a homomorphic filtering algorithm. The homomorphic filtering algorithm separates the illuminance and reflectance components of the image, achieving non-uniform illumination correction and texture enhancement. The core formulas and steps are as follows: a. Convert the multiplicative model to an additive model to avoid the limitations of the direct Fourier transform, as shown in the following formula: The original image f(x, y) is represented as the product of the illuminance component i(x, y) and the reflectance component r(x, y): After logarithmic transformation, we obtain the additive model: b. Transform the image to the frequency domain using Fourier transform. Perform a Fourier transform on the logarithmic image z(x,y)=lnf(x,y) to separate the frequency domain components: I(u,v) and R(u,v) correspond to the illuminance component and the reflectance component, respectively; c. Attenuate the illumination component and enhance the reflection component using a Gaussian high-pass filter H(u,v): Where γH and γL are the high and low frequency gains, respectively, c is the sharpening coefficient, and D0 is the cutoff frequency; and the configuration is differentiated according to the material of the metal additive manufacturing mold: the image parameters for stainless steel mold are γH=1.7, γL=0.8, D0=0.4, c=0.3; and the image parameters for aluminum mold are γH=1.5, γL=0.6, D0=0.4, c=0.5; finally, the illumination normalization and texture enhancement of the metal additive manufacturing mold are completed. ‌ d. Inverse transform and post-processing: The filtered image s(x, y) is obtained by inverse Fourier transform, as shown in the following formula: Restore linear grayscale range and output enhanced image: Where s(x,y) refers to the grayscale value of the preprocessed image pixels; e s(x,y) This means that the difference in low grayscale values ​​is amplified by exponential operation, and then 1 is subtracted to make g(x,y)=0 when s(x,y)=0, so as to ensure the reasonableness of the grayscale range. Finally, the image g(x,y) retains the material reflection characteristics and the lighting is more uniform.

4. The method for detecting defects in metal additive manufacturing dies based on wavelet functions according to claim 1, characterized in that, Image decomposition and feature analysis are employed to identify defects in metal additive manufacturing molds by utilizing wavelet energy features and constructing an adaptive threshold model. The DB4 wavelet function is used to perform a three-level decomposition of the image, dividing it into sub-bands of different scales, including low-frequency approximation components and multiple high-frequency detail components. This multi-level decomposition reveals the energy features at different scales within the image. The core formulas and steps are as follows: a. Initial definition: The original two-dimensional image signal X(x,y), where x,y are discrete pixel coordinates, is defined as the low-frequency approximation component of layer 0, i.e. ; b. Iterative decomposition formula: For the (i-1)th layer low-frequency component A {i-1} (x,y), through high-pass and low-pass filtering and downsampling of DB4 wavelets, is decomposed into the i-th layer low-frequency approximate component A. i (x,y) and high-frequency detail components D i (x, y), the mathematical relationship is: Among them, A i (m,n): Low-frequency approximation coefficients at the i-th scale, corresponding to the L frequency band, representing the overall contour information of the image at the current scale; D i (m,n) Horizontal / Vertical / Diagonal: High-frequency detail coefficients at the i-th scale, corresponding to edge / texture information in the horizontal, vertical, and diagonal directions, respectively; A i-1 (x,y): The coefficient matrix at the (i-1)th scale. When the initial scale i=0, A0(x,y) is the pixel value of the original image; h(•): Low-pass filter, corresponding to the wavelet's "scaling function", used to preserve low-frequency information; g(•): High-pass filter, corresponding to the wavelet's "wavelet function", used to extract high-frequency information; x-2m, y-2n: Represents 2x downsampling. After wavelet decomposition, the scale is halved. m, n are the coordinates of the current scale; After three iterations, the original image X(x,y) is decomposed into one low-frequency approximation component A3 and three sets of high-frequency detail components D1, D2, and D3, as shown in the following formula: Where A3 is the third-layer approximation coefficient, i.e., the low-frequency part; D3 is the third-layer detail coefficient, i.e., the high-frequency part; D2 and D1 are the second-layer and first-layer detail coefficients, respectively; c. Single-band energy: The energy of each frequency band is calculated using the frequency band energy calculation formula. For a certain frequency band coefficient matrix C, the energy is defined as the sum of the squares of the coefficient moduli. Where C(m,n) are the coefficient matrix elements corresponding to this frequency band; The total energy is the sum of the energies of all frequency bands, as shown in the following formula: d. Calculate the capability proportion of each frequency band using the proportion formula. The analysis results can reveal the energy characteristic distribution of the image. The formula is as follows: ; By constructing an adaptive threshold model and performing morphological operations, defect areas are accurately extracted, and defect types are analyzed based on feature descriptions in the MES system's defect library, ultimately generating an inspection report.

5. The method for detecting defects in metal additive manufacturing dies based on wavelet functions according to claim 4, characterized in that, The aforementioned adaptive threshold model is constructed by combining the energy proportion of each frequency band with the adaptive threshold model for defect analysis. By establishing a statistical baseline of normal samples and combining it with an adaptive k-value, different judgment criteria are used to ensure the identification rate of defects in products made of different materials. This completes the construction of the adaptive threshold model, allowing the same detection algorithm to adapt to the detection needs of different materials without retraining the model. Only the k-value parameter needs to be adjusted, which improves the versatility and practicality of the system. Its core formula is as follows: a. Baseline Establishment: Collect wavelet energy ratio distribution data from normal metal additive manufacturing mold samples, and calculate the mean μ and standard deviation σ for each frequency band; for any sub-band, the coefficient matrix size is M×N, and the formula for calculating the mean μ is: Where: C ij The wavelet coefficients at position (i, j) in the subband are represented by M×N, which represents the subband size and is halved with each subsequent decomposition layer. The formula for calculating the standard deviation is: Where μ is the mean of the sub-band; b. Defect analysis is performed on the energy proportion of each frequency band using an adaptive threshold model. Pixels with energy proportions exceeding [μ-kσ, μ+kσ] are considered suspicious regions, as shown in the following formula: The threshold value of k can be dynamically adjusted according to the type of material; for steel, k=1.8, and for aluminum, k=2.

2.

6. The method for detecting defects in metal additive manufacturing dies based on wavelet functions according to claim 4, characterized in that, The morphological operations described herein obtain appropriate morphological operation radii based on the frequency band type, wherein: the radius for the high-frequency subband HH is 3, the radius for the mid-frequency subband LH / HL is 5, and the radius for the low-frequency subband LL is 7; an elliptical structuring element is created as the convolution kernel to perform a closing operation on the anomaly marker map, the core formula of which is as follows: Morphological operations are basic operations in image processing, and their formulas are as follows: Where: A is the input binary image; B is the structuring element; Indicates an expansion operation; Indicates an etching operation; The mathematical formula for expansion is as follows: Where B^ is the symmetric set of the structuring element B about the origin, i.e., B = {-b|b∈ B}; (B^)_z refers to the set after the symmetric set is translated to position z; If the translated symmetric structuring element (B^)_z has an overlapping non-empty intersection with the target set A, then z belongs to the dilation result. The mathematical formula for corrosion is as follows: Where B_z: refers to the set of structuring element B translated to coordinate z, which is the coordinates of all pixels covered by the template; If the translated structuring element B_z must be completely contained within the target set A, then z belongs to the erosion result; Further corrections to the detection results are made to improve the continuity and completeness of abnormal detection results. Then, by extracting feature parameters from the MES system defect library, including defect type, morphological description and processing specifications, and combining them with the detection image analysis results, a standardized defect detection report is generated.

7. The method for detecting defects in metal additive manufacturing dies based on wavelet functions according to claim 1, characterized in that, After the inspection is completed, the system inspection report template is automatically triggered. By extracting feature parameters from the MES system defect library, including defect type, morphological description and processing specifications, and combining them with the inspection image analysis results, a standardized defect inspection report is generated. The report template includes the following core fields: defect area image, spatial coordinate location, defect type classification, geometric dimension measurement, defect feature description and recommended processing method, and reports the inspection result data through the MES REST interface to complete system integration and data linkage.

8. A defect detection system for metal additive manufacturing molds based on wavelet functions, characterized in that, include: The image data acquisition module is used to acquire image data of the surface of metal additive molds captured by a high-resolution industrial camera in the MES system. Based on the REST interface protocol, a real-time communication network between this system and the MES system is constructed. The input parameters, output parameters and dynamic token information of the interface are clearly defined to realize the automated acquisition of multi-dimensional surface images of metal additive molds. The images are acquired by a high-resolution industrial camera with an image resolution ≥1000dpi and an acquisition angle of 0° to 360°. The image preprocessing module uses a homomorphic filtering algorithm to process the surface image of the metal additive manufacturing mold acquired by the MES system. First, an additive model is established on the original image. After Fourier transform to the frequency domain, a Gaussian high-pass filter is used to attenuate the illumination component and enhance the reflection component. Key filter parameters are configured according to the material of the metal additive manufacturing mold: for stainless steel molds, the parameters are γH=1.7, γL=0.8, D0=0.4, c=0.3; for aluminum molds, the parameters are γH=1.5, γL=0.6, D0=0.4, c=0.

5. Finally, through inverse transform and post-processing, illumination correction and texture enhancement of the surface image of the metal additive manufacturing mold are completed. The image analysis module is used for feature extraction and defect analysis of preprocessed image data. Specifically, it performs a three-level decomposition of the preprocessed image using the DB4 wavelet function and calculates the energy value and energy proportion of each frequency band. Then, an adaptive threshold model is constructed to analyze the image. The core theory is to collect wavelet energy distribution data from over 1000 normal metal additive manufacturing mold samples, calculate the mean μ and standard deviation σ to construct the adaptive threshold model, and then analyze the energy characteristics of each frequency band based on the adaptive threshold model. Pixels with energy proportions exceeding the range [μ-kσ, μ+kσ] are considered suspicious regions, and morphological closing operations are performed on these suspicious regions to eliminate false defects. This morphological closing operation uses elliptical structuring elements, and the radius is set differently according to the sub-frequency band type: high-frequency sub-band HH radius is 3, mid-frequency sub-band LH / HL radius is 5, and low-frequency sub-band LL radius is 7. Finally, by extracting feature parameters from the MES system's defect library and combining them with the image analysis results, a standardized defect detection report is generated. The data reporting module is used to integrate with the MES system to report the inspection results to the MES system in real time. By calling the system's inspection report template, it automatically generates a report file with graphic and textual information about the defect area and its cause. By calling the MES's REST interface, it realizes the reporting of inspection result data, achieving system integration and data linkage.

Citation Information

Patent Citations

  • Product design optimization system and method based on image model

    CN120510123A

  • Crown cap surface defect online inspection method employing image processing

    WO2020248439A1